by Bhuwan Chand Joshi (69 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 3rd August 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
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
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.
No comments have been posted about You can get easily the X and Y coordinates of any portion of the Image with Width and Height using . Why not be the first to post a comment about You can get easily the X and Y coordinates of any portion of the Image with Width and Height using .