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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

activex - save graphics to file

Status
Not open for further replies.

esdee

Programmer
Apr 12, 2001
143
US
hi - i have an mfc activex control and want to save its visuals to a file. how should i do this? the graphics on the control are created through GDI+, so should i go through Graphics contents to an Image, or may be through CDC? thanx

so far i have this:

CDC* pdc = GetDC();

RECT rect;
GetClientRect(&rect);

Graphics graphics(pdc->GetSafeHdc());
Bitmap bitmap(rect.right -
rect.left, rect.bottom -
rect.top, &graphics);

CLSID pngClsid;
GetEncoderClsid(L"image/jpeg", &pngClsid);


bitmap.Save(fineName, &pngClsid, NULL);

but it just outputs a black screen, which is understandable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top