vector-graphics

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 make it look ugly. Is there a way to make R's plot() function output a vector graphic an...

Is WPF the reason my application is slow?

I am developing an application using WPF. The app runs full screen, and I need it to resize nicely no matter the monitor resolution. The graphic designer has designed beautiful images for the UI buttons, backgrounds, etc. Using an Illustrator plug-in, all the images have been converted to xaml files. I've added all these images into the ...

Generate vector EMF/WMF (Windows Metafile) clipboard content from Qt 4.5

We are moving a large codebase from GDI to QPainter. One thing we used to get on Windows easily was the EMF clipboard format, which enabled customers to manipulate their pasted output in other programs (like Office) in a vector format. It's easy for us to produce bitmaps from Qt into EMF, but that really doesn't give us back the editabi...

2D vector modelling for game development

Making my Asteroids clone (in C) I've rather fallen in love with vector-based entities, but I've simply coded them in as x,y-point arrays. That's been fine for something like Asteroids, but what should I do if I want to make more complex 2D models? I note that there is an awful lot of 3D modelling software out there, as well as ample tu...

What are some of the best ways to plot/draw vector graphics on a HTML page?

I'm trying out some dynamic web page background generation using lines and text. Take a look at my demo at http://74er.net/labs/lines.html (just focus on the yellow line). It's a lame and inefficient method by literally creating a <span> element with 1 X 1 size and a yellow background with the X,Y position based on an ellispe formula....

How to you transform these image togglebuttons into vector togglebuttons?

Hello, I have just implemented these ToggleButtons using ControlTemplates that set the Image content according to IsChecked stated. The images are made in Photoshop, but I want them as WPF vectors. The buttons look like these when IsChecked=False: And when IsChecked=True I just replace the Image with another PNG: I've designed th...

Help with vectors

I'm trying to make a game where the bullets can fly in any direction. I would ike to make them vectors with a direction and magnitude to make them go the direction. I'm just not sure how to implement this? Thanks ...

Is DxScene the "WPF for Delphi"? Anyone used it?

I am playing with DxScene and VxScene: http://www.ksdev.com/dxscene/index.html It looks very nice and powerful: 3d accelerated vector graphics, cross plaform, nice effects, many 2d GUI controls (vector based), good scaling, transparency, rotating (x, y, z), 3d models, etc. Even with many effects, the CPU stays very low (0%)! http://www....

Can the iPhone render vector graphics files directly? What formats are supported?

Is it possible to render a vector image file on the iPhone in the same way that one can render a bitmap (png, jpeg) file? I have tried eps and pdf files, neither of which seems to work – they are displayed correctly in Interface Builder but do not display when run. The console outputs a message along the lines of 'Could not load the "i...

RaphaëlJS, dojo.gfx, JSXgraph comparison

I'm going to build a simple math graph for a browser application. Therefore all the JS-Vector Libraries might work out well. But I want to know about any experiences you collected using those. For me a basic feature is binding events to paths and points as well as animating paths. Additionally I am thinking how they are mastering the fu...

How well are SVG filter elements defined?

We are considering using SVG filters as part of our toolchain, serving the SVG to browsers capable of supporting it, while serving pre-rendered PNGs to other. One problem we noticed is that the rendering of the filter chains seems to be very inconsistent across renderers. When looking at the "filters01" example from the SVG specificatio...

Draw 2 parallel lines

How can I calculate the points to draw 2 parallel lines. I know the start and end points for the centre of the parallel lines. To makes thing a little bit harder, it needs to support straight and Bezier curved lines. ...

How can I draw the control points of a Bézier Path in Java?

I have created a Path of Bézier curves and it works fine to draw the path. But I don't know How I can draw the Control Points together with the Path. Is that possible or do I have to keep track of them in another datastructure? Update: The reason to why I want to draw the control points, is that I will let the user to edit the curves us...

How do I find hash value of a 3D vector ?

I am trying to perform broad-phase collision detection with a fixed-grid size approach. Thus, for each entity's position: (x,y,z) (each of type float), I need to find which cell does the entity lie in. I then intend to store all the cells in a hash-table and then iterate through to report (if any) collisions. So, here is what I am doing...

Bezier Algoritms - an algorithm for inserting points

I'm looking for an algorithm to insert a new control point on a bezier curve, without deforming: did anybody knows a library or reference for bezier algorithms (insertion, optimize, de Casteljau ...) ...

ImageMagick vs. Cairo on Vector Graphics rasterization

I am working on a project that needs rasterizing of drawings into image files. I have already got it work using GDI+. Wanting to create a portable solution, I am also looking into other solutions and found two - cairo and imagemagick. I am new to both, but it seems that ImageMagick can do almost all the stuff - drawing lines, arcs, circl...

How does an Android/iPhone device implement text-zooming?

Simple question - how is text-zooming implemented on an Android/iPhone device? Do they pre-compute frequently used bitmaps of a font and replace the text as the scale changes? Or do they extract the contours from the font files and render the text as vector graphics? ...

What is the best way of converting SVG file into Raphaël?

I'm trying to open simple vector graphics using Raphaël JS and I can't find any converter that would do the whole job. Is there any way to transfer vector graphics (SVG or anything from Illustrator, Inkscape) into Raphaël's JavaScript? ...

Transform shape built of contour splines to simple polygons

I've dumped glyphs from truetype file so I can play with them. They have shape contours that consist from quadratic bezier curves and lines. I want to output triangles for such shapes so I can visualize them for the user. Traditionally I might use libfreetype or scan-rasterise this kind of contours. But I want to produce extruded 3D mes...

Finding the centroid of a polygon?

I have tried: for each vertex, add to total, divide by number of verities to get center. I'v also tried: Find the topmost, bottommost -> get midpoint... find leftmost, rightmost, find midpoint. Both of these did not return the perfect center because I'm relying on the center to scale a polygon. I want to scale my polygons so I may put...