I want to fill some part of the shapes in actionscript, lets say "half of a circle", but unfortunately i could not find any suitable way to do it ?. Any suggestions will be appreciated thanks :)
one solution, in your case you have to draw some Close-region# square and rectangle triangle etc. in your Main region and then you can fill it whole part of the region which you draw. so if you want to fill a part of the region then you must draw a region on your main region then you can fill it so user have a feeling that he has filling a half region.
May This link'll be helpfull the ActionScript Drawing API & Drawing and Filling Partial Circles
Related
Given a sprite sheet with a plain background like this:
I want to take each individual image off this background and create a file for it. I've looked around and had trouble finding information on how to do this - I cant help but feel there is some simple method. Does anyone have any pointers?
Caveat: Not all sprite sheets are the same format/layout, e.g. this one:
It's laid out slightly differently, and this one is even weirder.
So some challenges:
The background of the sprite sheet varies in colour.
Sprites in the sprite sheet vary in size, and that size cannot be specified ahead of time.
Method must generalize (reasonably well) to thousands of sprite sheets.
Appreciate any help.
Taken from: https://www.reddit.com/r/computervision/comments/ej3wgr/extracting_images_from_a_simpleplain_background/
by /u/tzatza
1) detect background color (sample appropriately, say from image edges), one option is with votes in a hashtable (key = r+"-"+g+"-"+b)
2) setup a mask, set all the background pixels to zero in mask within certain color distance of background, set all other mask pixels to 1.
3) optionally: erode the mask once (or twice), then dilate back to remove useless lines.
4) you now have a mask of 0 vs 1, do flood fill on each grouping of 1s to determine the extent of each sprite. Set mask pixels to "2" as you do the flood fill to indicate visited.
5) as you flood fill, track each sprite's min/max x/y and at the end of the flood fill, you have the extents (and a mask) which can be used to crop/store.
I know this goes against Stackoverlow principles of putting in the entire answer, but may I suggest you search for the "Blue Screen Matting" paper by Alvy Ray Smith & Jim Blinn. There's a copy available here.
They have been in the graphics industry for decades and so "know their stuff".
I need help with this : I have Freeform area and shapes in form of circles named from A to G. Some of this points are inside of Freeform area and some of them no. I need macro which will check each of this points - if this point is inside/ outside of freeform area. How can i get result in form of table where in Column A are Names of shapes (circles-points) and in column B result (if point is inside/outside of freeform).
Thanks
Victor
Picture of what I need is here:
There are several ways to do that. Either over calculation of the Angles or by creating a ray trough the point and find the intersections To the polygons. If the count are even, it's inside; if it's odd it's outside. Those algorithms are not that trivial and numerical a challenge. Here are some links (They have vb6/vba source):
Paul Bourke Point inside Polygon
VB-Helper Point inside Polygon
If it has not that exact you may draw the points in a picturebox and determine the background color.
To find more search the web for "points inside polygon".
In MS Excel, I applied conditional formatting to a cell A1 so that it's color changes from blue at value 0 and red at value 100. I copied that cell and pasted it as linked picture(I) specially.(Paste Special). The color of the rectangle picture now changes if value in original cell is changed. The problem is, the shape is only rectangular, it can be converted into square and diamond shape at best.If same rectangle can be transformed into different shapes(maybe by adding extra anchor on rectangle shape), a heat map can be created easily. Please share your insights about this thing if there is a way.
Following pictures may help understand the problem:
[Example][1]
If you want a heat map, please consider using a CHART not gazillions of picture objects, colored/placed/rotated/etc to ... mimic a chart.
First, google anything about "surface chart" in Excel, see how it looks in Excel, whatever. Just see it and think about it so you can compare it to your current approach.
You will observe some things, like:
it's 3D
it has just a few layers/colors
etc.
But really, all of them can be solved. Probably easier than your current approach.
you can easily turn off both axes and you can rotate it so the camera is totally straight top-down - then it looks flat as paper and noone can see it as 3D anymore
you can add more layers, you can set each of them to specific colors
etc.
Some resources:
multiple colors in surface chart
how to change rotation of 3d chart
geesh, I just found even a whole article/tutorial dedicated to creating heat map charts.
Please, read that last link and I'm pretty sure you will want to use that approach instead of doing picture puzzles.
I was trying to make my own function to reposition data labels on line chart so they'll be in their best fit.
What does it mean best fit?
The data label wont be above the line itself (I took the higher angle of the point and put the data label in higher-angle/2 - so it will be in the middle of the higher angle) - I succeed to get the higher-angle but didn't succeed to get the position on graph (in pixels, relatively)
After u put the data label in the middle of the higher angle, you need to check with the other seriescollections, that the data label is not above one of other seriescollections line... - didn't reach this part.
and still I am not sure that's it...
Is anybody got something prepared? or someone wants to help me with it?
It is way over my level right now...
"Best fit" is a setting unique to pie chart data labels.
You have the option of positioning a line chart's data labels centered (directly on a point), as well as above, below, left of, and right of the point. You can also position the data label anywhere by changing the .left and .top properties of the label. Left and Top are in points with respect to the top left corner of the chart, so you will have to brush up on your algebra to fine tune label positioning.
As with all else involving charts, Keep It Simple is sound advice. Do you need to label everything, or can you get away with a few key labels?
So after some tries, I decided to ditch the idea since this's way too complicated for me.
What I can say is that I ditch it after I stepped up a little bit.
I could find the best position for each label only when there's one line.
I achieved it by calculating the bigger arc (assumed each point is the middle of a circle), and than put it in the middle of that arc.
to do it when you have more than one line, you have to consider the position of the points of the other line/s. Therefore it becomes much more complicated and this is the reason I decided to ditch it.
I want to draw something like a pie chart segment filled with a certain color.
I know we can draw a circle using the Me.Circle function in a PictureBox to get a filled circle. However, when you add the start and end the circle becomes just a single lined arc.
Can anyone offer me a solution?
It is possible.
Check http://www.wiley.com/college/mckeown/0471418625/ppt/ch11.ppt