vector-graphics

Draw a parallel line

I have x1,y1 and x2,y2 which forms a line segment. How can I get another line x3,y3 - x4,y4 which is parallel to the first line as in the picture. I can simply add n to x1 and x2 to get a parallel line but it is not what i wanted. I want the lines to be as parallel in the picture. ...

XSL Transform SVG to VML

I don't know anything about VML except that Internet Explorer and other Microsoft products use it and that it is a vector graphics format. Can one use XSLT to transform an SVG document to VML? Or are they too different from one another to make this possible? I know that there exist XSLT documents to transform SVG to XAML. ...

SVG parser for C++? (Free or paid)

Does anybody know of a good SVG parser that puts out an SVG object in C++? I don't mind if it's free or paid. I'm just looking for one that is cleanly architected and adheres very well to the spec. Preferably one that would let me start rendering by just inspecting the structures and passing the info on to Cairo or QT. Thanks! ...

Applying a 2d mesh to a 3d surface

I have a very complex 3d surface I need to apply a 2d mesh to. What I need is something like the Solidworks Wrap tool : http://www.rickyjordan.com/2009/01/the-solidworks-secret-weapon-the-wrap-tool.html Due to the complexity of the 3d surface normal texture UV unwrapping won't work. For instance, if I want to map a O and the 3d surface ...

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 is this: Has anybody created an XSLT transformation, or other mechanism, for converting ...

Streaming the map image like MKMapView does

I'm developing a map application for both iPhone OS and OS X. This uses Core Graphics to render a map, but rendering each frame is too slow to scroll in 60fps, and consumes the battery. So I want to cache the map with rendering the map on bitmap tiles(256x256), but what kind of bitmap should I use? (like CGImage) ...

How do I resize a flat vector icon so that it preserves hard edges?

I recently purchased Drew Wilson's Pictos icon library. It is a library of flat, monochromatic icons for use on the web and elsewhere. The only issue is: they're vectors. I know my way around Illustrator a little bit, but ultimately I want to import these icons into Photoshop CS4 and resize to various dimensions. When I import an icon ...

html font/vector graphics question

what's the best way to present a vector/font in html? ...

Cairo masking - is there something I'm missing?

So I'm trying to set up a mask in Cairo, but can't get it to make any difference. Below I have a simple program based off the one here: http://snipplr.com/view/22584/cairo-hello-world-examble/. I'm setting a completely transparent mask so nothing should be getting drawn, but it doesn't seem to have any effect - the text still gets drawn...

Tool to convert WPF XAML vector icon to Silverlight?

I found some freeware XAML icons that are perfect for my Silverlight project online (http://www.grafile.com/Product_Page.aspx?id=1.36), but these happen to be using WPF XAML, which is not compatible with Silverlight (at least as of version 4). Can anyone recommend a tool for converting from WPF XAML to Silverlight equivalent? Thanks! ...

Convert CAD to raster

Hello, How do printers convert the vectorial CAD graphics to dots in paper? I have a 50mmx50mm with 4095x4095 points "printing" system and I'd like to print some CAD files to it? Should I use the existing printing system? Or convert the CAD file to something my "printer" undertands and if so, how? Thank you ...

How do I paint clouds?

I need an algorithm to paint clouds, or cloud like shapes. Obviously, I wouldn't want them all to be similar. What should I use to generate the relevant series of X,Y coordinates to paint the clouds? I am going to implement this either in SVG or Canvas ...

display vector images in browser

I need to display vector images in the following formats(.eps, .ai, .cdr, .pdf, .cs3, .cs5 ) in major web browsers (IE, firefox, safari, chrome). How do I accomplish the same? I tried searching for java libraries that will convert the vector images to bitmaps but could not find a library that will convert all the formats mentioned abo...

WPF/Silverlight How To Calculate total cubic units/pixels in a control?

I have a scribbale inkpresenter in my silverlight app that I'm using multiple times in different shapes, I want to calculate how much percent of the inkpresenter has been scribbled, My problem is that since the shape of the ink presenter can be circular or poly I don't know how i can get the units/pixels there is available on the scrib...

Help Understanding these equations?

I asked a question regarding Bi linear transformations and received this answer: From that very page you posted, there's a link to the source code. I'll explain the bilinear transformation in http://www.antigrain.com/__code/include/agg_trans_bilinear.h.html The idea here is to find a transformation of the form: output_x = a * input_x...

Advice needed: A programmatic way for creating vector graphics with heavy usage of text.

I need a way for render a tree-like structures, similar to flowcharts. Surprisingly, I can't find(or I'm doing wrong) a suitable tool. First, I looked at SVG. But I couldn't find a way to draw a bounding box around the text without using ECMAScript: I tried to do a simple thing drawing two text surrounded by boxes and linked by a lin...

iphone: interactive vectorial drawing

Hello, I am wondering the best way to have an interactive vector drawing on the iphone. It will be a map which will change depending of actions done on special area of the map. Thanks in advance for your ideas :) ...

drawing multiple rectangles with Cairo graphics

I'm trying to write a Cairo program to black-fill the entire image and then draw another rectangle inside of it a different color. Eventually, I'm going to make this a program that generates a .png of the current time that looks like a digital clock. For now, this is where I'm getting hung up. Here's my code: #include <stdio.h> #includ...

Extracting Width/Height Dimensions from EMF Image Files

I maintain a small Perl library that extracts width/height from images, for people who want that functionality without using a larger, more generalized library. I've been asked if I can support the Windows EMF format. However, I haven't had much luck with my Google-fu in trying to find a good specification of the format, or better yet ex...

Destructive effects for vector drawings in XAML

There are several applications out there that either allow editing vector graphics in some native format and exporting to XAML format or deal directly in XAML but all of which seem to lack in terms of ability to edit drawings through use of destructive effects. What I mean by destructive effects are ones that can be applied to a vector d...