예제 #1
0
파일: Window.cs 프로젝트: djlw78/Mosa
        public override void OnDraw()
        {
            AntiAliasedScanlineRasterizer ras = new Pictor.AntiAliasedScanlineRasterizer();
            Scanline sl = new Pictor.Scanline();

            RoundedRect rectBorder = new RoundedRect(m_Bounds, m_BorderRadius);

            GetRenderer().Render(rectBorder, new RGBA_Bytes(0, 0, 0));
            RectD insideBounds = Bounds;

            insideBounds.Inflate(-BorderWidth);
            RoundedRect rectInside  = new RoundedRect(insideBounds, Math.Max(m_BorderRadius - BorderWidth, 0));
            RGBA_Bytes  insideColor = new RGBA_Bytes(222, 222, 222);

            GetRenderer().Render(rectInside, insideColor);

            RoundedRect titleBar = new RoundedRect(new RectD(m_Bounds.Left + BorderWidth, m_Bounds.Top - BorderWidth - 20, m_Bounds.Right - BorderWidth, m_Bounds.Top - BorderWidth), m_BorderRadius);

            GetRenderer().Render(titleBar, new RGBA_Bytes(0, 66, 128));

            base.OnDraw();
        }
예제 #2
0
        public override void OnDraw()
        {
            AntiAliasedScanlineRasterizer ras = new Pictor.AntiAliasedScanlineRasterizer();
            Scanline sl = new Pictor.Scanline();

            RoundedRect rectBorder = new RoundedRect(m_Bounds, m_BorderRadius);
            GetRenderer().Render(rectBorder, new RGBA_Bytes(0, 0, 0));
            RectD insideBounds = Bounds;
            insideBounds.Inflate(-BorderWidth);
            RoundedRect rectInside = new RoundedRect(insideBounds, Math.Max(m_BorderRadius - BorderWidth, 0));
            RGBA_Bytes insideColor = new RGBA_Bytes(222, 222, 222);

            GetRenderer().Render(rectInside, insideColor);

            RoundedRect titleBar = new RoundedRect(new RectD(m_Bounds.Left + BorderWidth, m_Bounds.Top - BorderWidth - 20, m_Bounds.Right - BorderWidth, m_Bounds.Top - BorderWidth), m_BorderRadius);
            GetRenderer().Render(titleBar, new RGBA_Bytes(0, 66, 128));

            base.OnDraw();
        }