Results 1 to 3 of 3

Thread: Show each pixel in the picture represent a latitude and longitude using VB6

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2006
    Posts
    120

    Show each pixel in the picture represent a latitude and longitude using VB6

    i have a map in bitmap format.The size of picture is 1024 x 720. i need each pixel in the map represent the latitude and longitude. The latitude is from 2.85667000 to 4.01666940. The longitude is from 99.70000000 to 101.46667000. The format of latitude and longitude are decimal. Beside that, when i key in the value of latitud and longitud in text box. it can show which pixel in the picture is related to that value.

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Show each pixel in the picture represent a latitude and longitude using VB6

    Add 2 TextBoxes (Text1, Text2), Click the Picture in the PictureBox to see pixel info printed in the Form.
    VB Code:
    1. 'Prepare ScaleValues,
    2. Private Sub Form_Load()
    3.     Me.Font.Bold = True
    4.     With Picture1
    5.         .AutoRedraw = True
    6.         .ScaleLeft = 101.46667
    7.         .ScaleWidth = 99.7 - 101.46667
    8.         .ScaleTop = 2.85667
    9.         .ScaleHeight = 4.0166694 - 2.85667
    10.     End With
    11. End Sub
    12.  
    13. 'Click the Picture and the Pixel Values in that Coordinates will be printed in the Form
    14. Private Sub Picture1_Click()
    15.     With Picture1
    16.         Me.ForeColor = .Point(CDbl(Text1.Text), CDbl(Text2.Text))
    17.         Me.Print "COLOR: " & Me.ForeColor
    18.     End With
    19. End Sub
    20.  
    21. 'Update 2 TextBoxes with X and Y Coodinates when you move the mouse
    22. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    23.     Text1.Text = X
    24.     Text2.Text = Y
    25. End Sub
    I assume you want it as real world coordinates, with Latitude growing TOP - DOWN and Longitude growing RIGHT To LEFT.

  3. #3
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Show each pixel in the picture represent a latitude and longitude using VB6

    Lots of wet blue pixels.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

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