Exemplo n.º 1
0
        public void recalcDoubleBuffer()
        {
            offScreenBmp = null;
            offScreenDC  = null;
            offG         = null;

            Invalidate();
        }
Exemplo n.º 2
0
 public override void render(xGraphics g)
 {
     if (mType == PICTURE_TYPE_NORMAL)
     {
         if (mImage != null)
         {
             g.drawImage(mImage, 0, 0);
         }
         else if (mImageList != null)
         {
             g.drawImage(mImageList.Images[mImgIndex], 0, 0);
         }
     }
     else
     {
         g.drawImage(mImage, 0, 0);
     }
 }
Exemplo n.º 3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            if (mBaseControl != null)
            {
                if (mGraphics == null)
                {
                    mGraphics = new xGraphics();
                }
                mGraphics.setGraphics(e.Graphics);

                if (mDoubleBuffer)
                {
                    mGraphics.getGraphics().DrawImage(offScreenBmp, 0, 0);
                }
                else
                {
                    mBaseControl.render(mGraphics);
                }
            }
        }
Exemplo n.º 4
0
        private void listView1_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
        {
            if (e.ColumnIndex == _customDrawIndex)
            {
                e.Graphics.Clear(Color.Red);

                ListViewItem.ListViewSubItem subItem = e.SubItem;
                Rectangle rc = subItem.Bounds;

                if (_cellGraphic == null)
                {
                    _cellGraphic = new xGraphics();
                }

                _cellGraphic.setGraphics(e.Graphics);
                _drawCellDelegate.Invoke(e.ItemIndex, _cellGraphic, rc);
            }
            else
            {
                e.DrawText();
            }
        }
Exemplo n.º 5
0
        protected override void OnPaintBackground(PaintEventArgs pevent)
        {
            //  ThuyPS: avoiding flickering technique
            if (mBaseControl != null && mDoubleBuffer)
            {
                if (offScreenBmp == null)
                {
                    offScreenBmp = new Bitmap(mBaseControl.getW(), mBaseControl.getH());
                    offScreenDC  = Graphics.FromImage(offScreenBmp);

                    offG = new xGraphics();
                    offG.setGraphics(offScreenDC);
                }
                //  background
                offG.getGraphics().Clear(this.BackColor);

                //  render
                mBaseControl.render(offG);
            }
            else
            {
                base.OnPaintBackground(pevent);
            }
        }
Exemplo n.º 6
0
 public override void render(xGraphics g)
 {
     g.setColor(mColor);
     g.fillRect(0, 0, getW(), getH());
 }
Exemplo n.º 7
0
 virtual public void render(xGraphics g)
 {
 }