Questions tagged [draw]

A tag for questions about methods of displaying graphical data or images.

3343 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
  • 20,243
  • 32
  • 95
  • 154
209
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
  • 5,691
  • 11
  • 42
  • 72
135
votes
7 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,752
  • 4
  • 13
  • 12
126
votes
6 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
  • 1,953
  • 4
  • 24
  • 30
121
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,695
  • 11
  • 34
  • 53
85
votes
3 answers

How to draw a rectangle around a region of interest in python

I'm having trouble with import cv in my python code. My issue is I need to draw a rectangle around regions of interest in an image. How can this be done in python? I'm doing object detection and would like to draw a rectangle around the objects I…
user961627
  • 11,059
  • 35
  • 119
  • 202
80
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
  • 56,967
  • 21
  • 100
  • 149
67
votes
15 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
  • 14,359
  • 23
  • 71
  • 108
60
votes
14 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
  • 19,933
  • 18
  • 42
  • 49
59
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,073
  • 2
  • 11
  • 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,208
  • 9
  • 41
  • 81
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
  • 513
  • 2
  • 6
  • 13
43
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
  • 23,569
  • 11
  • 54
  • 73
43
votes
4 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 …
Juan C. Roldán
  • 726
  • 1
  • 7
  • 16
40
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
  • 106,412
  • 122
  • 641
  • 1,128
1
2 3
99 100