Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert OLE_HANDLE of a bitmap to HBITMAP-handle???

Status
Not open for further replies.

Olli1973

Technical User
Nov 3, 2002
2
DE
Hi!

I´d like to create a pattern-brush from a bitmap in a CPictureHolder-object. I´ve tried it this way:

IPicture* iPicture=m_Picture.m_pPict;
HBRUSH PatternBrush=NULL;
OLE_HANDLE hPic;
iPicture->get_Handle(&hPic);
PatternBrush=CreatePatternBrush((HBITMAP)hPic);

m_Picture is the CPictureHolder-object.

get_Handle returns a OLE_HANDLE, but the CreatePatternBrush-function needs a HBRUSH-handle. The way i tried to convert from OLE_HANDLE to HBITMAP doesn´t seem to work, no HBRUSH-handle is returned in PatternBrush.
Who can help?

Thanks!
Olli.
 
Take a look at the DRAWPIC Visual C++ Sample application. That should help at least some.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top