示例#1
0
 public TextEditor(LED_Board Display, bool ShowInWindow, int EffectIndex)
 {
     InitializeComponent();
     _show_in_window = ShowInWindow;
     _effect_index   = EffectIndex;
     textBox1.Size   = Display.Size;
     Width           = Display.Width + 185;
     Height          = Display.Height + 110;
     _display        = Display;
     if (File.Exists(_background_image_file_name))
     {
         try
         {
             StreamReader streamReader = new StreamReader(_background_image_file_name);
             Bitmap       bitmap       = new Bitmap((Image) new Bitmap(streamReader.BaseStream), _display.Size);
             streamReader.Close();
             _background_image = (Image)bitmap;
         }
         catch (Exception ex)
         {
             Console.WriteLine(ex.Message);
         }
     }
     _reset_changeflags();
 }
 public void ShowGraphicAsync(LED_Board target, string _filename, bool _graphic_in_window)
 {
     if (target.InvokeRequired)
     {
         target.Invoke((Delegate) new InvokeFunctions.ShowGraphicAsyncDelegate(ShowGraphicAsync), (object)target, (object)_filename, (object)_graphic_in_window);
     }
     else
     {
         target.ShowGraphic(_filename, _graphic_in_window);
     }
 }
 public void scbShowScoreAsync(LED_Board target)
 {
     if (target.InvokeRequired)
     {
         target.Invoke((Delegate) new InvokeFunctions.scbShowScoreAsyncDelegate(scbShowScoreAsync), (object)target);
     }
     else
     {
         target.DoShowScore = true;
         target.ShowVideo   = false;
         target.HideGraphic();
         target.State = LED_Board.DisplayState.Score;
     }
 }
 public void showScbGraphicAsync(
     LED_Board target,
     Image bitmap,
     bool smallgraphic,
     int effectindex)
 {
     if (target.InvokeRequired)
     {
         target.Invoke((Delegate) new InvokeFunctions.showScbGraphicAsyncDelegate(showScbGraphicAsync), (object)target, (object)bitmap, (object)smallgraphic, (object)effectindex);
     }
     else
     {
         target.ShowGraphic(bitmap, smallgraphic, effectindex);
     }
 }
示例#5
0
        public TextPreview(
            LED_Board Display,
            TextBox Source,
            Image Background,
            bool ShowInWindow,
            int EffectIndex)
        {
            InitializeComponent();
            _display        = Display;
            _source         = Source;
            _show_in_window = ShowInWindow;
            _effect_index   = EffectIndex;
            label1.Size     = _display.Size;
            Width           = _display.Width + 165;
            Height          = _display.Height + 110;
            label1.Image    = Background;
            label1.Font     = _source.Font;
            ContentAlignment contentAlignment = (ContentAlignment)0;

            switch (Source.TextAlign)
            {
            case HorizontalAlignment.Left:
                contentAlignment = ContentAlignment.TopLeft;
                break;

            case HorizontalAlignment.Right:
                contentAlignment = ContentAlignment.TopRight;
                break;

            case HorizontalAlignment.Center:
                contentAlignment = ContentAlignment.TopCenter;
                break;
            }
            label1.TextAlign = contentAlignment;
            label1.ForeColor = _source.ForeColor;
            label1.BackColor = _source.BackColor;
            label1.Text      = _source.Text;
        }