|
-
Jan 29th, 2007, 10:52 PM
#1
Thread Starter
Lively Member
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.
-
Jan 29th, 2007, 11:59 PM
#2
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:
'Prepare ScaleValues,
Private Sub Form_Load()
Me.Font.Bold = True
With Picture1
.AutoRedraw = True
.ScaleLeft = 101.46667
.ScaleWidth = 99.7 - 101.46667
.ScaleTop = 2.85667
.ScaleHeight = 4.0166694 - 2.85667
End With
End Sub
'Click the Picture and the Pixel Values in that Coordinates will be printed in the Form
Private Sub Picture1_Click()
With Picture1
Me.ForeColor = .Point(CDbl(Text1.Text), CDbl(Text2.Text))
Me.Print "COLOR: " & Me.ForeColor
End With
End Sub
'Update 2 TextBoxes with X and Y Coodinates when you move the mouse
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = X
Text2.Text = Y
End Sub
I assume you want it as real world coordinates, with Latitude growing TOP - DOWN and Longitude growing RIGHT To LEFT.
-
Jan 30th, 2007, 12:25 PM
#3
Re: Show each pixel in the picture represent a latitude and longitude using VB6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|