Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Raghavendra Mudugal  
#1 Posted : Tuesday, April 5, 2005 4:33:00 PM(UTC)
Raghavendra Mudugal

Rank: Member

Groups: Member
Joined: 3/27/2005(UTC)
Posts: 16

Hello, :)

I have loaded the image to the aurigma component of the resolution 1024x768 and i get the

scroll bars on control to move image up/down and side by side. And I am showing the

X and Y value in the status bar in mouse_move event of the aurigma control. As i scroll the

image to the bottem-right i need to get x= 1024 and y=768. I dont no wats the problem.

Even I tried using the "BitmapToControlCoords" Method and "ControlToBitmapCoords"

Method, but i see it still in the not working state. :(

Please anyone out there to help me on this, Hope to receive your response at your earliest.

Many Thanks

With Regards,

Raghavendra Mudugal

With Regards,

Raghavendra Mudugal

Andrew  
#2 Posted : Wednesday, April 6, 2005 8:05:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Hello Raghavendra,

Could you tell more detailed what is a problem (something is displayed incorrectly or a error message arises)? Please post a code snippet you are trying to get working.

Raghavendra Mudugal  
#3 Posted : Wednesday, April 6, 2005 8:30:00 PM(UTC)
Raghavendra Mudugal

Rank: Member

Groups: Member
Joined: 3/27/2005(UTC)
Posts: 16

Here is the code where the problem i have. It did'nt gave me any error here.

For example :-

If I load then image of height :324 and width :524, and If I take the mouse pointer

to the bottom-right of the image (end point of the image) I need to get the X=524 and

Y = 202. where actually Y should be 324.

Code:
Private Sub BitmapViewer1_MouseMove(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
    'a = x
    'b = y
    a = Me.BitmapViewer1.ControlToBitmapXCoord(x)
    b = Me.BitmapViewer1.ControlToBitmapXCoord(y)
    'a = Me.BitmapViewer1.BitmapToControlXCoord(x)
    'b = Me.BitmapViewer1.BitmapToControlXCoord(y)
    Label1.Caption = "X :" & a & " " & " Y: " & b
End Sub

This is extra stuff which i gave a try:

So if i try to draw a polygon considering that i clicked on the 324th pixel point, infact it

considers 202 as the point and the polygon is the not the shape what i deserved.

But my real problem is it failed to get the X and Y of the image. Hope your are understanding

what I am trying to say.

I am online now, please post the reply as soon.

Edited by user Monday, December 24, 2007 3:58:27 PM(UTC)  | Reason: Not specified

With Regards,

Raghavendra Mudugal

Andrew  
#4 Posted : Friday, April 8, 2005 1:17:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Hello Raghavendra,

MouseMove event returns coordinates of the visible area only. It does not take into account scroll bar position. If you need to get image coordinates, you should use ImageMouseMove event instead:

Code:
Private Sub BitmapViewer1_ImageMouseMove(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
    Label1.Caption = "X :" & x & " Y: " & y
End Sub

Edited by user Monday, December 24, 2007 3:59:10 PM(UTC)  | Reason: Not specified

Raghavendra Mudugal  
#5 Posted : Sunday, April 10, 2005 2:25:00 PM(UTC)
Raghavendra Mudugal

Rank: Member

Groups: Member
Joined: 3/27/2005(UTC)
Posts: 16

Hello Andrew

Problem solved, Actually I am using the same old code what I have posted in my previous

reply. I just un-installed and re-installed the component, it started working.

Even I gave a try of event that you specified. but for the image width 1024, X was showing

1095, and for image height 768, Y was showing 955. I dont no how this component is

calculating the co-ordinates.

Anyway, its working for the previous code. Thanks for the help. :)

With Regards,

Raghavendra Mudugal

Andrew  
#6 Posted : Sunday, April 10, 2005 3:42:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
> Even I gave a try of event that you specified. but for the image width 1024, X was showing

1095, and for image height 768, Y was showing 955. I dont no how this component is

calculating the co-ordinates.

There are two kinds of coordinates - coordinates of the image (which are calculated relatively the top left corner of the bitmap) and coordinates of the control (which are calculated relatively the top left corner of the parent form). I think that your control is shifted relatively the form coordinates, that's why when you use the control coordinates, this offset is added to x and y coordinates.

Raghavendra Mudugal  
#7 Posted : Sunday, April 10, 2005 5:47:00 PM(UTC)
Raghavendra Mudugal

Rank: Member

Groups: Member
Joined: 3/27/2005(UTC)
Posts: 16

But I have the Control to the fixed position. Its position is not changed.

For Example:- If I have the control placed with the width = 800 and height = 600, and If

I load a Image of width = 400 and Height = 200, The X and Y are displayed correctly.

But If the Image Size exceeds the Control size then the real problem starts.

There I have to pass the X value of the control (mouse_move event of the control) to

ControlCoordsToBitmapX get the exact X position of the Image where ths mouse pointer is,

so same for Y.

If I use the Mouse_move event of the Image then how come its showing the more X and Y

value even the Image is not that of size. Control never moves, only I have to scroll the

image down. In this case If i use the mouse_move event of the control and pass X to

ControlCoordsToBitmapX, I get the correct result.

Anyway its lot of confussion now.

Thanks for the help.

With Regards,

Raghavendra Mudugal

Andrew  
#8 Posted : Sunday, April 10, 2005 9:41:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
If you need to get x and y in coordinates of the bitmap, use ImageMouseMove event instead of MouseMove. See the polygon selection code sample I posted in the neighbour topic.
Raghavendra Mudugal  
#9 Posted : Tuesday, April 12, 2005 1:44:00 PM(UTC)
Raghavendra Mudugal

Rank: Member

Groups: Member
Joined: 3/27/2005(UTC)
Posts: 16

Ok, I will change the code set to this event and let you know how am I doing.

Thanks for the help :)

With Regards,

Raghavendra Mudugal

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.