public ImageDisplayForm() { InitializeComponent(); SySal.ImageProcessorDisplay.Configuration c = (Configuration)SySal.Management.MachineSettings.GetSettings(typeof(Configuration)); if (c == null) { c = new Configuration(); c.PanelWidth = 640; c.PanelHeight = 480; c.PanelTop = 0; c.PanelLeft = 0; } StartPosition = FormStartPosition.Manual; Left = c.PanelLeft; Top = c.PanelTop; Width = c.PanelWidth; Height = c.PanelHeight; SySal.Imaging.ImageInfo info = new SySal.Imaging.ImageInfo(); info.BitsPerPixel = 8; info.PixelFormat = SySal.Imaging.PixelFormatType.GrayScale8; info.Width = (ushort)(Width - pnRight.MinimumSize.Width); info.Height = (ushort)(Height - pnBottom.MinimumSize.Height); pnRight.Width = pnRight.MinimumSize.Width; pnBottom.Height = pnBottom.MinimumSize.Height; HostedFormat = info; System.Drawing.Bitmap z = new Bitmap(8, 8, System.Drawing.Imaging.PixelFormat.Format8bppIndexed); GrayScalePalette = z.Palette; int i; for (i = 0; i < GrayScalePalette.Entries.Length; i++) { GrayScalePalette.Entries[i] = Color.FromArgb(i, i, i); } }
private void btnConfigure_Click(object sender, EventArgs e) { if (EditMachineSettings(typeof(SySal.ImageProcessorDisplay.Configuration))) { SySal.ImageProcessorDisplay.Configuration c = (Configuration)SySal.Management.MachineSettings.GetSettings(typeof(SySal.ImageProcessorDisplay.Configuration)); Left = c.PanelLeft; Top = c.PanelTop; Width = Math.Max(100, c.PanelWidth); Height = Math.Max(100, c.PanelHeight); HostedFormat = m_HostedFormat; } }
public EditConfigForm(SySal.ImageProcessorDisplay.Configuration c) { InitializeComponent(); C = (Configuration)c.Clone(); }