Results 1 to 5 of 5

Thread: Please helppppppppppppppppppppp!

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    2

    Please helppppppppppppppppppppp!

    Hi ! I just started on visual basic....i made a windows form application where when user open it they have to enter a user name and password to get in and then another form opens up where i would like to do this :
    1. Allow a user to click on the button to upload an image.
    2. There should also be two buttons on the left hand side labeled 1 as X and the other as O. So, when the user uploads an image he starts labeling the image with X's and O's but i also want that when he is click the X's and O's the program is storing those points to generate a summary of Xs and Os at the end.
    3. The user should be able to zoom in and zoom out on the pic.
    4. When the user clicks on X or the O's the program should ask a series of questions and that information would be used to generate the summary of click points at the end.
    5. And, once he is done labeling, he should be able to save the file.
    6. There should be a button that says done so the program knows to generate a documentation for it.
    7. On the top, there should also be bar that has option like help when u click on it, it gives you a text file.
    This is a very simple program. please help me do this. thanks ! If you could code it, i would appreciate it.
    the image when i downloaded can be resized....i mean the user should be able to zoom in and zoom out of the photo...
    one more thing the X and O you add has to be red color also when you are making a log the location has to be userdefined so each time user clicks on something the program should ask the user what is it called... and it should generate the log in excel file if possible
    Also, x and o when you mark on the photo has to be 72 points in size you know so you can zoom in on the photo and then mark it and then zoom out and then save.


    So far ,
    My code is
    Public Class frmLogin

    Public xUser As String = "username"
    Public xPass As String = "password"

    Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
    If txtUsername.Text = xUser Then
    If txtPassword.Text = xPass Then
    frmMain.Show()
    Me.Close()
    Else
    MsgBox("Incorrect password")
    End If
    Else
    MsgBox("Incorrect username")
    End If
    End Sub
    End Class.

    Public Class frmMain

    Public XOSelected As Integer = 0
    '0 for x and 1 for o
    Public MousePos As Point
    Public XOLog As String

    Private Sub btnUpload_Click(sender As Object, e As EventArgs) Handles btnUpload.Click
    opnfldlgChooseImage.ShowDialog()
    End Sub

    Private Sub opnfldlgChooseImage_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles opnfldlgChooseImage.FileOk
    Try
    pctrUsersImage.BackgroundImage = Image.FromFile(opnfldlgChooseImage.FileName)
    btnX.Enabled = True
    btnO.Enabled = True
    Catch ex As Exception
    End Try
    End Sub

    Private Sub btnX_Click(sender As Object, e As EventArgs) Handles btnX.Click
    XOSelected = 0
    SelectedChanged()
    End Sub

    Private Sub btnO_Click(sender As Object, e As EventArgs) Handles btnO.Click
    XOSelected = 1
    SelectedChanged()
    End Sub

    Public Sub SelectedChanged()
    If XOSelected = 0 Then
    lblSelected.Text = "Selected: X"
    ElseIf XOSelected = 1 Then
    lblSelected.Text = "Selected: O"
    End If
    End Sub

    Private Sub pctrUsersImage_MouseUp(sender As Object, e As MouseEventArgs) Handles pctrUsersImage.MouseUp
    Dim Gfx As Graphics = Graphics.FromImage(pctrUsersImage.BackgroundImage)
    If XOSelected = 0 Then
    Gfx.DrawString("X", New Font("Calibri", 12), New SolidBrush(Color.White), MousePos.X, MousePos.Y)
    Gfx.Dispose()
    If XOLog = "" Then
    XOLog = "X added at: x: " & MousePos.X & " y: " & MousePos.Y
    Else
    XOLog = XOLog & vbNewLine & "X added at: x: " & MousePos.X & " y: " & MousePos.Y
    End If
    ElseIf XOSelected = 1 Then
    Gfx.DrawString("O", New Font("Calibri", 12), New SolidBrush(Color.White), MousePos.X, MousePos.Y)
    Gfx.Dispose()
    If XOLog = "" Then
    XOLog = "O added at: x: " & MousePos.X & " y: " & MousePos.Y
    Else
    XOLog = XOLog & vbNewLine & "O added at: x: " & MousePos.X & " y: " & MousePos.Y
    End If
    End If
    Me.Refresh()
    End Sub

    Private Sub pctrUsersImage_MouseMove(sender As Object, e As MouseEventArgs) Handles pctrUsersImage.MouseMove
    MousePos = pctrUsersImage.PointToClient(Cursor.Position)
    End Sub

    Private Sub btnSaveImage_Click(sender As Object, e As EventArgs) Handles btnSaveImage.Click
    svfldlgSaveImage.ShowDialog()
    End Sub

    Private Sub svfldlgSaveImage_FileOk(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles svfldlgSaveImage.FileOk
    Dim path As String = svfldlgSaveImage.FileName
    Dim bmp As Bitmap
    Try
    bmp = Me.pctrUsersImage.BackgroundImage
    bmp.Save(path)
    My.Computer.FileSystem.WriteAllText(Application.StartupPath & "\XO Log.txt", XOLog, False)
    MsgBox("Image and log file has been generated, I will now open them for you. The log contains every position of the X and O.")
    Process.Start(svfldlgSaveImage.FileName)
    Process.Start(Application.StartupPath & "\XO Log.txt")
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    End Sub
    End Class

  2. #2
    Fanatic Member
    Join Date
    Dec 2007
    Location
    West Yorkshire, UK
    Posts
    791

    Re: Please helppppppppppppppppppppp!

    Quote Originally Posted by mac2cd View Post
    If you could code it, i would appreciate it.
    You think you would, but you would not learn anything that way so, no.
    The purpose of this forum is to learn. We can help you with specific problems you have in your code but you have to do the work yourself.
    I don't see a question in your post. If you ask a question, somebody can answer it. If you don't, we can't.
    By the way, you should use a more descriptive thread title. "Please Help" applies to every single thread on this forum.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    2

    Re: Please helppppppppppppppppppppp!

    Quote Originally Posted by Españolita View Post
    You think you would, but you would not learn anything that way so, no.
    The purpose of this forum is to learn. We can help you with specific problems you have in your code but you have to do the work yourself.
    I don't see a question in your post. If you ask a question, somebody can answer it. If you don't, we can't.
    By the way, you should use a more descriptive thread title. "Please Help" applies to every single thread on this forum.
    I think thats what I asked for is help and not for you to write me a code. As you can see, i have already written code i need corrections

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Please helppppppppppppppppppppp!

    i need corrections
    And we need to know exactly what the problem is. You cannot expect people to trawl through your code trying to work out what might be a problem. If you're getting errors tell us what and where. If you're getting unexpected results tell us what you expected and what you're getting. Details, details, details!!!!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  5. #5

    Re: Please helppppppppppppppppppppp!

    Quote Originally Posted by dunfiddlin View Post
    And we need to know exactly what the problem is. You cannot expect people to trawl through your code trying to work out what might be a problem. If you're getting errors tell us what and where. If you're getting unexpected results tell us what you expected and what you're getting. Details, details, details!!!!
    Honestly, with all the p's in the title, I expected him to have to use the bathroom!
    But yes, to reiterate what dunfiddlin said, we need to know what exactly is wrong before we can help you. Have you heard the saying, "You need to help us before we can help you"? It applies here. I can stare at your code all day until my monitor changes the text into wingdings and start to dance, but I'm not going to look for your error in your code! We are volunteers. We have a life (haha oh jeez what am I saying. We're programmers...). We could spend an hour reading your code line-by-line (without really knowing your form design), and find that one little logical error that might fix your problem temporarily and unearth several other problems! I've seen it several times here; so have several others.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width