Questions tagged [drawingcontext]
75 questions
4
votes
1 answer
DrawText at an angle in DrawingContext?
So I am using the following code to take an existing image, text from an input form, and then place the text from the input form onto the existing image and save it as a new image:
using (FileStream output = new FileStream(match_outputFile,…

Jason Axelrod
- 7,155
- 10
- 50
- 78
3
votes
1 answer
Javascript ImageData Drawing Is Scaling Incorrectly
The idea of the program is to have an image of a map and to overlay a black canvas on that map. Then the user will click on some part of the canvas and, similar to a spray paint tool, the pixels near the mouse will become transparent on the canvas.…

m4gik
- 430
- 5
- 27
3
votes
1 answer
WPF Clear Region on a Drawing Context?
So I am producing a transparent PNG using a DrawingContext and DrawingVisual.
Inside the DrawingContext, I drew a rectange.
I would now like to "cut out" a circle inside of the rectangle. How do I do this? I did not find any functions in drawing…

Jason Axelrod
- 7,155
- 10
- 50
- 78
3
votes
1 answer
Convert DrawingContext to Geometry?
Does anybody know whether there is a possiblity to save or convert a DrawingContext to a Geometry?
E.g. after
using (DrawingContext dc = RenderOpen())
{
dc.DrawLine(penSelected, Data.MidTop, Data.MidTop + vertical);
dc.DrawLine(pen,…

Gerard
- 13,023
- 14
- 72
- 125
3
votes
1 answer
Changing the text of a FormattedText
I'm using the following method to write text to my MainWindow. My question is, is there any way to change the Text of the FormattetText or the drawingvisual after it has been created?
Or should I use another method to write my text, if I want it…
user602996
3
votes
1 answer
Drawing skeleton animation from file to screen
What I'm basically trying to do is writing kinect skeleton frame data (joint positions) to a file using C# & Kinect SDK (done), then process this data externally (done), then read the data back into my application (done) and draw the data as a light…

Cassio
- 147
- 1
- 8
2
votes
1 answer
How does drawing with the DrawingContext in OnRender work behind the scene?
I'm painting a rather complex "image" (which often needs to be refreshed and has many drawing primitives) in a WPF window by overriding the OnRender method of a separate UIElement and using the DrawingContext to directly draw the primitives.
My…

Daniel
- 471
- 5
- 28
2
votes
2 answers
how to set opacity for my rectangle(drawingcontext)
This is my rectangle
protected void DrawRectangle(DrawingContext dc, Point point)
{
DrawingVisual drawingVisual = new DrawingVisual();
using (DrawingContext drawContext = drawingVisual.RenderOpen())
{
…

Bonanza
- 31
- 5
2
votes
1 answer
How to draw multiple lines with different z index in c# wpf application
I am using DrawingContext.DrawLine function to draw lines. But it seems like lines affecting the position of other lines on canvas. So I need to add different z-index values to all lines. Is there any way to draw lines with different z-index so they…

Deepika Porwal
- 21
- 2
2
votes
0 answers
Rectangle with shadow is clipping outside shadow
Inheriting Shape, we have created a number of custom shapes. RectangleAnnotation.cs is one of them:
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Effects;
namespace ShareX.ScreenCaptureLib
{
public class…

McoreD
- 313
- 2
- 12
2
votes
2 answers
How to show dropshadow on drawingcontext tools
Actually i am using drawingContext.DrawRectangle method for drawing rectangle on canvas..
i want to add shadow effect on rectangle..
drawingContext.DrawRectangle(new SolidColorBrush(graphicsObjectFillColor),
new Pen(new…
user1360355
2
votes
1 answer
How to get know that CGContext is drawing to screen
I want to get know that current CGContext is used for image, PDF or for screen drawing. In Cocoa I just use [[NSGraphicsContext currentContext] isDrawingToScreen] ([NSGraphicsContext currentContextDrawingToScreen] on 10.10). How can I get the same…

Volodymyr Dudchak
- 45
- 5
2
votes
1 answer
Draw a curve with DrawingContext
I'm trying to make a custom control to draw a curve with WPF.
I made a control which inherit from Control:
public class Courbe : Control {
private static readonly CultureInfo CI = new CultureInfo("en-US");
private Pen _p = new Pen();
…
user3564358
2
votes
2 answers
Trying to draw an ellipse in a WPF window, but it is not visible
I am trying to create my own graph user control, I have one already working on win forms and I am trying to move it into WPF world.
I am starting with learning how to do drawing, so first thing I was trying to draw a black ellipse that fills an…

Bishoy
- 705
- 9
- 24
2
votes
1 answer
Get DrawingVisual properties
I have a DrawingVisual object I have created for example using this method:
Private Function CreateDrawingVisualRectangle() As DrawingVisual
Dim drawingVisual As New DrawingVisual()
Dim drawingContext As DrawingContext =…

gliderkite
- 8,828
- 6
- 44
- 80