A tag for questions about methods of displaying graphical data or images.
Questions tagged [draw]
3541 questions
684
votes
30 answers
Android Drawing Separator/Divider Line in Layout?
I would like to draw a line right in the middle of a layout and use it as a separator of other items like TextView. Is there a good widget for this. I don't really want to use an image as it would be hard to match the other components to it. And I…

Androider
- 21,125
- 36
- 99
- 158
219
votes
2 answers
Android: how to draw a border to a LinearLayout
I have three files. The XML, the draw function and the main Activity.
I have some LinearLayout in my XML file.

SPG
- 6,109
- 14
- 48
- 79
137
votes
8 answers
Measuring text width to be drawn on Canvas ( Android )
Is there a method which returns the width ( in pixels ) of a text to be drawn on an Android canvas using the drawText() method according to the Paint used to draw it?

NioX5199
- 1,772
- 4
- 13
- 12
135
votes
7 answers
Can I draw rectangle in XML?
I wonder if I can draw rectangle in XML.
I know how to draw using drawRect method programmatically.

user1301568
- 2,103
- 4
- 25
- 32
127
votes
13 answers
Drawing a line/path on Google Maps
I've been busy for a long time finding out how to draw a line between two (GPS) points on the map in HelloMapView but with no luck.
Could anyone please tell me how to do so.
Suppose I use the HelloMapView which extends MapView. Do I need to use…

mnish
- 3,877
- 12
- 36
- 54
115
votes
4 answers
OpenCV: draw a rectangle around a region
How can I use OpenCV in Python to draw rectangles around some regions within an image for object detection purposes?

user961627
- 12,379
- 42
- 136
- 210
89
votes
3 answers
Draw solid color triangle using XAML only
Is it possible to draw a filled in triangle using XAML only (not a code behind solution)?
Triangle should be like on the image below to represent sort direction Ascending/Descending along with a sort button on a chart control:
EDIT: The solution,…

sll
- 61,540
- 22
- 104
- 156
77
votes
16 answers
How to use android canvas to draw a Rectangle with only topleft and topright corners round?
I found a function for rectangles with all 4 corners being round, but I want to have just the top 2 corners round. What can I do?
canvas.drawRoundRect(new RectF(0, 100, 100, 300), 6, 6, paint);

virsir
- 15,159
- 25
- 75
- 109
70
votes
15 answers
Draw an X in CSS
I've got a div that looks like a orange square
I'd like to draw a white X in this div somehow so that it looks more like
Anyway to do this in CSS or is it going to be easier to just draw this in Photoshop and use the image as the div background?…

natsuki_2002
- 24,239
- 21
- 46
- 50
62
votes
3 answers
How to draw a circle with animation in android with circle size based on a value
I want to develop a custom component which draws part of the circle based on different values. e.g draw 1/4 cirle, 1/2 circle etc.
The component needs to be animated to display drawing process.
The partial circle is drawn on top of a static…

Leon Li
- 1,183
- 2
- 13
- 14
58
votes
4 answers
How to draw free hand polygon in Google map V2 in Android?
I want to draw a Free Hand Polygon on the Map in Google Map V2.
This task was possible with Overlay Map V1 but Google Map has removed that class from V2. (Per this Google Map V2 has Remove Overlay Class).
Good Example for Google Map V1 to draw free…

Chintan Khetiya
- 15,962
- 9
- 47
- 85
57
votes
2 answers
How to add a simple text label to an image in Go?
Given image.RGBA, coordinates, and a line of text, how do I add a simple label with any plain fixed font? E.g. Face7x13 from font/basicfont.
package main
import (
"image"
"image/color"
"image/png"
"os"
)
func main() {
img :=…

sanmai
- 29,083
- 12
- 64
- 76
55
votes
2 answers
Find and draw the largest contour in opencv on a specific color (Python)
Im trying to get the largest contour of a red book.
I've got a little problem with the code because its getting the contours of the smallest objects (blobs) instead of the largest one and I can't seem to figure out why this is happening
The code I…

Zaptimist
- 553
- 1
- 4
- 5
52
votes
5 answers
clearRect function doesn't clear the canvas
I'm using this script on the body onmousemove function:
function lineDraw() {
// Get the context and the canvas:
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
// Clear the last canvas
…

Carlos Roldán
- 902
- 1
- 9
- 19
50
votes
4 answers
How to draw in JPanel? (Swing/graphics Java)
I'm working on a project in which I am trying to make a paint program.
So far I've used Netbeans to create a GUI and set up the program.
As of right now I am able to call all the coordinated necessary to draw inside it but I am very confused with…

Nick R
- 543
- 2
- 6
- 13