Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, April 7, 2006 5:33:16 AM(UTC)

cjsk8  
cjsk8

Groups: Registered
Posts: 4


How can I get the correct pixel color in an zoomed image? For example an 110% zoom percent image in my LBitmapWindow.

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, April 11, 2006 4:39:32 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

Using the LEADTOOLS C++ Classlib, to convert from mouse coordinates to
bitmap coordinates, use the following code (for example in the LButtonUp handler):
OnLButtonUp(UINT nFlags, CPoint point)
{
   POINT    pt, bitmapPoint;
   RECT rcDst;

   pt = point;

   m_LBitmapWnd.GetRects(NULL, NULL, &rcDst, NULL);

   bitmapPoint.x = (pt.x - rcDst.left);
   bitmapPoint.y = (pt.y - rcDst.top);

   bitmapPoint.x = (long)(bitmapPoint.x * 100 / m_LBitmapWnd.GetZoomPercent());
   bitmapPoint.y = (long)(bitmapPoint.y * 100 / m_LBitmapWnd.GetZoomPercent());
}

Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.036 seconds.