LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI Runs Out of Memory When using GetCtrlBitmap

Why CVI Runs Out of Memory When using GetCtrlBitmap of a canvas control?, I plot some data into a canvas that is 768w x 30,000h. If the canvas is so long and I can plot data, why the error. My system memory is 768 MB of ram.
 
Any suggestion please will be welcome...
0 Kudos
Message 1 of 3
(3,229 Views)

While it may be obvious, I need to ask: are you discarding the bitmap with DiscardBitmap() once you are done with it?

Assuming 32 bit color depth 768x30000x4bytes/pixel = 92 MB for each bitmap you grab!

--Ian

0 Kudos
Message 2 of 3
(3,210 Views)

thank to suggest

next...

assuming I have some data plotted in the canvas of 768w x 30000h, I need to save the bitmap to a file, next is the section of code I implemented to do that....

 if(GetCtrlBitmap (handleGraficasHijo, GRAFICAS_H_CANVAS, 1, &idImage)>=0)
   {
    SaveBitmapToJPEGFile (idImage, "e:\\DiscoE\\ProgramasCVI\\AnomaliasLineaAcero2\\Registro.jpg", 0,  80);
    DiscardBitmap (idImage);
   }
   else
    MessagePopup ("", "Error de memoria");

when CVI runs the code above, always send a message of NON FATAL ERROR,  out of memory (code -12)

If before I change the dimension of canvas to 768w x 10000h, all is ok.

any other advice...

0 Kudos
Message 3 of 3
(3,202 Views)