vector-graphics

Is there an efficient way to store 2D plots as a vector graphic in python?

橙三吉。 提交于 2019-12-21 06:17:46
问题 I'm currently trying to store python plots as vector graphics to improve their appearance in a latex document. For 1D plots this works quite fine: import numpy as np import matplotlib as mpl mpl.use('svg') new_rc_params = { "font.family": 'Times', "font.size": 12, "font.serif": [], "svg.fonttype": 'none'} #to store text as text, not as path mpl.rcParams.update(new_rc_params) import matplotlib.pyplot as plt x = np.linspace(-.5, .5, 1024) plt.figure() plt.plot(x, x) plt.title('\$x = y\$') plt

Export a vector shape created in flash to svg

北城余情 提交于 2019-12-21 05:05:26
问题 Is it possible to export a vector shape created in flash to an svg file for example? Or any other vector format? If it is possible - how can I do that? Are there any libraries or examples (or both)? 回答1: Although it's a little late, you may also want to check out flash2svg by David Belias - it's an MXP extension for Flash that can export Flash vectors to SVG natively. It's compatible with Flash CS4 & CS5, although no information is immediately available regarding compatibility with other

What libraries are available to help create 2D Java games for phones?

笑着哭i 提交于 2019-12-21 02:37:19
问题 I want to begin developing 2D Java games for phones (on J2ME) therefore I'd like to know if any libraries or "engines" exist to help out in the various graphical tasks: Drawing text with pixel fonts? Drawing bitmaps for sprites with multiple frames like animated GIFs? Drawing graphics with code, lines, beziers, flood-filling and gradient fills? Ordering / layering of sprites? Or maybe a great book exists, that gives you enough code samples to get off the ground quickly? 回答1: I didn't use it

HOWTO draw circles, arcs and vector graphics in SDL?

只愿长相守 提交于 2019-12-20 20:46:29
问题 (I'm using SDL2) SDL is a relatively small library for "low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D" It's used for game development and, in my case, as simple audio visual output and mouse+keyboard input. It's not a "toolkit" like GTK, Qt, wxWindows, etc. But it is cross-platform. But the only way I can find to draw a shape is with the line, rect and pixel functions. Apart from using trig or the "equation of a circle", how could I draw a

How can we tile a vector image?

强颜欢笑 提交于 2019-12-20 18:45:38
问题 With the support library now fully supporting vector images, I'm trying to switch to vector images as much as I can in my app. An issue I'm running into is that it seems impossible to repeat them. With bitmap images the following xml could be used: <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/repeat_me" android:tileMode="repeat" /> This does not work, as vector images can not be used in bitmaps: https://code.google.com/p/android/issues/detail?id

Direction of two points

半腔热情 提交于 2019-12-20 16:25:02
问题 Some high school math concept has been forgotten, so I ask here. If I have two points p1(x1,y1) , p2(x2,y2) , the direction is P1-->p2 , that's p1 points to p2 . To represent this direction by vector, is it Vector(x2-x1,y2-y1) or Vector(x1-x2, y1-y2) ? By the way, what is the purpose to normalize a vector? 回答1: Answer 1: it is Vector(x2-x1,y2-y1) Answer 2: Normalizing means to scale the vector so that its length is 1. It is a useful operation in many computations, for example, normal vectors

Direction of two points

蹲街弑〆低调 提交于 2019-12-20 16:23:53
问题 Some high school math concept has been forgotten, so I ask here. If I have two points p1(x1,y1) , p2(x2,y2) , the direction is P1-->p2 , that's p1 points to p2 . To represent this direction by vector, is it Vector(x2-x1,y2-y1) or Vector(x1-x2, y1-y2) ? By the way, what is the purpose to normalize a vector? 回答1: Answer 1: it is Vector(x2-x1,y2-y1) Answer 2: Normalizing means to scale the vector so that its length is 1. It is a useful operation in many computations, for example, normal vectors

Direction of two points

主宰稳场 提交于 2019-12-20 16:23:05
问题 Some high school math concept has been forgotten, so I ask here. If I have two points p1(x1,y1) , p2(x2,y2) , the direction is P1-->p2 , that's p1 points to p2 . To represent this direction by vector, is it Vector(x2-x1,y2-y1) or Vector(x1-x2, y1-y2) ? By the way, what is the purpose to normalize a vector? 回答1: Answer 1: it is Vector(x2-x1,y2-y1) Answer 2: Normalizing means to scale the vector so that its length is 1. It is a useful operation in many computations, for example, normal vectors

Using vector graphics in iPhone games

£可爱£侵袭症+ 提交于 2019-12-20 10:26:29
问题 I'm Flash/AS3 developer and I'm wondering how some iPhone developers use vector assets in their games. For example, "Lil' Pirates": this games looks like vector-based, it's zooming and unzooming easily, but I can't get any information about using vector assets at iOS. 回答1: Quartz 2D is a pretty lightweight framework for vector based graphics. It's very well documented... Quartz Documentation In particular I'd pay particular notice to layering and performance... Quartz Layering and Performance

Rendering SVG with OpenGL (and OpenGL ES)

旧时模样 提交于 2019-12-20 07:59:34
问题 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 triangulation from a given SVG file. This would then generate standard OpenGL or OpenGL ES calls, and use a display list or vbo for optimization when redrawing. I would simply draw a display list to draw the vector image after translating and rotating,