Example #1
0
        public OsdForm()
        {
            this.InitializeComponent();
            this.bInit           = true;
            this.BackgroundImage = (Image)Resources.ResourceManager.GetObject("bg_long");

            this.pic.Image = this.BackgroundImage;
            this.rawWidth  = base.Width;
            this.rawHeight = base.Height;
            byte[] bank_Gothic_Md_BT = Resources.Bank_Gothic_Md_BT;
            IntPtr intPtr            = Marshal.AllocCoTaskMem(bank_Gothic_Md_BT.Length);

            Marshal.Copy(bank_Gothic_Md_BT, 0, intPtr, bank_Gothic_Md_BT.Length);
            uint num = 0U;

            this.fonts.AddMemoryFont(intPtr, Resources.Bank_Gothic_Md_BT.Length);
            OsdForm.AddFontMemResourceEx(intPtr, (uint)Resources.Bank_Gothic_Md_BT.Length, IntPtr.Zero, ref num);
            Marshal.FreeCoTaskMem(intPtr);
            Font  font   = new Font(this.fonts.Families[0], 16f);
            float emSize = 357.28f / font.GetHeight((float)this.GetDPI());

            this.T_value.Font    = new Font(this.fonts.Families[0], emSize);
            base.Opacity         = 0.0;
            this.InitTimer.Tick += this.InitTimer_Tick;
            this.InitTimer.Start();
        }
Example #2
0
        public void ShowKBOsd(int[] RGBArrayLeft, int[] RGBArrayMid, int[] RGBArrayRight)
        {
            if (!this.pic.Visible)
            {
                this.pic.Visible = true;
            }
            this.T_value.Visible = false;
            this.pic_bar.Visible = false;
            this.timer1.Stop();
            this.timer2.Stop();
            base.Location = new System.Drawing.Point(50, 60);
            Bitmap   imageb = new Bitmap(300, 50);
            Graphics g      = Graphics.FromImage(imageb);

            g.Clear(Color.FromArgb(255, RGBArrayLeft[0], RGBArrayLeft[1], RGBArrayLeft[2]));
            g.FillRectangle(new SolidBrush(Color.FromArgb(255, RGBArrayMid[0], RGBArrayMid[1], RGBArrayMid[2])), 101, 0, 100, 50);
            g.FillRectangle(new SolidBrush(Color.FromArgb(255, RGBArrayRight[0], RGBArrayRight[1], RGBArrayRight[2])), 201, 0, 100, 50);

            this.pic.Image = imageb;

            this.pic.Width  = this.pic.Image.Width;
            this.pic.Height = this.pic.Image.Height;
            base.Width      = this.pic.Image.Width;
            base.Height     = this.pic.Image.Height;
            base.Invalidate();
            base.Opacity = 0.9;
            OsdForm.ShowWindow(base.Handle, 4);
            this.timer1.Enabled = true;
        }
Example #3
0
 public KBWindow(LogoManager logo, Utility utility, OsdForm osd)
 {
     InitializeComponent();
     this._logo    = logo;
     this._utility = utility;
     this._osd     = osd;
     SetInterface();
 }
Example #4
0
        private void ShowBarOSD(OsdForm.OsdImage osdimage, int value_max, int value, bool showBar, bool showtext, string text)
        {
            this.timer1.Stop();
            this.timer2.Stop();
            base.Location       = new System.Drawing.Point(50, 60);
            this.pic.Image      = (Image)Resources.ResourceManager.GetObject(osdimage.ToString());
            this.pic.Width      = this.pic.Image.Width;
            this.pic.Height     = this.pic.Image.Height;
            this.pic_bar.Height = this.pic.Image.Height;
            this.T_value.Height = this.pic.Image.Height;
            this.T_value.Width  = 69;
            base.Width          = this.pic.Image.Width;
            base.Height         = this.pic.Image.Height;
            this.pic.Visible    = true;
            if (showBar)
            {
                double num = 240.0 / (double)value_max * (double)value;
                if (num < 10.0)
                {
                    num = 8.0;
                }
                else if (num > 230.0)
                {
                    num = 240.0;
                }
                this.pic_bar.Width   = (int)Math.Round(num, 0);
                this.pic_bar.Visible = true;
                if (showtext == true)
                {
                    this.T_value.Text = text;
                }
                else
                {
                    this.T_value.Text = value.ToString() + text;
                }


                this.T_value.Visible = true;
            }
            else
            {
                this.T_value.Visible = false;
                this.pic_bar.Visible = false;
            }
            this.pic_bar.Location = new System.Drawing.Point(107, 0);
            this.T_value.Location = new System.Drawing.Point(360, 0);
            base.Invalidate();
            base.Opacity = 0.9;
            OsdForm.ShowWindow(base.Handle, 4);
            this.timer1.Enabled = true;
        }
        public KBWindow(LedManager ledmanager, Utility utility, OsdForm osd)
        {
            InitializeComponent();
            Application.Current.ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;
            this._ledManager = ledmanager;
            this._utility    = utility;
            this._osd        = osd;
            this.colorPicker = new ColorBox();

            silentswitch = _utility.GetSilent();
            ClevoModel   = _utility.GetModel();

            SetInterface();
            RestoreLastSettings();
            SubscribeToEvents();
        }
