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



Go to last post Go to first unread
#1 Posted : Monday, July 26, 2004 5:43:00 AM(UTC)

Rank: Member

Groups: Member
Joined: 5/27/2004(UTC)
Posts: 7

It seems that regardless of the type of unit that I specify in the BitmapViewer.Bitmap.Unit parameter the mouse move event always returns pixels. What is the correct way to get the mouse move event to reurn the location in the units specified byt the bitmap.unit parameter?
#2 Posted : Tuesday, July 27, 2004 9:40:00 PM(UTC)

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)

MouseMove event returns position on the cursor in the control coordinate (not the bitmap coordinates). That's why it would not be reasonable to make it working in the bitmap units.

However if you need to convert between pixels and units, you can:

  1. Create Graphics object.

  2. Set Unit and HorizontalResolution/VerticalResolution to the same values as your bitmap have.

  3. Use HorizontalPixelToUnit and VerticalPixelToUnit methods to convert values.

Hope this helps.

Users browsing this topic
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.