Page 1 of 1

loading an image from a file

Posted: Sat Sep 27, 2014 6:54 pm
by BillG
I display an openfiledialog and the user selects the file they want to upload to the Vintasoft image viewer. I had it working with a regular image now I am converting the app to us the VintasoftImage and viewer.

Code: Select all

OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = GetImageFilter();
if (dialog.ShowDialog() == DialogResult.OK)
{
    image = VintasoftImage.FromFile(dialog.FileName, true);  // this is the problem line. how do I get the image from the file to an vintasoft image so I can display it in the viewer?
    DisplayPhoto(image);
}

public void DisplayPhoto(VintasoftImage image)
{
    ImageViewer.Image = image;
    ImageViewer.SizeMode = ImageSizeMode.BestFit;       
}

Re: loading an image from a file

Posted: Sun Sep 28, 2014 3:15 am
by BillG
figured it out.