Пример #1
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);
                }
            }
        }
Пример #2
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();
            }
        }
Пример #3
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);
            }
        }