vector-graphics

Shapes combination in Java?

☆樱花仙子☆ 提交于 2019-12-02 05:00:18
Does java Shape interface contract and library routines allow combining multiple shapes into one object extending Shape interface? For example, may I define class Flower which will consist of several ovals for petals and core? Or the Shape supposes only one continuous outline? If so then is there any class in Java for holding multiple shapes, may be some class for vectorized graphics? To manipulate shapes in Java like you're describing, you want to use the Area class, which has these operations. Just convert a Shape to an Area with new Area(Shape) . Here is my attempt - using a rotate

How can I create EPS files in C#?

↘锁芯ラ 提交于 2019-12-01 17:57:54
How can I create EPS files in C#? Are there any opensource libraries available or do I have to resort to the spec and do it by hand? Rune Grimstad You can use the same principle as I suggested in the HTML to Postscript question here: html-to-postscript-conversion It is clumsy to set up, but once it is done it works quite well. If you don't have a printer driver that creates EPS files you can download some of the freeware pdf creator printer drivers. I believe some of these allow you to create EPS files as well. The cairo library http://www.cairographics.org generate all kinds of graphical

How can I create EPS files in C#?

不打扰是莪最后的温柔 提交于 2019-12-01 17:46:33
问题 How can I create EPS files in C#? Are there any opensource libraries available or do I have to resort to the spec and do it by hand? 回答1: You can use the same principle as I suggested in the HTML to Postscript question here: html-to-postscript-conversion It is clumsy to set up, but once it is done it works quite well. If you don't have a printer driver that creates EPS files you can download some of the freeware pdf creator printer drivers. I believe some of these allow you to create EPS

ConstraintLayout relative to ImageView dimensions

孤人 提交于 2019-12-01 11:48:37
I'm currently developing a small Android application and use the new ConstraintLayout. I have an ImageView which contains a vector graphic image which is supposed to take the maximum space available with respect to its aspect ratio. I got this to work with the following code: <ImageView android:id="@+id/imageView" android:layout_width="0dp" android:layout_height="0dp" android:layout_margin="@dimen/margin" android:src="@drawable/image" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout

ConstraintLayout relative to ImageView dimensions

情到浓时终转凉″ 提交于 2019-12-01 10:48:59
问题 I'm currently developing a small Android application and use the new ConstraintLayout. I have an ImageView which contains a vector graphic image which is supposed to take the maximum space available with respect to its aspect ratio. I got this to work with the following code: <ImageView android:id="@+id/imageView" android:layout_width="0dp" android:layout_height="0dp" android:layout_margin="@dimen/margin" android:src="@drawable/image" app:layout_constraintBottom_toBottomOf="parent" app:layout

Having a matrix MxN of integers how to group them into polygons with boost geometry?

无人久伴 提交于 2019-12-01 10:44:05
We have a matrix of given integers (any from 1 to INT_MAX) like 1 2 3 1 3 3 1 3 3 100 2 1 We want to create polygons with same colors for each unique int in matrix so our polygons would have coords/groupings like shown here. and we could generate image like this: Which *(because of vectirisation that was performed would scale to such size like): (sorry for crappy drawings) Is it possible and how to do such thing with boost geometry? Update: So @sehe sad: I'd simply let Boost Geometry do most of the work. so I created this pixel by pixel class aeria grower using purely Boost.Geometry, compiles,

Can I get vector data back out out of a Graphics object?

时光怂恿深爱的人放手 提交于 2019-12-01 09:37:59
In the Flash 10 player, suppose I've loaded a Sprite that's just a dozen random lines. Is there any way to inspect that Sprite's graphics object and find out the positions of those lines? Currently I have a crazy work around where I draw the lines to a bitmap and inspect the bitmap, but this is crude and expensive. No and yes. There's no especially convenient way, but it is possible. Check out Claus Wahlers blog post on the subject. It's a great read. 来源: https://stackoverflow.com/questions/1479304/can-i-get-vector-data-back-out-out-of-a-graphics-object

Given two points and two vectors, find point of intersection [duplicate]

无人久伴 提交于 2019-12-01 08:57:28
Possible Duplicate: How do you detect where two line segments intersect? Given two points a and b plus two vectors v and u I want to find a third point c , which is the point of intersection in the following manner: vector2 intersection(vector2 a, vector2 v, vector2 b, vector2 u) { float r, s; a + r * v = b + s * u; r * v - s * u = b - a r * v.x - s * u.x = b.x - a.x r * v.y - s * u.y = b.y - a.y } Is there any other way than using gaussian elimination to solve this system? Or is this the best (or at least an acceptable) way to handle this? EDIT : Definition of vector2 typedef union vector2 {

Can I get vector data back out out of a Graphics object?

岁酱吖の 提交于 2019-12-01 08:11:02
问题 In the Flash 10 player, suppose I've loaded a Sprite that's just a dozen random lines. Is there any way to inspect that Sprite's graphics object and find out the positions of those lines? Currently I have a crazy work around where I draw the lines to a bitmap and inspect the bitmap, but this is crude and expensive. 回答1: No and yes. There's no especially convenient way, but it is possible. Check out Claus Wahlers blog post on the subject. It's a great read. 来源: https://stackoverflow.com

Visualize vector graphics in Java, which library?

假装没事ソ 提交于 2019-12-01 06:39:20
问题 I need to visualize a large vector graphic. It's a map of roads, the roads are just lines. Is there a library for that? It would be nice if that library had support for zoom-in/zoom-out and would be easy to extend. E.g. to implement selection of roads or some nice mouse-over effects. The licence should permit usage in a commercial project. Thanks, Philip Edit: Is there a reason not to go with Graphics2D or SWT Graphics? (The project is on SWT and doesn't involve any SVGs.) 回答1: Have a look at