예제 #1
0
        private void OnClickSave(object sender, EventArgs e)
        {
            string path = Options.OutputPath;

            if ((int)treeView.SelectedNode.Parent.Tag == 1)
            {
                string fileName = UnicodeFonts.Save(path, (int)treeView.SelectedNode.Tag);
                MessageBox.Show(
                    $"Unicode saved to {fileName}",
                    "Save",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information,
                    MessageBoxDefaultButton.Button1);
                Options.ChangedUltimaClass["UnicodeFont"] = false;
            }
            else
            {
                string fileName = Path.Combine(path, "fonts.mul");
                ASCIIText.Save(fileName);
                MessageBox.Show(
                    $"Fonts saved to {fileName}",
                    "Save",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information,
                    MessageBoxDefaultButton.Button1);
                Options.ChangedUltimaClass["ASCIIFont"] = false;
            }
        }
예제 #2
0
        private void OnClickSave(object sender, EventArgs e)
        {
            string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

            if ((int)treeView.SelectedNode.Parent.Tag == 1)
            {
                string FileName = UnicodeFonts.Save(path, (int)treeView.SelectedNode.Tag);
                MessageBox.Show(
                    String.Format("Unicode saved to {0}", FileName),
                    "Save",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information,
                    MessageBoxDefaultButton.Button1);
                Options.ChangedUltimaClass["UnicodeFont"] = false;
            }
            else
            {
                string FileName = Path.Combine(path, "fonts.mul");
                ASCIIText.Save(FileName);
                MessageBox.Show(
                    String.Format("Fonts saved to {0}", FileName),
                    "Save",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information,
                    MessageBoxDefaultButton.Button1);
                Options.ChangedUltimaClass["ASCIIFont"] = false;
            }
        }
예제 #3
0
파일: FontText.cs 프로젝트: v0icer/poltools
 private void OnTextChange(object sender, EventArgs e)
 {
     if (type == 1) //Unicode
     {
         pictureBox1.Image = UnicodeFonts.WriteText(font, textBox1.Text);
     }
     else
     {
         pictureBox1.Image = ASCIIText.DrawText(font, textBox1.Text);
     }
 }
예제 #4
0
 private void lstFont_MeasureItem(object sender, MeasureItemEventArgs e)
 {
     if (e.Index > (this.fntunicode ? 12 : 9))
     {
         e.ItemHeight = 0;
     }
     else
     {
         Bitmap bitmap = this.fntunicode ? UnicodeFonts.GetStringImage(e.Index, "ABCabc123!@#$АБВабв") : Fonts.GetStringImage(e.Index, "ABCabc123 */ АБВабв");
         e.ItemHeight = bitmap.Height;
         bitmap.Dispose();
     }
 }
예제 #5
0
 public override void RefreshCache()
 {
     if (this.mHue == null)
     {
         this.mHue = Hues.GetHue(0);
     }
     if (this.mCache != null)
     {
         this.mCache.Dispose();
     }
     this.mCache = UnicodeFonts.WriteText(2, this.mInitialText + " ");
     if ((this.mHue == null || this.mHue.Index == 0 ? 0 : 1) == 0)
     {
         return;
     }
     this.mHue.ApplyTo(this.mCache, false);
 }
예제 #6
0
        private void lstFont_DrawItem(object sender, DrawItemEventArgs e)
        {
            if ((e.State & DrawItemState.Selected) > DrawItemState.None)
            {
                e.Graphics.FillRectangle(SystemBrushes.Highlight, e.Bounds);
            }
            else
            {
                e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds);
            }
            if (e.Index > (this.fntunicode ? 12 : 9))
            {
                return;
            }
            Bitmap bitmap = this.fntunicode ? UnicodeFonts.GetStringImage(e.Index, "ABCabc123!@#$АБВабв") : Fonts.GetStringImage(e.Index, "ABCabc123 */ АБВабв");

            e.Graphics.DrawImage(bitmap, e.Bounds.Location);
            bitmap.Dispose();
        }
예제 #7
0
 public override void RefreshCache()
 {
     if (this.mCache != null)
     {
         this.mCache.Dispose();
     }
     this.mCache = this.mUnicode ? UnicodeFonts.GetStringImage(this.mFontIndex, this.mText + " ") : Fonts.GetStringImage(this.mFontIndex, this.mText + " ");
     if ((this.mHue == null || this.mHue.Index == 0 ? 0 : 1) != 0)
     {
         this.mHue.ApplyTo(this.mCache, this.mPartialHue);
     }
     if (this.mCropped)
     {
         Bitmap   bitmap   = new Bitmap(this.mSize.Width, this.mSize.Height, PixelFormat.Format32bppArgb);
         Graphics graphics = Graphics.FromImage((Image)bitmap);
         graphics.Clear(Color.Transparent);
         graphics.DrawImage((Image)this.mCache, 0, 0);
         graphics.Dispose();
         this.mCache.Dispose();
         this.mCache = bitmap;
     }
     this.mSize = this.mCache.Size;
 }
예제 #8
0
        public LabelElement(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            this.mFontIndex = 2;
            int int32 = info.GetInt32("LabelElementVersion");

            this.mText = info.GetString(nameof(Text));
            this.mHue  = Hues.GetHue(info.GetInt32("HueIndex"));
            if (int32 >= 3)
            {
                this.mPartialHue = info.GetBoolean(nameof(PartialHue));
                this.mUnicode    = info.GetBoolean(nameof(Unicode));
            }
            else
            {
                this.mPartialHue = true;
                this.mUnicode    = true;
            }
            this.mFontIndex = info.GetInt32("FontIndex");
            if (int32 <= 2)
            {
                --this.mFontIndex;
            }
            if (int32 >= 2)
            {
                this.mCropped = info.GetBoolean(nameof(Cropped));
                this.mSize    = (Size)info.GetValue(nameof(Size), typeof(Size));
            }
            else
            {
                this.mCropped = false;
                Bitmap stringImage = UnicodeFonts.GetStringImage(this.mFontIndex, this.mText + " ");
                this.mSize = stringImage.Size;
                stringImage.Dispose();
            }
            this.RefreshCache();
        }
예제 #9
0
 private void OnTextChange(object sender, EventArgs e)
 {
     pictureBox1.Image = _type == 1
         ? UnicodeFonts.WriteText(_font, textBox1.Text)
         : ASCIIText.DrawText(_font, textBox1.Text);
 }