public RasterImage Image { get; }
The Leadtools.RasterImage filled with the load image if LoadFileImage is true.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.WinForms.CommonDialogs.File;
public void RasterOpenDialogExample2()
{
RasterCodecs rasterCodecs = new RasterCodecs();
RasterOpenDialog openDlg = new RasterOpenDialog(rasterCodecs);
openDlg.LoadFileImage = true;
openDlg.GenerateThumbnail = true;
// customize dialog OK button string
RasterDialogStrings dialogString = RasterOpenDialog.GetDialogString(RasterDialogStringsId.OpenOk);
string oldString = dialogString.Text;
dialogString.Text = "Do it!";
Console.WriteLine($"String ID of OK button is: {dialogString.DialogStringId}");
RasterOpenDialog.SetDialogString(dialogString);
bool restoreOriginalText = false;
if (restoreOriginalText)
{
dialogString.Text = oldString;
RasterOpenDialog.SetDialogString(dialogString);
}
if (DialogResult.OK == openDlg.ShowDialog(null))
{
RasterDialogFileData fileDataItem = openDlg.OpenedFileData[0];
RasterImage loadedImage = fileDataItem.Image;
RasterImage generatedThumbnail = fileDataItem.Thumbnail;
// Do something with the 'loadedImage' and 'generatedThumbnail' images.
// ...
loadedImage.Dispose();
generatedThumbnail.Dispose();
}
}