c++ - Problems with ID2D1bitmap -
i'm trying save id2d1bitmap file according how save id2d1bitmap png file
can done in windows 7? without platform update?
i unhandled exception. (aceess violation reading) @ :
if (succeeded(hr)) { hr = m_pwicfactory->createbitmap( sc_bitmapwidth, sc_bitmapheight, guid_wicpixelformat32bpppbgra, wicbitmapcacheonload, &pwicbitmap ); }
i've declared m_pwicfactory & m_pdirect2dfactory as:
id2d1factory* m_pdirect2dfactory; iwicimagingfactory *m_pwicfactory;
can 1 explain me problem?
i'm pretty sure you've null m_pwicfactory
(because post you've linked doesn't contain code). did initialize first before usage? done member function , called before other operations require factory performed.
hresult createdeviceindependentresources() { hresult hr; // create direct2d factory. hr = d2d1createfactory(d2d1_factory_type_single_threaded, &m_pdirect2dfactory); if (succeeded(hr)) { // create wic factory. cocreateinstance( clsid_wicimagingfactory, null, clsctx_inproc_server, iid_iwicimagingfactory, reinterpret_cast<void **>(&m_pwicfactory) ); } return hr; }
refer using windows imaging component in msdn more information.
Comments
Post a Comment