LPtoDP(...) and CreatePolygonRgn(...)



  • 1. How to trap every left mouse button down as WM_LBUTTONDOWN (want to ignore double click)
    How can I trap each left mouse button down event as a WM_LBUTTONDOWN? If I press the mouse button twice within the double click time, I miss the 2nd LBUTTONDOWN and get a LBUTONDBLCLK. Is there a property to set or is the technique simply to have the same code in the doubleclick event Thank you.
  • 2. Prevent Partial Item in CListCtrl ?
    Hi guys, Can I prevent the display of partial items in a CListCtrl ? I made a custom CreateDragImage() that copies what's displayed and when an item is partially displayed the drag image has the border and non-client area in it. Any ideas ? Thanks.
  • 3. How do I print my CRichEditDoc/View MDI app?
    I've created a fairly standard CRichEditDoc/View MDI application. I included Printing and Print Preview in the options during the AppWizard. What do I need to do to get a basic output when printing? E.g. setting the number of pages, etc. I'm using RichEdit 2.0 and also have set m_bRTF to FALSE in the CRichEditDoc derived class. I've struggled to find an example on the web that uses CRichEditView and I believe it should do most of the work for me but at the moment, besides the print preview kind of working, and getting the Print Dialog, it just prints blank pages!
  • 4. Calling exe from MFC application and storing out in buffer for further processing.
    Dear All, I m developing a application in which i need to call a exe whose results/output, i wanna store in buffer for further processing. Please give me the solution fo doing that. Thanx in advance. regards, dinesh
  • 5. Can I get my Dialog's background color already? :) Just can't figure it out
    I'm trying to get the background color for the basic Dialog created using the Wizard GetSysColor(COLOR_WINDOW) isn't working (returns some other color) GetBkColor() for the DC isn't working (returns white) Where can I trap that? The dc->GetBkColor in OnPaint returns a white color I finally did GetSysColor(COLOR_3DFACE) because I noticed they are the same, but that's not really what I want Thank you.

LPtoDP(...) and CreatePolygonRgn(...)

Postby Simon » Sun, 03 Jul 2005 23:16:33 GMT


I have a problem with an image I am trying to draw on the screen.

I use CreatePolygonRgn(...) to draw an image on the screen.

I calculate my polygon and use CDC::Polygon(...) to make sure that it looks
ok, (and it does:))

To use CreatePolygonRgn(...) I have to call LPtoDP(...), but for some reason
some points get converted to -1, -1.
At first I thought it was because they were outside the screen, but after a
quick check none of them are outside.

So, how can I draw a bitmap inside a poly-region?
Can I use CreatePolygonRgn(...) without having to first call LPtoDP(...)?

Many thanks


Similar Threads:

1.in OnDrawAdvanced, if (!bMetafile) LPtoDP

there is part of code about normalizing DC i don't understand:

inline HRESULT CComControlBase::OnDrawAdvanced(ATL_DRAWINFO& di)
BOOL bMetafile = GetDeviceCaps(di.hdcDraw, TECHNOLOGY) == DT_METAFILE;//case 46
if (!bMetafile)
::LPtoDP(di.hdcDraw, (LPPOINT)&rectBoundsDP, 2);

what does it mean?
isn't the di.prcBounds passed in already in Device unit?
and why it's no need to normalize DC if bMetafile is TRUE?


Return to VC


Who is online

Users browsing this forum: No registered users and 54 guest