Questions tagged [vector-graphics]

Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon(s), which are all based on mathematical equations, to represent images in computer graphics. Images are drawn at run-time from the information stored, and so vector images do not get distorted after zoom/resize etc.

Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon(s), which are all based on mathematical equations, to represent images in computer graphics. Images are drawn at run-time from the information stored, and so vector images do not get distorted after zoom/resize etc.

Vector graphics formats are complementary to raster graphics, which is the representation of images as an array of pixels, as is typically used for the representation of photographic images. Vector graphics are stored as mathematical expressions as opposed to bit mapped graphics which are stored as a series of mapped 'dots', also known as pixels (Picture cells).

An example of a vector image format is the Scalable Vector Graphics (SVG) format. There are many other vector images formats available.

1140 questions
760
votes
19 answers

Do I use , , or for SVG files?
Should I use , , or for loading SVG files into a page in a way similar to loading a jpg, gif or png? What is the code for each to ensure it works as well as possible? (I'm seeing references to including the mimetype or pointing…
artlung
  • 33,305
  • 16
  • 69
  • 121
216
votes
18 answers

Change fill color on vector asset in Android Studio

Android Studio now supports vector assets on 21+ and will generate pngs for lower versions at compile time. I have a vector asset (from the Material Icons) that I want to change the fill color. This works on 21+, but the generated pngs do not…
192
votes
6 answers

How do vector images work in Xcode (i.e. pdf files)?

How does vector support work in Xcode 6? When I try resizing an image, it looks jagged, what gives?
Senseful
  • 86,719
  • 67
  • 308
  • 465
126
votes
15 answers

SVG rounded corner

I have the following SVG:
Danis
  • 1,978
  • 3
  • 16
  • 27
107
votes
3 answers

How to set a stroke-width:1 on only certain sides of SVG shapes?

Setting a stroke-width: 1 on a element in SVG places a stroke on every side of the rectangle. How does one place a stroke width on only three sides of an SVG rectangle?
user782860
  • 2,689
  • 5
  • 18
  • 15
72
votes
7 answers

Xcode 6 allows VECTOR image assets... how to use them?

I was fiddling with Xcode 6 vs images assets when I noticed something very interesting: we now can specify vector images in them (go see in the Utilities pane after selecting Images.xcassets). I tried a small app (containing a big UIImageView) with…
Jean Le Moignan
  • 22,158
  • 3
  • 31
  • 37
71
votes
4 answers

Getting R plots into LaTeX?

I'm a newbie to both R and LaTeX and have just recently found how to plot a standard time series graph using R and save it as a png image. What I'm worried about is that saving it as an image and then embedding it into LaTeX is going to scale it and…
agentofuser
  • 8,987
  • 11
  • 54
  • 85
71
votes
4 answers

Drawing SVG in .NET/C#?

I'd like to generate an SVG file using C#. I already have code to draw them in PNG and EMF formats (using framework's standard class System.Drawing.Imaging.Metafile and ZedGraph). What could you recommend to do to adapt that code to SVG? Preferably…
liori
  • 40,917
  • 13
  • 78
  • 105
70
votes
6 answers

SVG to Android Shape

I'm wondering how vector drawing in Android with the Shape class may resemble another vector drawing standard. Since Shape is a Drawable, and Drawables are usually defined as XML, it sounds a lot like the vector drawing commands in SVG. My question…
Buggieboy
  • 4,636
  • 4
  • 55
  • 79
64
votes
1 answer

dojox.gfx bounding box for Text and Group nodes

The documentation for getBoundingBox() in dojo says: Returns a bounding box of a shape. A text shape is a point-based object, so it doesn't define a bounding box. I don't get it. Any sane implementation of vector graphics for the web includes…
Elazar Leibovich
  • 32,750
  • 33
  • 122
  • 169
63
votes
6 answers

Rendering SVG with OpenGL (and OpenGL ES)

I am currently investigating the possibility of rendering vector graphics from an SVG file using OpenGL and OpenGL ES. I intend to target Windows and Android. My ideal solution would be to have a minimal C library that generates a polygon…
Matt Esch
  • 22,661
  • 8
  • 53
  • 51
56
votes
5 answers

Finding the centroid of a polygon?

To get the center, I have tried, for each vertex, to add to the total, divide by the number of vertices. I've also tried to find the topmost, bottommost -> get midpoint... find leftmost, rightmost, find the midpoint. Both of these did not return the…
jmasterx
  • 52,639
  • 96
  • 311
  • 557
51
votes
9 answers

How to change color of vector drawable path on button click

With the new android support update, vector drawables get backward compatibility. I have a vector image with various paths. I want the color of the paths to change on click of a button or programmatically based on an input value. Is it possible to…
suku
  • 10,507
  • 16
  • 75
  • 120
47
votes
5 answers

HTML5 Canvas Vector Graphics?

Please tell me what libraries for drawing and handling of vector graphics within HTML5 Canvas do you know? Thank you!!!
Edward83
  • 6,664
  • 14
  • 74
  • 102
47
votes
4 answers

HTML Emails: fallback for mso conditional?

UPDATE 2023: This question was originally asked in 2013 - the landscape and supported technologies have changed greatly in that time. The accepted answer is functional and effective for legacy clients, but Frank Hagenson's answer is most likely to…
CodeMoose
  • 2,964
  • 4
  • 31
  • 56
1
2 3
75 76