Casting Vintasoft Image to Image

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Moderator: Alex

Post Reply
BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Casting Vintasoft Image to Image

Post by BillG » Tue Aug 19, 2014 5:27 pm

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

Alex
Site Admin
Posts: 1464
Joined: Thu Jul 10, 2008 2:21 pm

Re: Casting Vintasoft Image to Image

Post by Alex » Tue Aug 19, 2014 7:24 pm

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

BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Re: Casting Vintasoft Image to Image

Post by BillG » Tue Aug 19, 2014 8:59 pm

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

Alex
Site Admin
Posts: 1464
Joined: Thu Jul 10, 2008 2:21 pm

Re: Casting Vintasoft Image to Image

Post by Alex » Wed Aug 20, 2014 8:28 am

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?
Yes, I think this is good way because Vintasoft.Imaging.UI.ImageViewer control has better functionality than System.Windows.Forms.PictureBox control.

How do i cast a regular image to a vintasoft image to put in the image viewer?
You can create VintasoftImage object which contains the Bitmap object using the following code:

Code: Select all

VintasoftImage image = new VintasoftImage(bitmap, true);
Boolean parameter in constructor of VintasoftImage class determines that Bitmap must be disposed when the VintasoftImage is disposed. You can set boolean parameter to False if Bitmap should not be destroyed when VintasoftImage will be destroyed.

Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests