コード例 #1
0
ファイル: Label.cs プロジェクト: leemcknight/Similization
        //Draws the icon for the label.
        private void DrawIcon()
        {
            if (this.image == null)
            {
                return;
            }
            Rectangle rect = new Rectangle(PointToScreen(Point.Empty), this.image.Size);

            if (this.iconVertexBuffer == null)
            {
                this.iconVertexBuffer = CustomPainters.CreateTexturedBuffer(this.ControlHost.Device);
            }
            CustomPainters.PaintTexturedRectangle(this.ControlHost.Device, rect, this.iconVertexBuffer, image.Texture);
        }
コード例 #2
0
        //Draws the icon for the button.
        private void DrawIcon(Device device)
        {
            if (this.icon == null)
            {
                return;
            }

            Point     start = PointToScreen(Point.Empty);
            Rectangle rect  = new Rectangle(new Point(start.X + 3, start.Y + 3), this.icon.Size);

            if (this.iconVertexBuffer == null)
            {
                this.iconVertexBuffer = CustomPainters.CreateTexturedBuffer(device);
            }
            CustomPainters.PaintTexturedRectangle(device, rect, this.iconVertexBuffer, this.icon.Texture);
        }
コード例 #3
0
ファイル: Control.cs プロジェクト: leemcknight/Similization
 /// <summary>
 /// Refreshes the control.
 /// </summary>
 public virtual void Render(RenderEventArgs e)
 {
     this.screenBounds = new Rectangle(PointToScreen(Point.Empty), this.size);
     if (this.backgroundImage == null)
     {
         if (this.vertexBuffer == null)
         {
             this.vertexBuffer = CustomPainters.CreateColoredBuffer(e.ControlHost.Device);
         }
         CustomPainters.PaintColoredRectangle(e.ControlHost.Device, this.screenBounds, this.vertexBuffer, this.backColor, this.backColor2, GradientDirection.Vertical);
     }
     else
     {
         if (this.vertexBuffer == null)
         {
             this.vertexBuffer = CustomPainters.CreateTexturedBuffer(e.ControlHost.Device);
         }
         CustomPainters.PaintTexturedRectangle(e.ControlHost.Device, this.screenBounds, this.vertexBuffer, this.backgroundImage.Texture);
     }
 }