How to scale grouped polygons?
Posted: Thu Mar 18, 2010 8:37 pm
I found I can import and translate vector graphics from another file format and use that as a thumbnail for a project manager application I am creating.
So basically the original application is a vector based animation program. I can read in the files and extract the vector data, convert it to RR "polygons" and redraw it to the screen as a group of polygon shapes. However what I am doing is converting to SVG and then converting SVG to RR. This works well for my project since I want the whole thing to be XML anyway.
Here's the issue:
The imported vector polygon "group" can't be scaled after the fact. I can ungroup until the individual shapes are editable but then I can't seem to "scale" all the items uniformly. Once they are grouped and I change the dimensions it only "crops" the area viewable. It doesn't actually scale the group. I am probably doing something wrong or missing something, but I just can't figure it out.
There is no real "scale" information in the file format I am importing, although I could extract and convert some size data based on the file format settings if I have to. It would be tricky and a pain in the arse. Each layer of the file format can have its own scale relative to the entire file. When I convert this vector information to SVG I am just using a scale of "1" which is 100%. However some files are HUGE because the layer is scaled relative the overall size.
What I would like to do is import as polygons and then at the end determine the scale of the group to fit a specific width/height so I can either view that image or use it as a thumbnail or preview at various sizes.
I have thought of "exporting" the vector group to an image inside the application so then it becomes a raster graphic and can be scaled. I will do that if there is not an easier way.
So basically the original application is a vector based animation program. I can read in the files and extract the vector data, convert it to RR "polygons" and redraw it to the screen as a group of polygon shapes. However what I am doing is converting to SVG and then converting SVG to RR. This works well for my project since I want the whole thing to be XML anyway.
Here's the issue:
The imported vector polygon "group" can't be scaled after the fact. I can ungroup until the individual shapes are editable but then I can't seem to "scale" all the items uniformly. Once they are grouped and I change the dimensions it only "crops" the area viewable. It doesn't actually scale the group. I am probably doing something wrong or missing something, but I just can't figure it out.
There is no real "scale" information in the file format I am importing, although I could extract and convert some size data based on the file format settings if I have to. It would be tricky and a pain in the arse. Each layer of the file format can have its own scale relative to the entire file. When I convert this vector information to SVG I am just using a scale of "1" which is 100%. However some files are HUGE because the layer is scaled relative the overall size.
What I would like to do is import as polygons and then at the end determine the scale of the group to fit a specific width/height so I can either view that image or use it as a thumbnail or preview at various sizes.
I have thought of "exporting" the vector group to an image inside the application so then it becomes a raster graphic and can be scaled. I will do that if there is not an easier way.