protected override void OnLoad(EventArgs e) { if (!DesignMode) { using (Graphics g = CreateGraphics()) { Tools.Units.ScreenResolution = (int)g.DpiX; } // Setup the caption for this demo Messager.Caption = "C# Rasterize Document Demo"; Text = Messager.Caption; _rasterCodecsInstance = new RasterCodecs(); // Setup and initialize the option controls foreach (TabPage tp in _optionsTabControl.TabPages) { UserControls.IOptionsUserControl optionsUserControl = tp.Controls[0] as UserControls.IOptionsUserControl; optionsUserControl.SetData(_rasterCodecsInstance); } _documentInfoControl.SetData(_imageInfo, _rasterCodecsInstance); } base.OnLoad(e); }
private bool CollectAllOptions() { // Collects all the options from the controls, return true/false if we can continue bool ret = true; foreach (TabPage tp in _optionsTabControl.TabPages) { UserControls.IOptionsUserControl optionsUserControl = tp.Controls[0] as UserControls.IOptionsUserControl; ret = optionsUserControl.GetData(_rasterCodecsInstance); if (!ret) { _optionsTabControl.SelectedTab = tp; break; } } if (ret) { ret = _documentPathControl.GetData(_rasterCodecsInstance); } return(ret); }