public Form1() { InitializeComponent(); SystemState.Text = "Ready"; CharCodeLabel.Text = CharacterSelection.ToString("X4"); CharCodeLabel.Enabled = false; CurrentFont = new FontFileIO(); // Class is instantiated... and ready for use... // Test our class... FontRenderer = new Renderer(); // Instantiation of class... testdata[0] = 1; testdata[1] = 0; testdata[2] = 0; testdata[3] = 0; testdata[4] = 0; testdata[5] = 0; testdata[6] = 0; testdata[7] = 0; testdata[8] = 0; testdata[9] = 1; testdata[10] = 0; testdata[11] = 0; testdata[12] = 0; testdata[13] = 0; testdata[14] = 0; testdata[15] = 0; testdata[16] = 0; testdata[17] = 0; testdata[18] = 1; testdata[19] = 0; testdata[20] = 0; testdata[21] = 0; testdata[22] = 0; testdata[23] = 0; testdata[24] = 0; testdata[25] = 0; testdata[26] = 0; testdata[27] = 1; testdata[28] = 0; testdata[29] = 0; testdata[30] = 0; testdata[31] = 0; FontRenderer.SetXSize(8); FontRenderer.SetYSize(8); Bitmap PreviewCanvas = new Bitmap(128, 128); Bitmap CharCanvas = new Bitmap((FontRenderer.GetXSize() * 16) + FontRenderer.GetXSize() + 1, (FontRenderer.GetYSize() * 16) + FontRenderer.GetYSize() + 1); // Here we need to compute the size of the bitmap required to hold all our info... FontRenderer.RenderCharacter(ref CharCanvas, ref testdata, 0, 0); FontRenderer.RenderPreview(ref PreviewCanvas, ref testdata, PreviewMagValue); CharacterEdit.Image = null; CharacterEdit.Image = CharCanvas; CharPreview.Image = null; CharPreview.Image = PreviewCanvas; }
public Form2() { InitializeComponent(); AnsiRb.Checked = true; // Initial state on the form of this radio button... LCDHorizontal.Checked = true; // Initial state on the form of this radio button... FontPreviewRenderer = new Renderer(); // Instantiate the rendering class we use to draw stuff... Byte1.ForeColor = Color.Red; Byte2.ForeColor = Color.Red; Byte3.ForeColor = Color.Red; Byte4.ForeColor = Color.Red; ByteA.ForeColor = Color.Green; ByteB.ForeColor = Color.Green; ByteC.ForeColor = Color.Green; ByteD.ForeColor = Color.Green; ByteA.Visible = false; ByteB.Visible = false; ByteC.Visible = false; ByteD.Visible = false; Byte1.Visible = false; Byte2.Visible = false; Byte3.Visible = false; Byte4.Visible = false; HorByteMarker2.Visible = false; HorByteMarker3.Visible = false; HorByteMarker4.Visible = false; XDimension.SelectedIndex = 1; YDimension.SelectedIndex = 0; KerningEdge.SelectedIndex = 0; Baseline.SelectedIndex = 0; CanUpdate = true; // Combo boxes have been initialised, so enable the event handler internals XDimension.SelectedIndex = 0; // Trigger an update... WarningLabel.Text = ""; StatusLabel1.Text = ""; SynchCheckBox.Checked = true; KerningEdge.Enabled = false; Baseline.Enabled = false; }