- Home
·
- Graphics
·
- You can get easily the X and Y coordinates of any portion of the Image with Width and Height using
You can get easily the X and Y coordinates of any portion of the Image with Width and Height using
You can get easily the X and Y coordinates of any portion of the Image with Width and Height using Visual Basic 6.0.
API Declarations
Dim intLeft as Long
Dim intTop as Long
Dim intWidth as Long
Dim intHeight as Long
Dim intScrollLeft as Long
Dim intScrollTop as Long
Rate You can get easily the X and Y coordinates of any portion of the Image with Width and Height using
(2(2 Vote))
Private Sub Form_Load()
On error goto Err_Handler
ImgEdit1.Image="Path of BMP File"
ImgEdit1.Display
Err_Handler:
Msgbox Err.Description
End Sub
Private Sub ImgEdit1_SelectionRectDrawn(ByVal Left as Long,ByVal Top as Long,ByVal Width as Long,ByVal Height as Long)
On error Goto Err_Handler
intLeft=Left
intTop=Top
intWidth=Width
intHeight=Height
intScrollLeft=Str(ImgEdit1.ScrollPositionX)
intScrollTop=Str(ImgEdit1.ScrollPositionY)
Debug.Print "X" & "=" & (intLeft + intScrollLeft)
Debug.Print "Y" & "=" & (intTop + intScrollTop)
Debug.Print "Width" & "=" & intWidth
Debug.Print "Height" & "=" & intHeight
Err_Handler:
Msgbox Err.Description
End Sub
'Run the program and Drag over the image loaded into the Wang Image Control
'and Look at the immediate window you get X,Y,Width and Height of the portion
'you draged over the image.
You can get easily the X and Y coordinates of any portion of the Image with Width and Height using Comments
No comments yet — be the first to post one!
Post a Comment