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

Notification

Icon
Error

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

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?
Andrew  
#2 Posted : Tuesday, July 27, 2004 9:40:00 PM(UTC)
Andrew

Rank: Advanced Member

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

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

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.