LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving panel to file (jpeg format)

Hi guys,
 
I was wondering if there is a way i can save panel to a file but in jpeg format....Currently i use the following to save it bt the file size is huge....
 
GetPanelDisplayBitmap (video_handle, VAL_VISIBLE_AREA,VAL_ENTIRE_OBJECT, &videobitmaphandle);
 ClipboardPutBitmap (videobitmaphandle);     //copies panel bitmap on clipboard
 SaveBitmapToFile (fname2, videobitmaphandle);   //saves bitmap to file
  DiscardBitmap(videobitmaphandle);
 
Looking forward for a reply.
 
Thanks
 
k1_ke
0 Kudos
Message 1 of 7
(4,632 Views)

Which version of CVI are you using? Starting from version 7 (or 7.1, I don't remember) the function you are using was splitted into SaveBitmapToBMPFile and SaveBitmapToJPEGFile.

It seems that you are using an older version: you can still save in jpg format using third party drivers: I am using G.Dargaud functions to save/read in PNG and JPG format.

BTW, you don't need to use ClipboardPutBitmap before saving it unless you need a copy of the image to paste in a separate application.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 7
(4,632 Views)

Hi Roberto,

Thanks for the reply. Yeah i am using 7.0......I will try the other method....m sure it will work out.

Thanks

k1_ke

0 Kudos
Message 3 of 7
(4,619 Views)
Hi, Roberto,
How can I realize this when using CVI IDE 5.0, since there is not method "SaveBitmapToBMPFile" or "SaveBitmapToJPEGFile", as in the higher version?
Thanks very much!
0 Kudos
Message 4 of 7
(4,495 Views)
I have used several time the instruments supplied by Guillaume Dargaud in his website, linked in my previous post in this same thread: have you tried adding readSavePNG or ReadSaveJPEG instruments to your project? You may have problems in using the .fp directly (it seems to me that they can be used starting from version 5.5), but you should be able to call directly commands in the lib files with the supplied includes.
 
Give a try and let me know if there are problems.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 7
(4,496 Views)
Hi Roberto,
Thanks very much!
I tried as you suggested, it did work.
As you said, the .fp could not been used directly since the version is 5.0, however, it did work  when directly call the commands in the lib files!
Thanks again!Best ragards!
    LIXiaogai
0 Kudos
Message 6 of 7
(4,464 Views)
Hi Roberto,
I met another problem.
I use the "graphcursors.fp" file from CVI7.0 (attached), in CVI 5.0, some of the functions could be used, such as GCC_SetCursorName (hgcc, 1, "First Cursor");  
however, some could not be used, such as GCC_New (panelre, PanelRe_Graph_tp, 0, GCC_VAL_POS_BELOW_RIGHT, 2); Link errors happend, "Undefined symbol '_GCC_New' referenced in "Main.c".
So, any suggestions if Iwant to use the funciton "GCC_New' ",
Thanks very much!
                  LIXiaogai
0 Kudos
Message 7 of 7
(4,430 Views)