private void InitDemo() { Messager.Caption = "C# Image Viewer Demo"; Text = Messager.Caption; _imageInfoLabel.Text = String.Empty; _imageInfoLabel.Text = String.Empty; // Load the last options used _demoOptions = new DemoOptions(); // Initialize the LEADTOOLS object used to load image files _rasterCodecs = new RasterCodecs(); // Load documents at 300 DPI for better viewing _rasterCodecs.Options.RasterizeDocument.Load.Resolution = 300; // Initialize the LEADTOOLS control used to view images InitImageViewer(); // Load the default image #if LT_CLICKONCE var defaultFileName = Path.Combine(Application.StartupPath, @"Documents\Leadtools.pdf"); #else var defaultFileName = Path.Combine(DemosGlobal.ImagesFolder, @"Leadtools.pdf"); #endif // #if LT_CLICKONCE if (!string.IsNullOrEmpty(defaultFileName) && File.Exists(defaultFileName)) { LoadImage(defaultFileName); } }
public DemoOptions Clone() { var result = new DemoOptions(); result.UseVirtiualizer = this.UseVirtiualizer; result.UseSVG = this.UseSVG; return(result); }
private void _openToolStripMenuItem_Click(object sender, EventArgs e) { using (var dlg = new LoadFileDialog()) { // Clone the options, if Cancel, we do not want them changed dlg.ImageFileName = _imageFileName; dlg.DemoOptions = _demoOptions.Clone(); if (dlg.ShowDialog(this) == DialogResult.OK) { // Copy the options (exluding the current file name) _demoOptions = dlg.DemoOptions.Clone(); // Load the image LoadImage(dlg.ImageFileName); } } }