06-07-2007 10:10 AM
06-22-2007 04:07 AM
06-22-2007 06:10 AM
08-26-2011 10:56 PM - edited 08-26-2011 11:00 PM
If the image type is JPG, what should i do to display the image data array by canvas??
Thank you for the attention.
zhl929
08-28-2011 05:06 AM
CVI doesn't (as far as I know) have functions to convert bitmap formats in memory. A bit odd, since it can read and write files in various formats.
You'll need to use a JPG decompressor such as the Independent JPEG group's library, then you can use NewBitmap() or NewBitmapEx() to convert the decompressed data to a CVI bitmap.
08-29-2011 02:22 PM
You can use GetBitmapFromFile or GetBitmapFromFileEx to read a JPEG file into an in-memory bitmap. Once the bitmap is in memory, you can display it on the canvas. By the way, once a bitmap is in memory, it no longer has a distinctive format (BMP, TIFF, PNG, JPEG, etc...). It no longer matters how it was loaded or created in the first place.
If you then need to save it back to a file, then you need to pick the function that matches the file format that you want to save it as (e.g. SaveBitmapToJPEGFile)
Luis