Questions tagged [drawing]

Issues around forms and graphics being drawn onto a computer screen, windowing system or device

5923 questions
15
votes
2 answers

How can I make the xtick labels of a plot be simple drawings using matplotlib?

Instead of words or numbers being the tick labels of the x axis, I want to draw a simple drawing (made of lines and circles) as the label for each x tick. Is this possible? If so, what is the best way to go about it in matplotlib?
benson
  • 423
  • 3
  • 11
15
votes
2 answers

How to draw a line between 2 elements using JQuery and refreshing that line?

I am using JQuery-UI draggables and droppables to clone elements onto a div. What is the best way to draw a line between elements on a page using JQuery. What is the best way to refresh lines on the page? I will have multiple lines on the page and…
StuperUser
  • 10,555
  • 13
  • 78
  • 137
15
votes
2 answers

Drawing app on iPad using OpenGL

I'm creating a drawing app ( text ) for the iPad using OpenGL. I've already had a look at Apple's example GLPaint, and my app is now based on that code. My app should be just for drawing text, not for painting pictures. Well, my App works, I can…
burki
  • 2,946
  • 6
  • 37
  • 51
15
votes
5 answers

Android drawing a line to follow your finger

What I want to do is to draw a line that will follow my finger. I've created a custom view, and I have an onTouchEvent() that works. I can draw a static line in the onDraw() method without much trouble. I'm not really sure how to get the line to…
jacklin
  • 2,739
  • 1
  • 24
  • 31
15
votes
2 answers

Draw arc with 2 points and center of the circle

I have two points of circle and center of this circle. I want to draw an arc between these points. Method drawArc is to simple and doesn't fit my purpose. Anybody help?
CarolusPl
  • 639
  • 4
  • 9
  • 18
15
votes
2 answers

How to draw a line in Swift 3

I would like the user to touch 2 points and then a line is drawn between those two points. Here is what I have so far: func drawline(){ let context = UIGraphicsGetCurrentContext() context!.beginPath() context?.move(to: pointA) …
Charles B.
  • 181
  • 1
  • 1
  • 7
15
votes
2 answers

Add opaque "shadow" (outline) to Android TextView

I have a TextView in my Activity to which I want to add a shadow. It is supposed to look like in OsmAnd (100% opaque): But it looks like this: You can see that the current shadow is blurred and fades away. I want a solid, opaque shadow. But…
juergen d
  • 201,996
  • 37
  • 293
  • 362
15
votes
2 answers

Android: How to get a custom view to redraw partially?

I have a custom view that fills my entire screen. (A piano keyboard) When a user touches the key, it causes invalidate() to be called and the whole keyboard gets redrawn to show the new state with a touched key. Currently the view is very simple,…
Peterdk
  • 15,625
  • 20
  • 101
  • 140
15
votes
4 answers

How to effectively draw on desktop in C#?

I want to draw directly on the desktop in C#. From searching a bit, I ended up using a Graphics object from the Desktop HDC (null). Then, I painted normally using this Graphics object. The problem is that my shapes get lost when any part of the…
Lazlo
  • 8,518
  • 14
  • 77
  • 116
15
votes
1 answer

Drawing Polygons in Swift

I need to highlight an irregular shape when the user taps on it. My idea on how to do it was to draw a polygon that matches the shape, fill it with a color and change the opacity to make it translucent. Unfortunately I can't find anything on how…
Floyd Resler
  • 1,786
  • 3
  • 22
  • 41
15
votes
4 answers

Why should I use the InkCanvas in WPF?

In my WPF application I have some drawing functionality. I have solved this using a Canvas and handling mouse gestures manually, and I also add the drawn Strokes (wrapped in InkPresenter) to this Canvas. Using Blend I suddenly discover that there…
stiank81
  • 25,418
  • 43
  • 131
  • 202
15
votes
11 answers

Cross-platform drawing library

I've been looking for a good cross-platform 2D drawing library that can be called from C++ and can be used to draw some fairly simple geometry; lines, rectangles, circles, and text (horizontal and vertical) for some charts, and save the output to…
Gerald
  • 23,011
  • 10
  • 73
  • 102
15
votes
4 answers

How to change x,y origin of canvas to bottom left and flip the y coordinates?

I have a bunch of data points that I would like to two-way bind to points on a canvas. The points assume larger y values are reflected in an upwards direction like most math graphs. How do I change the x,y origin of the canvas to the bottom left…
David Smith
  • 411
  • 2
  • 5
  • 12
15
votes
4 answers

Drawing Library for Ruby

I am trying to code a flowchart generator for a language using Ruby. I wanted to know if there were any libraries that I could use to draw various shapes for the various flowchart elements and write out text to those shapes. I would really prefer…
Pascal
  • 4,127
  • 8
  • 33
  • 29
15
votes
3 answers

How do I calculate a four colour gradient?

If I have four colours (A, B, C & D) on four corners of a square and I want to fill that square with a gradient that blends nicely between the four colours how would I calculate the colour of the point E? The closer E is to any of the other points,…
Roland Rabien
  • 8,750
  • 7
  • 50
  • 67