Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

background bitmap of cnigraph

I tried to control the background bitmap dynamically using codes (in c++ dot net) as below

CPictureHolder m_phFullCircle, m_phHalfCircle;
m_phHalfCircle.CreateFromBitmap(IDB_HCIRCLE);
m_gr2DGraph.Images(COleVariant(3.0)).SetPicture(m_phHalfCircle.GetPictureDispatch());

Unfortunately I encounter error message

error C2664: 'NI::CNiImage::SetPicture' : Cannot convert LPPICTUREDISP' to'const NI::CNiPicture &'

How can I solve this problem?
Any comments would be very helpful to me.

Thanks,
0 Kudos
Message 1 of 2
(3,338 Views)
I looked in the CNiPicture header and the looks like the constructor you need 2 parameters. Try the following

CPictureHolder half;
half.CreateFromBitmap(IDB_BITMAP1);
CNiPicture myPicture(half.GetPictureDispatch(),false);
m_graph.Images(3).SetPicture(myPicture);

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 2
(3,338 Views)