public void recalcDoubleBuffer() { offScreenBmp = null; offScreenDC = null; offG = null; Invalidate(); }
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); } }
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); } } }
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(); } }
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); } }
public override void render(xGraphics g) { g.setColor(mColor); g.fillRect(0, 0, getW(), getH()); }
virtual public void render(xGraphics g) { }