Making Vector Graphic Grayscale?
Oct 5, 2009I have a image of a cartoon (it is vector graphic created in Flash not bitmap!) and I want to change it
into grayscale, how do I do that?
I have a image of a cartoon (it is vector graphic created in Flash not bitmap!) and I want to change it
into grayscale, how do I do that?
I have drawn a few buttons in Illustrator CS4 and copied them into Flash (AS3 document). Everything as far as button functionality is working fine, (rollovers, clicks and whatnot), my problem is (hopefully) quite simple to fix, I just can't find how to do so! When I hover over the buttons, the solid parts of the vector (the parts with fill colour) are selectable, however the parts with transparent fills are not (e.g. the space between two letters, or the negative space of an 'O'). What I want is for it to be selectable as if it was a box shape, but keep the transparencies there.I don't know if the problem is resolved in Illustrator or Flash, if anyone knows please reply! I've tried a few things in Illustrator already, such as drawing transparent bounding boxes around the graphics, however the same problem persists.
View 5 RepliesI have displayobject with vector and image data And I am trying to scale it in order to get big jpeg out of it with JPGEncoder.The thing is that once I am resample it using the Bitmap class (Matrix) and with draw method it's getting pixelated.How can I take a container with vector graphic and bitmap image and rescale it to bitmapdata without getting things pixled.This is the displayobject:The image in the center is high resolution image which I resize and all the other elements are vector graphic.Since the image is high resolution and all the other elements are vectors if I just call the scaleX property of the displayobkect it increase the contenier size and it all looks very good. But if I want to take a bitmap data out of it it's look terrible, The fonts getting pixelated and even the photo.I will like to know it there is a way to do it without getting things pixelated.
View 0 RepliesIs there seriously no way to convert a vector graphic into a motion guide for Flash? Are the Pen and Pencil tools really the only way to define the path for a motion tween? I have CS3 (Flash, Illustrator, PhotoShop). I just got the trial version of CS5. I have a subscription to[url]... I have searched these forums and the internet in general for hours.
All I want to do is move a symbol around in a circle, but my pen/pencil skills are not sufficient to create a circle. Editing the CS5 motion path has proved exceedingly tedious and not round. There's a perfectly good circle tool in all four applications...
If I have a rectangle which has a fill of blue and stroke of orange how can I change the stroke to black and the fill to red using actioncript.
When I use the following code it changes the entire rectangle to 0x008000 (green). Either the fill is covering the stroke or it is changing both the fill and stroke to 0x008000 (green).
var myColor:ColorTransform = myRectangle.transform.colorTransform;
savedColor = myRectangle.transform.colorTransform;
myColor.color = 0x008000;
[Code]....
So I just got CS4 and the all Im trying to do is a tween with a vector graphic expanding as it moves down but it cant handle it, it plays out all laggy and its the same when its published. Can any of you guys help?
Just as a note CS3 does the same job just fine I dont know whats wrong with it I have played around with the publish settings and my frame rate is set to 25fps.
To test it I did the same thing with just a vector square on a new file and it reacts the same way!
Theres no actionscript going on just simple stuff that should work but fine but doesnt
Code:
var myArrow:ArrowMovieClip = new ArrowMovieClip();
var vectorDisplayObject:DisplayObject = stage.addChild( myArrow );
I used the code above to create an instance of an arrow graphic that I made using the line tool (the graphic is embedded in a movie clip). I now want to add different colored fills and different stroke sizes and colors using code. Is it possible to do this with pre-drawn vector graphic objects, or is it only doable if I create the arrow with code using things like lineTo and curveTo?
I am trying to make a graphic flash at regular intervals that I can control via AS3. I was trying to do this with tweening but I am getting bogged down because for some reason when I try to get the darn thing to loop it just won't do it. I want to be able to change the rate at which the graphic flashes on and off the screen within the constraints of the frames per second so that I can simulate a light and sound machine. Ideally I'd like to be able program the starting frequency of the flashing light (say 15hz) and the ending frequency (5hz for example) and the program would gradually shift the frequency from one to the other over the course of the graphic. For right now I would love it if I could just programmaticly set the frequency of the flashing graphic within the limitations of the frames per second.
View 14 RepliesI have created some code that creates a blue circle of random size on the stage, and startmoving it in a random direction, at a random speed.
But I'd like to create this as a static class, so that I can just import into a banner and make multiple instances appear at a time, but my limited knowledge doesn't allow me to
Here is my code:
Code:
var child:Shape = new Shape()
var childSpeedX:Number = Math.random()
var childSpeedY:Number = Math.random()
var childDirectionX:Number = Math.random()
[Code]....
I'm trying to make a visual novel in flash, I have created the UI and the characters, but I don't know what could be the best approach as how to load the dialog and how to save them. I've been thinking about external files, but I don't know what could be the best type of files to do so. Also, when I load the game I want it to continue in the same scene and with the same variable values (obviously) is there a way where you can save all of them (like an image of the game).
View 2 RepliesI'm looking for a way to take SVG path info (basically a string of coordinates) and dynamically draw it with Actionscript. Icing on the cake would be if those shapes could detect mouse events to trigger JS and dynamically change their appearance (fill, stroke, etc...).
I'm currently trying something similar to this ([URL]) using SVG but it's just too slow in IE. I've also tried Google's SVG Web ([URL]) which basically does exactly what I'm looking for (it converts SVG to Flash in IE) but again, it's sloooooow - which is why I'm considering doing the whole shebang in Flash.
I tried making a multidimensional Vector that was populated by other Vectors that are populated by Strings.
ActionScript Code:
var myVect:Vector = new Vector.<Vector>;
for (i = 0; i < 10; i++)
{
myVect[i] = new Vector.<String>;
}
This is giving me a Type Coercion error, even though the Vectors all have the correct object types in them. Is the error because I'm putting a Vector full of Strings into another Vector?Also, I'm working with large amounts of data, so using Arrays aren't an option because I need all the performance I can get.
1. Is there a function in AS3 player 9 or 10 to greyscale a Loader.load()ed jpg image? I don't even think it is feasible to manually calculate the greyscale values for each pixel. If there is no such function like photoshop does, then the other option is to have 2 images - one colored and the other greyscale - to switch between each other on mouseover. Am I right, or what else?
2. Why is it that the barbarabarry dot com images doesn't get downloaded into temporary internet files folder? I am using Loader.load to get the images loaded into flash. As a side effect, I noticed that these images gets downloaded into the temporary internet files folder (Internet Explorer). Not that it's bad, but I am curious how barbarabarry images do not get downloaded. I noticed this while trying to confirm whether the grey scale is dynamic or just 2 different images.
I'm getting
ActionScript Code:
1067: Implicit coercion of a value of type
__AS3__.vec:Vector.ie.aro.floorplanviewer.model.buildingVOs:ConfigurationVO>[code]....
which surprises me as ConfigurationVO inherits from NodeVO.Is the compiler really not able to figure out that a Vector of a superclass should be able to hold a reference to a Vector of a subclass?
How can i convert a color bitmap to grayscale using as3?
View 1 RepliesI would like to make a mask that both converts any colors to grayscale and then reduces their alpha value. The intended purpose is for the masked region to be in grayscale and lighter so that the unmasked region is more prominent. Most tutorials I've seen for alpha value masks are far too complicated and use the Flash GUI. How do you accomplish the same thing in ActionScript?
If the following is my image:
Then a traditional mask over some selection would produce the following:Instead, those parts that are masked out completely, I would like for those to be converted to grayscale:And their alpha value decreased, so they're lightened:
Trying to use colorTransformTo to turn a dynamically loaded to grayscale and then back again. The rgb values are 185, 185, 185.
View 4 RepliesI have been exploring setTransform () and setRGB looking for a way to convert a color .jpg into grayscale. Even triyed using functions to define a Saturation control like the one in [URL]
View 6 RepliesI'm dying here. I'm making an interactive image that's grayscale. Whenever the _parent MC is clicked, the different elements of the image randomly shift in grayscale.I have patchworked a thing together that works, but the code is so clunky that it basically kills the machine. I've tried several different color methods with varying success (can't even get colorTransform to work). how to build a function or something else that can basically shift the color to a randomly generated "target" value over n number of frames?
Code snippet:
Code:
imageHolder.onRelease = function() {
grass_color = new Color(imageHolder.grass);
oldColor = grass_color.getTransform();
//gets previous color value
[code]....
One of my big issues has been trying to create a function that can be applied to several different objects, or generate the objects for each mc. There are 5 color objects that color shift. This has been driving me nuts for days.
can i change the image color from RGB to Grayscale in flash mx 2004 with Action script
View 5 RepliesI need to import a bunch of vector work from Photoshop into Flash. Is there a trick to it. So far, on import, it's converting the layer styles into black.
View 5 RepliesIf I want to pass in a vector to a function, a vector of any object specifed would it be someVetor:Vetor.<T>? beause FB 4.5 sais T is undefined.
View 10 RepliesCreated Vector with the initial length of 100.
var v:Vector. = new Vector.(100);
v[90] = "Ninety"
v[190] ="oneninety" //RangeError: Error #1125: The index 110 is out of range 100.
//How to change the length from 100 to 200 to store a value at index 190
in the filters panel, there is an "adjust color" option.. and inside of it, there is an option there for "saturation".. setting it to the lowest (-100) will turn the movieclip / whatever object you're applying the filter to, to grayscale..i was wondering, how would i go about this using code?
for example, if there was a movieclip on stage called "thePic" and i wanted to decrease its saturation slowly every enterframe until it finally becomes grayscale, how would i go about it?i know how to manipulate the other filters like GlowFilter and BlurFilter through code, but it seems like there is no "AdjustColorFilter".. there is a ColorMatrixFilter, but i dont event understand how it works..
I've written a function that makes all white pixels in an image transparent. This works OK, but the resulting image looks jagged because it only replaces pixels that are solid white. What I'd really like to do is set the alpha value for each pixel proportional to the amount of white in that pixel, then set the RGB value to #000000. I think this would produce a very smooth semi-transparent image. However, I'm not very good at bitwise operations. Can any of you lend a hand?
As an added bonus I'd like to overlay the resulting bitmap on top of another image. I know this is possible via other means, but it would be nice to do it all in one function for performance reasons and simplicity.
[Code]...
can i change the image color from RGB to Grayscale in flash mx 2004 with Action script
View 5 RepliesI am currently being confused by the Vector class.I wrote a beautiful XML to TypedClass parser. Works beautifully and without fault. UNTIL a co-worker noticed we got a Conversion Error for Vector.<Number> to Vector.<*>.
Every Vector I've ever tested all extend Vector.<*>.
Vector.<Sprite>, Vector.<String>, Vector.<Point>, Vector.<Boolean>, Vector.<TextField>, Vector.<CustomObject>, etc etc etc. ALL of them.
<type name="__AS3__.vec::Vector.<String>" base="__AS3__.vec::Vector.<*>" isDynamic="true" isFinal="false" isStatic="false">
<extendsClass type="__AS3__.vec::Vector.<*>"/>
[code]...
But then when I use describeType on Vector.<Number>, Vector.<uint> and Vector.<int>.
<type name="__AS3__.vec::Vector.<Number>" base="Object" isDynamic="true" isFinal="true" isStatic="false">
<extendsClass type="Object"/>
<constructor>
[code]....
Now I have accounted for these 3 vectors individually as even uint and int does not extend Vector.<Number> as I would have expected.
And my parsing function works for all types correctly again. But my confusion comes as to WHY this is the case, and why I couldn't find any documentation on the subject.
Class ShootGame implements IGame{
[Code]...
I have a large vector drawing (imagine 5000x5000) that i want to break up into separate pieces. I know that I can convert this vector drawing into a bitmap and then use the copyPixels method to create many separate bitmaps of the different regions of the original vector drawing, but is there any way to subdivide it into movieclips that just contain vector graphics instead of a bitmap?The reason im dividing a big chunk of vector graphics into smaller pieces is for performance reasons, so flash would only render a small part of this big chunk at a time (only certain regions/voxels/subdivisions are rendered at a time). But bitmaps apparently take up a lot of memory and the system im using would take much less memory if these subdivisions could be preserved in their original vector graphics form.
I imagine I could use masks somehow to achieve this effect (for each subdivision, duplicate the huge image and mask only the region that the subdivision represents), but I dont know the performance costs of masking or if this will create other problems.So is there anyway to split up a movieclip of vector graphics into smaller movieclips of vector graphics the same way copyPixels can with bitmaps?
For a project, I'm making an interactive side scroller.You move the character with the arrow keys and press the space bar to interact with things.So far, I followed DexNote's tutorial on YouTube.I thought that I would make the interactable objects as buttons, while the mouse focus would be on the character and when you press the space bar it make a mouse click in that area.The trouble I'm having now is that I don't know how to make the space bar trigger the "interactions."
View 1 Replies