상세 컨텐츠

본문 제목

액션스크립트 or 플래시 이미지를 매끄럽게 부드럽게(smooth) 옵션에 넣기 관련 (swc 이미지를 라이브러리로 쓰거나 이미지를 스케일링할때 이미지가 깨질때 그나마 대안)

ADOBE/ ActionScript

by AlrepondTech 2014. 1. 9. 10:41

본문

반응형
728x170


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


출처: http://202psj.tistory.com/640 //여기


플래시 프로페셔널에서 사용하는 이미지를 되도록 매끄럽게 스무딩(smooth) 하여 사용하여 보자




위 그림과 같이 라이브러리 항목에서 사용하는 그림들을 쉬프트 클릭으로 여러개를 지정한다음 마우스 오른쪽 버튼을 누루고 

"속성"에 들어간다.






그림과 같이 "매끄럽게: 이부분에 체크박스에 표시를 하고 옆에 설정에 "예"라고 설정하여야 선택한 모든 이미지에 매끄럽게(smooth) 가 

적용이 된다. !!!!


이 옵션을 통해 그나마 이미지를 늘려서 사용할대 깨지는 현상을 덜어 줄 수 있다.




//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


출처: http://stackoverflow.com/questions/7763029/smooth-scaling-a-movieclip


I have a MovieClip that contains bitmaps as frames. How can I scale it smoothly, achieving the same effect as with Bitmap.smoothing set to true?

I also have a Sprite that contains Bitmaps. I want to achieve the same effect on the Sprite, but setting its scaleX and scaleY properties results in the same problem. I tried setting smoothing totrue on the children Bitmap instances, but nothing seems to happen.

share|improve this question
add comment

A trick that you can use to get a smoothing-like effect on a MovieClip is to apply a small BlurFilter to it, like:

var blurFilter:BlurFilter = new BlurFilter(2, 2, BitmapFilterQuality.LOW);
my_mc.filters = [ blurFilter ];

Either this, or assign smoothing=true for each bitmap inside the MovieClip.

share|improve this answer
add comment

You can check this article it will guide you through the magic of smoothing in flash



//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


출처: http://www.actionscript.org/forums/showthread.php3?t=170590


I know there was a lot of stuff about this issue, and I have searched and found many 'solutions'—but I am still having this problem!

I have a sprite, with a loader (which I dont add to the stage). The loader loads a large image, scales it way down and then draws it. No matter how I do this, the resulting image is always aliased and nasty. The only thing that did work was setting the stage quality to 'best', but the site took too much of a performance hit otherwise—and more importantly—I shouldnt have to!

I have tried:
1. adding the loader to the stage, and setting smoothing on the content (Bitmap)
2. creating a new bitmap on load, with smoothing set to true (both in new bitmap constructor and after using Bitmap.smoothing)
3. creating a shape on load and using bitmap fill, with smoothing set to true

Sample code for all three is below, but #3 is the one I really want to use, because I need 9-slice scaling. What am I doing wrong?!! Are there any other reasons this might not be working!? Any help would be most appreciated.

EDIT: Also see links to example SWFs in post belowhttp://www.actionscript.org/forums/s...369#post745369
  1. ActionScript Code:
    _imageLoader = addChild(new Loader()) as Loader;             ... var bitmap = _imageLoader.content as Bitmap; bitmap.scaleX = bitmap.scaleY = scaleFactor; bitmap.smoothing = true;
  2. ActionScript Code:
    _imageLoader = new Loader();             ... var bitmap:Bitmap = addChild(new Bitmap()) as Bitmap; bitmap.bitmapData = (_imageLoader.content as Bitmap).bitmapData; bitmap.scaleX = bitmap.scaleY = scaleFactor; bitmap.smoothing = true;
  3. ActionScript Code:
    _imageLoader = new Loader();             ... _imageBMData = (_imageLoader.content as Bitmap).bitmapData.clone(); _image = addChild(new Shape()) as Shape; _image.graphics.beginBitmapFill(_imageBMData, scaleMatrix, false, true); _image.graphics.drawRect(...);

Last edited by nikonratm; 05-16-2008 at 06:12 PM.
nikonratm is offline  Reply With Quote
Old 05-15-2008, 04:47 PM  #2
Senior Member
 
Join Date: May 2007
Location: Bath, UK
Posts: 448
Default

You may be having issues with the small bug in smoothing dynamically loaded bitmaps...

http://www.gskinner.com/blog/archive..._bug_with.html

PMF
Bombdogs is offline  Reply With Quote
Old 05-15-2008, 05:01 PM  #3
Tara Fenton
 
Join Date: May 2005
Location: Brooklyn, NY USA
Posts: 346
Send a message via AIM to tarafenton
Default

just making sure you are testing from online - not from flash
bitmaps look a lot better when they are live
tarafenton is offline  Reply With Quote
Old 05-15-2008, 11:02 PM  #4
Registered User
 
Join Date: Jun 2006
Posts: 13
Default

Thanks for the help-

Bomb, Grant's issue seemed similar, but in his example smoothing worked at first, then when scaled and rotated it stops working. Also, his solution was to reset the smoothing property—I have tried setting it before, after, in between, using my left hand, while hopping on one foot....

Tara, I am testing both online and offline...never heard before that theyre worse offline (I checked again, just to be sure).



////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


출처: http://www.ubacoda.com/?p=36


Smoothing Loaded Images in AS3

Wed Jun 23 06:11:51 2010

Today, there I was, sitting at my desk working hard on a project involving loading images into a ActionScript constructed gallery. I needed the images in the gallery to animate and scale, as one would expect to be able to do with rich internet content.

Herein the problem lies, because the images looked very pixelated when they did anything other than just remain still.

Now, this isn't a big problem if you know how to go about it the right way, but I would imagine that there are tons of people out there who need to do the same kind of thing in their galleries, and probably 9 times out of ten are frustrated by the quality of the images output in the flash player. After all, rich internet applications should display rich image content. Then it hit me! Why not write a little about it here and spread the message that, although the flash player can sometimes be a CPU hog, it is something special, even when dealing when dealing with images.

As you will have probably seen by now, in the top left of this post there is a .swf file playing a scaling image, which reads "I love AS3" (and I admit proudly that I do). At the bottom of the swf there is a button, which when pressed will add/remove bitmap smoothing to the image loaded. Smoothing in ActionScript 3 is surprisingly simple and can be done by setting the smoothing property of any Bitmap instance to true. Take a look at the example below.

var ldr:Loader = new Loader();
addChild(ldr);
ldr.scaleX = ldr.scaleY = 5;
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
ldr.load(new URLRequest("myImage.jpg"));

function imageLoaded(event:Event):void{
   var contentToSmooth:Bitmap = event.target.content;
   // contentToSmooth.smoothing = true;
}

If we were to compile this code as it, assuming we've entered the correct URL to the image, we should see our image scaled by 5x and looking quite pixelated depending on how high the quality is of the image used. Now all we have to do to see the effects of smoothing is uncomment line 9 by removing the // from the beginning and recompile. This time you should notice a much less pixelated image displayed, even at 5x the size.

If you're interested in the example at the top left of this post, you can download the source code below.


PixelSmoothing.zip




////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

반응형
그리드형


관련글 더보기

댓글 영역