08-21-2012 09:51 AM
Hello
we are using CVI 2010 and NI Vision and we need a function to convert an image to a bitmap. We do not want to write it to the hard disc, we need the bitmap direct in the program.
I didn't find a function for the conversion, does any one know how we can do this?
thanks
greetings
Oliver
08-22-2012 04:32 AM
Hello Oliver,
Since the term "bitmap" covers binary images as well as a image file format. So it would be helpfull to know what you are planning to do with your Bitmap and what you mean by bitmap.
CVI offers a function to convert the Imaq data to a 2D array of Data:
imaqImageToArray
Creates a two-dimensional array from an image.
Image Types Supported
IMAQ_IMAGE_U8, IMAQ_IMAGE_U16, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_COMPLEX, IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL, IMAQ_IMAGE_RGB_U64
/*-------------------- Prototype ---------------------*/
void *imaqImageToArray (const Image *Image, Rect Rect,
int *Columns, int *Rows);
CVI only supports 8bit grayscale or 24/32bit color images
This function could be a good starting Point for your implementation.
Cheers!
Moritz M.
08-22-2012 04:43 AM
Hello Moritz,
I need a bitmap for two things:
1) I want to save the picture to the hard disc. For this I know there is a function which saves the picture to the HD and converts it to bmp, jpg etc.
2) I want to display it in CVI, e.g. on a graph or a picture control. For this I do not know how to go on.
we get the image from the NI Vision functions but how can we convert them to use them in a picture control? We are integrating a new function palett in an existing software and we do not want to change the complete software. So we need a solution how to display the images for e.g. in a image control
Do we have to convert the image first in an 2 dim array and after create the picture with NewBitmap?
greetings
Oliver
08-22-2012 06:54 AM
Hello Oliver,
to just display the picture, NI Vision offers a set of functions. To make live easier NI Vision ships with examples:
Low-Level Snap.cws uses the Function: imaqDisplayImage () to display the image in a seperate Window.
snapImgPlot.cws uses imgPlot to display the Image in a Canvas Control.
I have no Camera available so i could ne test those examples. Guess it wont be neccessary to extract a bitmap from the IMAQ buffer.
If you are new to CVI, you can launch the Example Finder with Help>Find Examples. I simply searched for Image to find those examples.
Regards!
Moritz M.
08-22-2012 07:06 AM
Hi Moritz,
my problems is that the NI Vision section is only a small part from the complete software. In the rest of the software we are using bitmaps to display images. Because I do not want to change the complete software I am searching this special solution to be compatible outside the NI Vision section
greetings
Oliver
08-16-2013 04:31 AM
As you see, there are many free image conversion tools online. But I don't suggest you to use them to do with your conversion work. Because I always believe that the free tools online do not have so many professional functions as the paid ones. And it is said that some of them might contain some virus. Check some free trials of the paid professional conversion tools to convert image file to bitmap first before you make your final decision if possible. I also suggest you choose one whose way of processing is simple and fast. It can save a lot of time for you. Remember to do your conversion work according to its tutorial page about how to convert document image using C#.NET. I hope you success. Good luck.
Best regards,
Arron
10-29-2013 02:13 AM
@arronlee wrote:
As you see, there are many free image conversion tools online. But I don't suggest you to use them to do with your conversion work. Because I always believe that the free tools online do not have so many professional functions as the paid ones. And it is said that some of them might contain some virus. Check some free trials of the paid professional conversion tools to convert image file to bitmap first before you make your final decision if possible. I also suggest you choose one whose way of processing is simple and fast. It can save a lot of time for you. Remember to do your conversion work according to its tutorial page about how to convert document image using .NET. I hope you success. Good luck.
Best regards,
Arron
Does all available image converting APIs will decode source image into an image object then re-encode that image object to bitmap to achieve image to bmp conversion? I just wonder will it cause quality loss in this decoding and re-decoding process?