loading an image from a file
Posted: Sat Sep 27, 2014 6:54 pm
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;
}