Flash :: AS3 Bitmap Object Not Smoothing At Low Scale Values
Feb 7, 2012
What I am doing now is loading a .png image with a Loader object. After loading the file I cast the loaderInfo's content to a bitmap and set the smoothing value to true. This works without a problem until I reach a ScaleX and ScaleY value less than 0.5.
For example, if I have a 1000x1000 object, scaling it down to 200x200 causes the bitmap smoothing to no longer work.[code]...
View 1 Replies
Similar Posts:
Dec 9, 2003
getting a bitmap to apply smoothing properly after being scaled very small.What I am doing now is loading a .png image with a Loader object. After loading the file I cast the loaderInfo's content to a bitmap and set the smoothing value to true. This works without a problem until I reach a ScaleX and ScaleY value less than 0.5.
For example, if I have a 1000x1000 object, scaling it down to 200x200 causes the bitmap smoothing to no longer work.I can reproduce the problem using all of the following Sizing methods:
Change the scaleX and scaleY properties on the bitmap. Directly change the height and width properties of the bitmap. Add the bitmap as a child of another sprite and change the scaleX and scaleY properties of the sprite. Add the bitmap as a child of another sprite and change the height and width properties of the sprite. Creating a new BitmapData object with a matrix scale and then drawing the original BitmapData onto it.I've also tried some other workarounds that I found when searching, such as:setting the scaleX of the image to 1.001 or 0.999 forcing the height and width of the Bitmap object to be even numbers.
Below is some sample code for reproducing the problem. (I am running this locally so I have a copy of testimage.png in my bin-debug folder)
public class MainObj
{
public var comp:UIComponent;
public function MainObj()
[code]....
View 2 Replies
Nov 9, 2011
I'm using the regular 3D API of flash player 10 and i'm rotating on the Y axis a sprite which contains my bitmap. Although the bitmap.smoothing property is set to true, the bitmap is far from smooth.
View 8 Replies
Jun 16, 2010
Using Actionscript 3 is there a way to search one bitmap for the coordinates matching pixels of another bitmap?
[URL]
Somehow you would have to loop through the bigger bitmap to find and the the pixel range that matches and return those coordinates. For example the Bitmap with the "E" is 250 pixels over and 14 pixels down in the bigger bitmap.
View 2 Replies
Jul 30, 2009
When I created a Bitmap object from drawling the pixels of an image and then scale that Bitmap too large (or even too small) the image disappears or in some cases distorts in what appears to be random pixels barfed all over my screen.
In order to show you this I have made an example: [URL]
(click the plus button any more than 8 times and poof! the bitmap disappears)
And source: [URL]
(Flash CS4)
View 3 Replies
Oct 18, 2010
I'm doing a simple bkend admin using php for the client to upload images to be displayed on their flash website. ideally if they upload at the correct size, no problem, but sometimes they don't. So my problem comes in when the uploaded images are very big. When they are scaled down, the smoothing makes no difference at all.
I was wondering if there is a work around?
Code:
import flash.display.*;
loadMcListener.onLoadinit = function(){
var bitmap = new BitmapData(mc._width,mc._height,true,0x000000);
[Code].....
View 1 Replies
Jun 16, 2011
I'm creating an aerial view style game with the flash player 10 built in 3D, but Some of my sprites are very small, like 32x32 pixels, and when they are placed into the 3D world they become very blurry.
Is there a way to prevent flash player from smoothing the objects?
View 0 Replies
Nov 29, 2009
I've got a MovieClip containing several child clips (images and text). I'm trying to scale this parent clip very slowly - from 102% down to 98% - this works, however the child movie clips are all scaling a bit jerkily - like they're trying to stick to pixels or something. What's the cure for this? The scaling is done by using a motion tween on the timeline by the way. I've tried to tick "Cache Bitmap" but that makes no difference. If I used the 3D motion tween, there is no jerkyness. But I need to publish to flash 9, so can't use that!
View 1 Replies
May 11, 2010
i have made a bitmap over a menu and the only problem is that I made a scale and a rotation over that bitmap and it gets distort and I don't know why, because I use this:
ActionScript Code:
attachBitmap(b, 2, "always", true);
when i attach the bitmap.
View 9 Replies
Aug 3, 2010
I would like to use the smoothing function for my code here below.This is just a slideshow gallery that resize the photos at 100% full page with scaling proportions.=
2 - Another problem issue: this has a little movement effect that moves the photo when the mouse moves. To do this i scaled the images at 110% but it looks a bit streched here.
Code:
// import tweener
import caurina.transitions.Tweener;
import flash.events.Event;[code]....
View 3 Replies
Nov 8, 2009
Trying to set the smoothing of a dynamically loaded, through XML, JPEG set to true using AS2. I've seen an example of that would do this with this code:
createEmptyMovieClip("myMC",getNextHighestDepth()) ;
loadBitmapSmoothed("mypic.jpg",myMC);
In my code I'm loading a series of products from an XML file. Each bit of information for each product gets loaded into a seprate array. I have a 'zoomy box' image, which loads an image, but at 200%, which I want to smooth...
The code:
nZoompic1[i] = (childs.childNodes[EEE].childNodes[i].childNodes[18].firstChild.nodeValue);
What the syntax would be for getting it to work?
View 4 Replies
Jan 1, 2011
Can I control bitmap smoothing levels, or is it strictly on and off (true, false)?
View 1 Replies
Dec 1, 2008
I need fullscreen gallery and the bitmap smoothing thing. I tried to combine the gallery code and the bitmap code I found in this thread. Well, it's a xml based fullscreen gallery and it works fine but without smoothing . okay, i hope anybody can help - here is an extract of the gallery code:
[Code]...
View 2 Replies
Dec 2, 2009
I set up this sample movie clip in the hopes to figure out a problem I'm having:[code]In the above code, I can add the contents of myImageLoader to myMovieClip with no issues and it resizes as expected (and consequently artifacts appear). With the final two lines of code, apparently myBitmap is not being loaded with the contents of myImageLoader.content which will cause the final line to fail with the following error:Code:TypeError: Error #1009: Cannot access a property or method of a null object reference.at loadImageTest_fla::Main Timeline/frame1()I understand the error, I just don't get why the contents are not being loaded into the bitmap object.
View 1 Replies
Apr 20, 2010
I'm having a helluva time trying to figure out the syntax for smoothing of dynamically loaded png's. It's such an easy function for as3, but seems very complicated in as2.
Actionscript Code:
import mx.utils.Delegate;import mx.transitions.Tween;import mx.transitions.easing.*;var numOfItems:Number;var radiusX:Number = 100;var radiusY:Number = 40;var centerX:Number = Stage.width / 4;var centerY:Number = Stage.height / 2;var speed:Number = .001;var perspective:Number = 3;var home:MovieClip = this;theText._alpha = 0;var tooltip:MovieClip =
[code]....
View 5 Replies
Feb 19, 2009
I have searched several threads, and no answer has been found to apply a bitmap smoothing to an image already inserted inside a movie clip on stage (not dynamically loaded). Any suggestions on what to do to apply smoothing to an image inside a clip? Trying to come up with an answer as I am getting a funny fuzz around a logo that I'd like to see disappear. It appears clean and crisp within the png file, but not in the compiled swf.
View 4 Replies
Nov 6, 2009
i have a question and a unfortunate problem to report. First my question is how do I apply smoothing to a rotating bitmap asset that is in the flash timeline, (i.e.: not dynamically loaded), I don't like it all jaggy like that. Is there a way I can apply bitmap smoothing to a movieclip with a bitmap in it without going through all the rigamarole of loading the asset eternally? Bonus points for something super simple like MovieClip.forceSmoothing (I need this in AS3).
And unfortunate issue: I have a problem in Papervision. I think it might be a bug, where a plane object with an externally loaded BitmapAssetMaterial makes the computer chug like mad when the plane is viewed edge on or very close to edge on (I am using transparent PNGs). They display fine otherwise.
[Code]...
View 0 Replies
Aug 20, 2009
I know the topic of "duplicating" movieclips is a hot issue with the new virtual machine. Luckily, I understand the implications. I only am [currently] interested in duplicating a Bitmap. See, I load an image from an URL using 'flash.display.Loader.load', which is a non-blocking operation in Flash Player.However,I may use multiple copies of the loaded image (which is reported to be a Bitmap, naturally) in the display list at the same time.Hence, I naturally do not want to load the image from an URL every time, because I don't want to wait for a non-blocking call to complete. Nor do I need to - I mean one copy is already loaded, so it should be possible to just "duplicate" it, right?
My idea is to do use the bitmapData property of a Bitmap and pass it to the constructor of a new Bitmap object. I have not tried the following in action, but I want to hear whether any of you did and if the following would not work, what would:
Code:
var original_bitmap: Bitmap;
var copy_of_original_bitmap: Bitmap = new Bitmap(original_bitmap.bitmapData);
LiveDocs mention that the BitmapData being passed to a Bitmap constructor is "being referenced", which to me might suggest it cannot be used twice? There is also the BitmapData::clone() method, which I am not sure is applicable here or not.I know this is a lot of talk instead of just trying this out, but I test so much Flash Player code daily just to see "what works" (which should be documented instead by Adobe),
View 4 Replies
Aug 17, 2009
how I could setup an Image so when it loads, and I change its Z value, it doesnt keep shifting in reference to the upper left. Right now, when I change the Z value of a Sprite containing the Image, it appears to move x, y (even though I know they are not changing). I thought that by putting it inside of a sprite, and then moving the image to so that its center was at 0,0 inside the sprite, that when I changed the z value of the sprite and not of the bitmap itself, it would fix my problem, but its not.
bmp = new Sprite();
var bmp1:Bitmap;
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, fileLoaded);
[Code].....
View 1 Replies
Mar 14, 2011
Most often, questions are asked about how to scale a DisplayObject, and the answer is usually to use a Matrix.
My question is, how to you GET the scale of a Matrix (scaleX and scaleY)?
There's a Matrix.scale method to set the scaleX and scaleY, but it doesn't return a value, and no other properties exist to read it back.
The reason I ask, I'm using object burried deep down into a Display list, and each may be transformed. So I use the child object's sprite.transform.concatenatedMatrix getter, but am stuck at this point on how to read the scale from it.
View 2 Replies
Dec 14, 2008
I'm implementing a frame class that builds a graphical frame around children using 9 bitmaps (4 corners and 5 middle pieces).The frame extends sprite, and the 9 frame bitmaps are attached as children. They are repositioned as necessary to encompass any other children on the sprite.
This works fine, normally, but as soon as I rotate or scale the frame, the children split apart, showing what appears to be a one pixel or partial pixel gap between the pieces.
I've tried setting pixelSnapping = PixelSnapping.NEVER on the 9 bitmaps. I've tried turning smoothing=true. The children bitmaps are always positioned at integer x, y's, never fractional. I've tried setting the scale of the children bitmap to 1.01 and PixelSnapping to AUTO. None of it works.
View 4 Replies
Nov 10, 2010
I tried many Flash .swf before and they all can be scaled freely -- by using a width and height in the HTML, and sometimes in the URL params or flashvars. But is it true that all Flash object can be scaled? For example, can some Flash objects using absolute coordinates to plot graph so that every 10 pixels it marks 1, 2, 3, 4, 5, and no matter what is done at the HTML or any where else, it just won't scale and the browser can't do anything about it either? Is there a way to scale it to half the size for that graph? (that is, 1, 2, 3, 4, 5 is separated by 5 pixels instead of 10 pixels)
View 1 Replies
Jun 29, 2011
I have a div with a flash object in it. That div is going to pop up in a modal triggered when a user clicks a thumbnail of the flash presentation. The problem occurs when I try to use the scale effect to scale in or out, it errors out.
Here is the HTML:
<div id="modal">
<object id="presentation" width="720" height="576" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="[URL]" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value=" video.swf" />
<param name="quality" value="high" />
[Code] ......
View 1 Replies
Oct 27, 2011
I've created an mc which functions as my map and controls to go with that which allow the map to be moved around and key points navigated to and zoomed in on at varying zoom levels.I'm using scaleX and scaleY to scale the map mc and a list of x and y positions to correctly position the map for each key point.When I want to go to a certain area I perform this calculation (offsetX and offsetY are the center of the screen):
newX = posX * scale + offsetX;
newY = posY * scale + offsetY;
Then I tween the position and scale of the map to smoothly scale and move the map to the correct position:
var tween = new TweenLite(_background, EASING_SPEED, {x:newX, y:newY,scaleX:scale.getScale(),scaleY:scale,ease:EASING_TYPE,onComplete:moveToComplete,onCompleteParams:[room]});
I now need to implement a zoom in / out function and this is what I'm struggling with. The zoom should use the center of the screen as the reg point for the scale, so I've been trying something along the lines of the following to get the correct positioning:
var newX = offsetX - (offsetX - _background.x) * scale;
var newY = offsetY - (offsetY - _background.y) * scale;
So in my mind this gets the distance from the current position of the map relative to the center point of the screen (offsetX, offsetY) then scales that distance by the new scale. However, this is clearly wrong because it's not working and the positioning of the map is wrong.I've also tried using a transform matrix to get the correct values but I know even less about them and not got the right results.
function scale(target:MovieClip, center:Point, scale:Number):Point {
var m:Matrix = new Matrix();
m.translate(-center.x, -center.y);//move the center into (0,0)
[code]....
View 3 Replies
Feb 22, 2009
I've been trying to figure out a solution for a problem.. Which is really bugging me. The only thing I could think of that has potential to possibly work is being able to store bitmap names in an array.. Like this example(which doesn't work):
Code:
var hairBitmapA:Array = ["hair_1_1", "hair_1_2"];
var i:uint = 1;
var hairBitmap:hairBitmapA[i] = new hairBitmapA[i](0,0);
The idea of this is simple, although not correct, is there a way that I can do what I'm trying to do?
View 4 Replies
Mar 30, 2011
Is it possible to draw a Bitmap to a Graphics-Object like
this.graphics.beginBitmapFill(bitmapData, matrix, false);
this.graphics.drawRect(0, 0, w, h);
this.graphics.endFill();
with an offset?
A simple moveTo(x, y) call before beginBitmapFill does not work :/ Neither does changing the x and y value of drawRect... (That just seems to have the same effect as an translation with the matrix...) Additionally I don't want do draw that thing in a separate Graphics-Object and add that one into the other...
View 2 Replies
Mar 31, 2009
In Flash, the BitmapData object can be used to store bitmaps in RAM, you can later draw them to a MovieClip using the beginBitmapFill() method.
How do you load an external bitmap file (.jpg) into a BitmapData object?
View 5 Replies
Jan 20, 2010
I have a video inside of another movieclip. When I go full screen, I scale up the outer movieclip to fit the screen. So that OuterMovieClip.width is equal to screenWidth etc. How do I maintain the aspect ratio on my video so it does not get distorted? Whats the proper math for that?
View 1 Replies
Aug 5, 2009
does cached a bitmatp improve speed of vector object or bitmap object?
View 1 Replies
Feb 16, 2011
I'm trying to trace the path of an object by using setPixel on the object's position every frame in a BitmapData/Bitmap pairing. These pixels aren't showing up normally and I suspect I have a fundamental misunderstanding of the BitmapData class. Here's what I'm doing:
public var contrailBase:BitmapData;
public var contrail:Bitmap;
private var contrailColor:uint;[code].....
Using this code, the red pixels don't show up. If I initialize contrailBase to 0xFF000000 instead then I get a black screen on which the red pixels DO draw, but I need the bitmap to be transparent except for the contrail. What am I doing wrong?
View 2 Replies