Questions tagged [drawingcontext]
75 questions
1
vote
1 answer
How can I get DrawGeometry to draw along device pixel lines in WPF?
I'm trying to use DrawingContext.DrawGeometry get a rectangle with 1 device pixel wide sides.
var geometry = (defined elsewhere from a Rect {0.0, 0.0, 8.0, 18.0})
var brush = new SolidColorBrush(Color.FromArgb(30, 0xff, 0xff, 0xff));
// Note: the…

Factor Mystic
- 26,279
- 16
- 79
- 95
1
vote
1 answer
Erase the content inside the bezierPath
I’m working on a project that allows the user to draw anything on an image .. after the user finishes drawing . It closes the path and erase the content of image enclosed in a path and assign a new rectangular frame with a new image that can be…

Jeeyaa
- 33
- 6
1
vote
1 answer
Drawing layout problem when using DrawingContext
I'm trying unsuccessfully to draw 'P' inside a circle.
I'm using DrawingConntext due to performance issues.
This is what I get:
MainWindow XAML:

Erez
- 6,405
- 14
- 70
- 124
1
vote
0 answers
WPF: DrawingContext resolution
I'm using DrawingContext class to draw a bar graph, but the produced labels and ticks are blurry:
In the code I am using a class BarRenderer derived from FrameworkElement. Each bar is represented by a BarRenderer instance, and I do the drawing by…

Ayoub.A
- 1,943
- 3
- 27
- 34
1
vote
1 answer
WPF: Bezier curve using DrawingContext
I want to draw a bezier curve using DrawingContext class as follows:
var pathFigure = new PathFigure();
pathFigure.StartPoint = new Point(Width - 15, line.Position + line.Height);
pathFigure.Segments.Add(new BezierSegment(new Point(Width - 7.5,…

Ayoub.A
- 1,943
- 3
- 27
- 34
1
vote
1 answer
Content of Listview gets drawn over UI elements below in Flutter
Could someone help me with the following issue? I am not sure if this is a bug or intended behaviour. I have the following layout:
Column(
Flexible( ListView[..] )
Row(
Flexible(
TextField(..) <-- input field
),
…

Daniel Stephens
- 2,371
- 8
- 34
- 86
1
vote
1 answer
WPF TreeView Remove drawn lines (ReDraw)
Because a normal TreeView doesn't fit my needs, I created my own TreeView, inherit from TreeView and Draw lines between my TreeViewItems. Something like this
So far so good, but I would like to ReDraw (Remove add lines) after the tree has been…

Bin4ry
- 652
- 9
- 34
1
vote
1 answer
WPF DrawingContext DrawGlyphRun blur text
I'm using the DrawingContext DrawGlyphRun(GlyphRun) function to draw text in the Canvas using the solution from https://smellegantcode.wordpress.com/2008/07/03/glyphrun-and-so-forth/.
I'm using this over the FormattedText because it's faster and…

Andrei
- 367
- 5
- 18
1
vote
1 answer
Strange drawing with DrawingContext
I'm working on a custom WPF control that should visualize thousands of graphical primitives in a scrollable area. The core part of the control's template is the following:

TecMan
- 2,743
- 2
- 30
- 64
1
vote
0 answers
DrawingContext, Text, CultureInvariant, Printing, Windows10
I have encountered a problem when testing printing from application on Windows 10 (Pro Insider preview EN_US 10130). I found out that my code that prints document is failing and problem lies in drawingContext.DrawText() call. I found that…

MiroJanosik
- 675
- 5
- 30
1
vote
2 answers
How to Draw checkbox in WPF using DrawingContext c#
Hi i need to draw an checkbox within the rectangle.is there any predefined method in c# WPF .or how to i acheive this senario in WPF.

SharpGobi
- 144
- 1
- 13
1
vote
1 answer
How to use texture image .jpg as Windows.Media.pen C#
I have a texture image as .jpg and I want to use this image as Windows.Media.pen
I use Windows.Media.pen for drawing skeleton data in DrawingContext which I got it from microsoft kinect.
How can I use texture image .jpg as Windows.Media.pen?…

Tooru
- 13
- 4
1
vote
3 answers
Multiple thread image compositing
I'm using WPF imaging to composite text, 3d graphics and images together using a DrawingVisual. The result is then rendered into a RenderTargetBitmap and saved to disk as a jpeg. All of this happens in code with no visual window.
It's working well…

roufamatic
- 18,187
- 7
- 57
- 86
0
votes
0 answers
WPF userControl Render successed,and Append drawing never show on Screen?
this is very simple example to show my question.
1
public class TestControl : UserControl
{
public TestControl()
{
}
protected override void OnRender(DrawingContext context)
{
…

张成龙
- 11
- 1
0
votes
0 answers
DrawGeometry / Arc Segment single Center Point
Considering current code that takes a single center point.
using (DrawingContext drawingContext = this.RenderOpen())
{
drawingContext.DrawEllipse(highlightBrush, _isSelected ? SelectedPen : DeselectedPen, originPoint, radius,…

User5505
- 31
- 3