I have an app i am creating that allows the user to upload a picture to my application or take a picture using a webcam. I have a picturebox on a form where i place the image that was uploaded. Now i have the code written to capture the image using the webcam. The image is a VintasoftImage. Now i want to place the image in the same picturebox. Can i place a VintasoftImage in a windows picturebox or do i have to cast it first to an image. Then i am saving the image to a sql server database table.
Bill
Casting Vintasoft Image to Image
Moderator: Alex
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Casting Vintasoft Image to Image
Hi Bill,
System.Windows.Forms.PictureBox control can display only System.Drawing.Image (System.Drawing.Bitmap) object. You can convert VintasoftImage object to a System.Drawing.Bitmap object using the VintasoftImage.GetAsBitmap() method.
VintaSoftImaging.NET SDK also have control for displaying images - Vintasoft.Imaging.UI.ImageViewer class.
Please read more info in on-line documentation of SDK: http://www.vintasoft.com/docs/vsimaging-dotnet/
Best regards, Alexander
System.Windows.Forms.PictureBox control can display only System.Drawing.Image (System.Drawing.Bitmap) object. You can convert VintasoftImage object to a System.Drawing.Bitmap object using the VintasoftImage.GetAsBitmap() method.
VintaSoftImaging.NET SDK also have control for displaying images - Vintasoft.Imaging.UI.ImageViewer class.
Please read more info in on-line documentation of SDK: http://www.vintasoft.com/docs/vsimaging-dotnet/
Best regards, Alexander
-
- Posts: 47
- Joined: Fri Oct 10, 2008 3:52 pm
Re: Casting Vintasoft Image to Image
so you are saying replace the picture box with the image viewer and show both types in the image viewer the image i upload and the image captured from the webcam? How do i cast a regular image to a vintasoft image to put in the image viewer?
Bill
Bill
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Casting Vintasoft Image to Image
Yes, I think this is good way because Vintasoft.Imaging.UI.ImageViewer control has better functionality than System.Windows.Forms.PictureBox control.so you are saying replace the picture box with the image viewer and show both types in the image viewer the image i upload and the image captured from the webcam?
You can create VintasoftImage object which contains the Bitmap object using the following code:How do i cast a regular image to a vintasoft image to put in the image viewer?
Code: Select all
VintasoftImage image = Vintasoft.Imaging.VintasoftImageGdiExtensions.Create(bitmap, true);
Best regards, Alexander