Basically, yes.
Here�s how it�s done. I got the idea from this website by searching on CScaleBmpPlotAreaGraph. I think that will get you there.
1. Create a �compatible� CBitmap object, in this case, mp_masterBitmap,
CClientDC dcScreen (&mGraph); // mGraph is the CNiGraph
mp_masterBitmap = new CBitmap;
mp_masterBitmap->CreateCompatibleBitmap (&dcScreen, 6400, 480);
and use it to fill the data by using CBitmap::SetBitmapBits(�). Elsewhere in my code I filled the bitmap with 6400x480 points.
2. In your Draw() method, create a CDC and select a the CBitmap object into it.
3. Create a DC to use to write to the control's bitmap.
4. Select the control's bitmap into that DC.
5. Then
BitBlt it to the graph control�s bitmap DC from the masterDC (memory DC).
6. Super fast!!
7. Also note that I did not mess with palettes so there�s a bit of a kludge on the data. For every byte of data the next three bytes have to be the same, that is for 32-bit color. So for a gray scale value of say, 128, middle gray, the array would have to be:
data[0] = 128;
data[1] = 128;
data[2] = 128;
data[3] = 128;
data[4] would be the next pixel value in the bitmap. That�s the only messy part. But that is a ton less problem than trying to deal with palettes.
Here�s some draw code that I use when it�s time to draw:
// Create a DC to use to read the master bitmap.
CDC masterDC;
masterDC.CreateCompatibleDC(NULL)
masterDC.SelectObject(mp_masterBitmap)
// Create a DC to use to write to the control's bitmap.
CDC ctrlBitmapDC;
ctrlBitmapDC.CreateCompatibleDC(NULL)
// Select the control's bitmap into the DC.
HBITMAP controlHBitma
p = (HBITMAP)mGraph.Images(3).Picture.Handle;
ctrlBitmapDC.SelectObject(CBitmap::FromHandle(controlHBitmap))
ctrlBitmapDC.BitBlt(0, 0, 6400, 480, &masterDC, 0,0, SRCCOPY);
There you have it. Hope that will get you going.
Scott O'Friel