Example #6
0
 private void InitOsd()
 {
     if (this.pic.Visible)
     {
         this.pic.Visible = false;
     }
     this.T_value.Visible = false;
     this.pic_bar.Visible = false;
     this.timer1.Stop();
     this.timer2.Stop();
     base.Opacity  = 0.0;
     base.Location = new System.Drawing.Point(50, 60);
     base.Width    = 429;
     base.Height   = 90;
     base.Invalidate();
     base.Show();
     OsdForm.ShowWindow(base.Handle, 4);
     this.timer1.Enabled = true;
 }
Example #7
0
        public void ShowLogoOsd(int LogoColor, int r = 0, int g = 0, int b = 0)
        {
            if (!this.pic.Visible)
            {
                this.pic.Visible = true;
            }


            this.T_value.Visible = true;
            this.pic_bar.Visible = false;
            this.timer1.Stop();
            this.timer2.Stop();
            base.Location = new System.Drawing.Point(50, 60);
            Bitmap   imageb = new Bitmap(300, 50);
            Graphics graph  = Graphics.FromImage(imageb);

            if (LogoColor < 9)
            {
                graph.Clear(colorarray[LogoColor]);
            }
            else
            {
                graph.Clear(Color.FromArgb(r, g, b));
            }

            this.pic.Image = imageb;

            this.pic.Width  = this.pic.Image.Width;
            this.pic.Height = this.pic.Image.Height;
            base.Width      = this.pic.Image.Width;
            base.Height     = this.pic.Image.Height;
            base.Invalidate();
            base.Opacity = 0.9;

            this.T_value.Text     = "Cover:";
            this.T_value.Height   = this.pic.Image.Height;
            this.T_value.Width    = 100;
            this.T_value.Location = new System.Drawing.Point(0, 0);

            OsdForm.ShowWindow(base.Handle, 4);
            this.timer1.Enabled = true;
        }
Example #8
0
 public void ShowOsd(OsdForm.OsdImage osdimage)
 {
     if (!this.pic.Visible)
     {
         this.pic.Visible = true;
     }
     this.T_value.Visible = false;
     this.pic_bar.Visible = false;
     this.timer1.Stop();
     this.timer2.Stop();
     base.Location   = new System.Drawing.Point(50, 60);
     this.pic.Image  = (Image)Resources.ResourceManager.GetObject(osdimage.ToString());
     this.pic.Width  = this.pic.Image.Width;
     this.pic.Height = this.pic.Image.Height;
     base.Width      = this.pic.Image.Width;
     base.Height     = this.pic.Image.Height;
     base.Invalidate();
     base.Opacity = 0.9;
     OsdForm.ShowWindow(base.Handle, 4);
     this.timer1.Enabled = true;
 }
Example #9
0
 private void timer2_Tick(object sender, EventArgs e)
 {
     base.Opacity -= 0.2;
     if (base.Opacity <= 0.3 && base.Opacity != 0.0)
     {
         this.pic.Image       = (Image)Resources.ResourceManager.GetObject("bg_long");
         this.pic.Visible     = false;
         this.pic_bar.Visible = false;
         this.T_value.Visible = false;
         base.Opacity         = 0.0;
         base.Invalidate();
         OsdForm.ShowWindow(base.Handle, 4);
         return;
     }
     if (base.Opacity == 0.0)
     {
         this.timer1.Stop();
         this.timer2.Stop();
         this.bInit = false;
         OsdForm.ShowWindow(base.Handle, 0);
     }
 }