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 : Wednesday, June 9, 2010 6:20:54 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


Here's a C++ code snippet of how to convert a point in client coordinates to bitmap coordinates with the 16.5 C++ Class Library interface's LBitmapWindow class.  LMyBitmapWindow is an inherited class of LBitmapWindow.


POINT LMyBitmapWindow::ClientToBitmap(POINT ptClient)
{
    POINT ptBitmap;
    CRect Dst;
    GetRects(NULL, NULL, &Dst, NULL);

    ptBitmap.x = (ptClient.x - Dst.left) * GetWidth() / Dst.Width();
    ptBitmap.y = (ptClient.y - Dst.top) * GetHeight() / Dst.Height();

    return ptBitmap;
}

 

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.

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.045 seconds.