LEADTOOLS Support
Imaging
Imaging SDK Questions
Re: Using PickColor LRasterPaint or GetPixelColor in Zoomed LBitmap
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Friday, April 7, 2006 5:33:16 AM(UTC)
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.
#2
Posted
:
Tuesday, April 11, 2006 4:39:32 AM(UTC)
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 LEAD Logo](https://www.leadtools.com/images/new-site-images/leadtools-logo-header.png)
LEADTOOLS Support
Imaging
Imaging SDK Questions
Re: Using PickColor LRasterPaint or GetPixelColor in Zoomed LBitmap
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.