private void WaitDialogPaint(object sender, PaintEventArgs e) { Rectangle clipRectangle = e.ClipRectangle; GraphicsCache graphicsCache = new GraphicsCache(e); using (StringFormat stringFormat = new StringFormat()) { Brush solidBrush = graphicsCache.GetSolidBrush(LookAndFeelHelper.GetSystemColor(base.LookAndFeel, SystemColors.WindowText)); stringFormat.Alignment = (stringFormat.LineAlignment = StringAlignment.Center); stringFormat.Trimming = StringTrimming.EllipsisCharacter; if (base.LookAndFeel.ActiveLookAndFeel.ActiveStyle == ActiveLookAndFeelStyle.Skin) { ObjectPainter.DrawObject(graphicsCache, new SkinTextBorderPainter(base.LookAndFeel), new BorderObjectInfoArgs(null, clipRectangle, null)); } else { ControlPaint.DrawBorder3D(e.Graphics, clipRectangle, Border3DStyle.RaisedInner); } clipRectangle.X += 30; clipRectangle.Width -= 30; clipRectangle.Height /= 3; clipRectangle.Y += clipRectangle.Height / 2; e.Graphics.DrawString(this.title, this.BoldFont, solidBrush, clipRectangle, stringFormat); clipRectangle.Y += clipRectangle.Height; e.Graphics.DrawString(this.caption, this.RegularFont, solidBrush, clipRectangle, stringFormat); graphicsCache.Dispose(); } }
public void Dispose() { VertexShaderCache.Dispose(); PixelShaderCache.Dispose(); GeometryShaderCache.Dispose(); HullShaderCache.Dispose(); DomainShaderCache.Dispose(); ComputeShaderCache.Dispose(); BlendStateCache.Dispose(); RasterizerStateCache.Dispose(); DepthStencilStateCache.Dispose(); }
public static void SetScrollBarVisibility(this MemoEdit memoEdit) { MemoEditViewInfo vi = memoEdit.GetViewInfo() as MemoEditViewInfo; GraphicsCache cache = new GraphicsCache(memoEdit.CreateGraphics()); int h = (vi as IHeightAdaptable).CalcHeight(cache, vi.MaskBoxRect.Width); ObjectInfoArgs args = new ObjectInfoArgs(); args.Bounds = new Rectangle(0, 0, vi.ClientRect.Width, h); Rectangle rect = vi.BorderPainter.CalcBoundsByClientRectangle(args); cache.Dispose(); memoEdit.Properties.ScrollBars = rect.Height > memoEdit.Height ? ScrollBars.Vertical : ScrollBars.None; }
private ImageBrick GetImageBrick(PrintColumnInfo colInfo, Rectangle rect, out string displayText) { Bitmap bmp = new Bitmap(rect.Width, rect.Height); GraphicsCache cache = new GraphicsCache(Graphics.FromImage(bmp)); FooterCellCustomDrawEventArgs args = (View as MyGridView).GetCustomDrawCellArgs(cache, rect, colInfo.Column); displayText = args.Info.DisplayText; if (!args.Handled) { return(null); } BorderSide border = args.Appearance.Options.UseBorderColor? BorderSide.All: BorderSide.None; ImageBrick ib = new ImageBrick(border, 1, args.Appearance.BorderColor, args.Appearance.BackColor); ib.Rect = rect; ib.Image = bmp; cache.Dispose(); return(ib); }
public void Draw(PaintEventArgs e) { (ViewInfo as MyNavigatorControlViewInfo).CalcViewInfo(e.Graphics, MouseButtons.None, new Point(-6000, -6000), e.ClipRectangle); GraphicsCache cache = new GraphicsCache(new DXPaintEventArgs(e)); try { ControlGraphicsInfoArgs info = new ControlGraphicsInfoArgs(ViewInfo, cache, ViewInfo.Bounds); ISupportGlassRegions reg = Parent as ISupportGlassRegions; if (reg != null) { info.IsDrawOnGlass = reg.IsOnGlass(Parent.RectangleToClient(RectangleToScreen(ViewInfo.Bounds))); } Painter.Draw(info); RaisePaintEvent(this, e); } finally { cache.Dispose(); } }
private static void MemoEdit_TextChanged(object sender, EventArgs e) { var memoEdit = sender as MemoEdit; if (memoEdit != null) { var vi = memoEdit.GetViewInfo() as MemoEditViewInfo; if (vi != null) { var cache = new GraphicsCache(memoEdit.CreateGraphics()); var h = ((IHeightAdaptable)vi).CalcHeight(cache, vi.MaskBoxRect.Width); var args = new ObjectInfoArgs { Bounds = new Rectangle(0, 0, vi.ClientRect.Width, h) }; var rect = vi.BorderPainter.CalcBoundsByClientRectangle(args); cache.Dispose(); memoEdit.Properties.ScrollBars = rect.Height > memoEdit.Height ? ScrollBars.Vertical : ScrollBars.None; } } }
public void Dispose() { EffectProgramCache.Dispose(); VertexAttribsCache.Dispose(); }
private void WaitDialogPaint(object sender, PaintEventArgs e) { Rectangle clipRectangle = e.ClipRectangle; clipRectangle.Inflate(-1, -1); GraphicsCache cache = new GraphicsCache(e); using (StringFormat format = new StringFormat()) { Brush solidBrush = cache.GetSolidBrush(DevExpress.LookAndFeel.LookAndFeelHelper.GetSystemColor(base.LookAndFeel, SystemColors.WindowText)); format.Alignment = format.LineAlignment = StringAlignment.Center; format.Trimming = StringTrimming.EllipsisCharacter; if (base.LookAndFeel.ActiveLookAndFeel.ActiveStyle == ActiveLookAndFeelStyle.Skin) { ObjectPainter.DrawObject(cache, new SkinTextBorderPainter(base.LookAndFeel), new BorderObjectInfoArgs(null, clipRectangle, null)); } else { ControlPaint.DrawBorder3D(e.Graphics, clipRectangle, Border3DStyle.RaisedInner); } clipRectangle.X += 30; clipRectangle.Width -= 30; clipRectangle.Height /= 3; clipRectangle.Y += clipRectangle.Height / 2; e.Graphics.DrawString(this.title, this.boldFont, solidBrush, clipRectangle, format); clipRectangle.Y += clipRectangle.Height; e.Graphics.DrawString(this.caption, this.font, solidBrush, clipRectangle, format); cache.Dispose(); } }