A tag for questions about methods of displaying graphical data or images.
Questions tagged [draw]
3541 questions
46
votes
5 answers
Write text on an image in C#
I have the following problem. I want to make some graphics in bitmap image like bond form
i can write a text in image
but i will write more text in various positions
Bitmap a = new Bitmap(@"path\picture.bmp");
using(Graphics g =…

Mr Alemi
- 830
- 1
- 10
- 21
43
votes
4 answers
How can I center Graphics.drawString() in Java?
I'm currently working on the menu system for my Java game, and I wonder how I can center the text from Graphics.drawString(), so that if I want to draw a text whose center point is at X: 50 and Y: 50, and the text is 30 pixels wide and 10 pixels…

Daniel Kvist
- 3,032
- 5
- 26
- 51
42
votes
1 answer
How to make any view to draw to canvas?
I have a short question:
Suppose I have a (mutable) bitmap that I need to modify (add images, texts, etc...) .
Instead of messing around with many special classes for drawing to the canvas (paint, canvas, matrices and so on), I was thinking why not…

android developer
- 114,585
- 152
- 739
- 1,270
41
votes
5 answers
Android: Drawing a canvas to an ImageView
I'm new to android programming and what I'm trying to figure out is this;
In my layout i have a TextView, ImageView, and Button, all on a vertically oriented LinearLayout.
I want to be able to dynamically draw circles in the ImageView, without…

sil
- 463
- 2
- 5
- 5
36
votes
5 answers
Android: looking for a drawArc() method with inner & outer radius
I have the following custom view:
This I have achieved by using the Canvas' drawArc() method. However, with this drawArc() method I cannot limit the arc's inner radius.
What I'd like to have is something like this:
where there is only an outer…

znq
- 44,613
- 41
- 116
- 144
33
votes
6 answers
Draw bold/italic text with PIL?
How to draw bold/italic text with PIL? ImageFont.truetype(file, size) has an option to specify font size only.

jack
- 17,261
- 37
- 100
- 125
32
votes
5 answers
Draw a rectangle in Golang?
I want to draw a mailing label with some rectangles, barcodes, and then finally generate a PNG/PDF file.
Is there is a better way to draw a shape in Go other than to do it with primitives - pixel by pixel?

Fakeer
- 985
- 1
- 13
- 29
29
votes
4 answers
Android canvas draw line - make the line thicker
This seems like it should be somewhat trivial, however in my android app, I am using canvas to draw a series of lines that are connected together. For some reason my lines are very very faint and thin. I was wondering how can I make my lines…

user859348
- 359
- 1
- 3
- 13
29
votes
1 answer
NetworkX node attribute drawing
Im using networkx for visualization. I see when I use the function
draw_networkx_edge_labels
I can retrieve the labels for edges.
I want to print the attribute on node ( instead of the label).. try everything almost . still stuck. If i have 5…

SDR
- 301
- 1
- 3
- 7
29
votes
3 answers
Drawing a rounded hollow thumb over arc
I want to create a rounded graph that will display a range of values from my app. The values can be classified to 3 categories: low, mid, high - that are represented by 3 colors: blue, green and red (respectively).
Above this range, I want to show…

limlim
- 3,115
- 2
- 34
- 46
28
votes
3 answers
How to speed up python's 'turtle' function and stop it freezing at the end
I have written a turtle program in python, but there are two problems.
It goes way too slow for larger numbers, I was wonder how I can speed up turtle.
It freezes after it finishes and when clicked on, says 'not responding'
This is my code so…

clickonMe
- 521
- 2
- 6
- 12
28
votes
8 answers
How to draw a gradient line (fading in/out) with Core Graphics/iPhone?
I know how to draw a simple line:
CGContextSetRGBStrokeColor(context, 1.0, 1.0, 1.0, 1.0);
CGContextMoveToPoint(context, x, y);
CGContextAddLineToPoint(context, x2, y2);
CGContextStrokePath(context);
And I know how to do a gradient rectangle,…

Walchy
- 1,150
- 3
- 11
- 18
27
votes
5 answers
Draw lines between 2 elements in html page
i need to draw lines between 2 element on html page
the results should be like this:
http://img2.timg.co.il/forums/1_173873919.JPG
i wondered what the best way do this
using canvas and html5
using background image.
make by ajax dynamic the image
i…

24sharon
- 1,859
- 7
- 40
- 65
27
votes
4 answers
Draw equidistant points on a spiral
I need an algorithm to calculate the distribution of points on a spiral path.
The input parameters of this algorithm should be:
Width of the loop (distance from the innermost loop)
Fixed distance between the points
The number of points to draw
The…

Giulio Pierucci
- 281
- 1
- 3
- 5
25
votes
9 answers
How do I draw an arrowhead (in Android)?
I'm fairly new to Android and have been toying around with Canvas. I'm attempting to draw an arrow but I'm only having luck with drawing the shaft, none of the arrowhead is working.
I have searched a bit and found a Java example, but Android doesn't…

StartingGroovy
- 2,802
- 9
- 47
- 66