I'm using smoothing right now to keep a clear image.
Printable View
I'm using smoothing right now to keep a clear image.
nice may i have a copy of the code or .fla? so that i can tweak it to suit my needs?
Post back something when you get it doing what you need so I can take a look. This code isn't all mine, I got a lot off of some old forums from actionscript.com
do you know how this xml stuff works in this code i haven't taken the time to learn xml and i need to know how to simply load a single picture that resides in the same folder as the .swf into this movie clip container.
if you don't know how to load in an image from a folder then it sounds as though mneil's project is beyond what you know.
either of these will load in a picture from a folder
Code:var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(mclis);
_root.createEmptyMovieClip("holder_mc", _root.getNextHighestDepth());
_root.mcl.loadClip("your image", _root.holder_mc);
Code:_root.createEmptyMovieClip("holder_mc", _root.getNextHighestDepth());
_root.holder_mc.loadMovie("your image");
Hi, I'm not totally sure what you're wanting to do (sorry). I downloaded your file but can't see it in action without the XML file. Maybe you could post a picture of the original image and another picture of how you want the image to look after flash has finished resizing it?Quote:
Originally Posted by mneil
hi this thread may help with regards to resizing images:
http://board.flashkit.com/board/showthread.php?t=719390
thanks lollerskates that helped me exactly 0% ...i know how to use moviecliploader but I can't seem to make it work with the resize code that mneil uploaded...somehow he is using a freaking xml file which i want to eliminate....how do rewrite the .fla so that it doesn't use the xml i want to use an array to tell it what to resize.
you said "i need to know how to simply load a single picture that resides in the same folder as the .swf into this movie clip container" and i told you how to do that. if that wasn't what you wanted then ask a different question.
first you're talking about a single image, then you are talking about an array - which is it? if you want flash to read the contents of a folder - how do you suppose you are going to do that without server side technology?
ok i can see you need to be brought up to speed so i'm gonna ignore all our previous disagreements and tell you what i plan to do........i plan to store the path to each picture in and array then I want to tell the resize function which picture to load and resize something like.....loadPic = array0[1];.........i know i know not all the code is there to make an array i often don't include all code when writing examples so you have to read into what i post a little bit. ok.
LISTEN!.. all of you..
either get along, or I'll close the thread.. PERIOD!
a couple things I have noted in this thread alone:
1.) post count and time here on FK mean NOTHING!.. absolutely NOTHING!!! If you judge someone on their post count or join date, you have problems, and a severely narrow minded.
2.) NOONE has the right to tell anyone to leave or not post... UNLESS, you are:
a.) a MOD
b.) a super mod
c.) an ADMIN
d.) you have broken one of the FK rules of posting, including (but not limited to) bad langunage, name calling, piracy/warez posting or SPAM!
got it? this goes for ALL of you.
now back on top.....
1.) he is scraping the directory with a PHP script.. to return the file name.. last I checked/spoke with him.. has this changed?
2.) lollerskates (IMHO) posted relavent information, I too woudl advise against any re-sizing of images through Flash..bitmap class or not... it would take half the time and effort to have my original 25 images.. run a 1 button batch script in Phtotoshop that re-sizes them ALL in seconds... no-resize garbage, no image quality degradation..etc..etc..
HOWEVER, if it something you want to explore.. by all means go ahead.. IMHO, just inst the fastest/better approach.
on a side note: calmchess, maybe 7you should calm down somewhat... from your posts it seems that you are NOT that well informed on certain methods/practices...so listening instead of fighting MAY help you.
If you want to do it YOUR way...thats fine... and in the end he can choose to follow your way or the advice of others..
I think in the end:
1.) there will be NO XML.. as the PHP script will just generate the file names back to the movie using a flashVar that he will have to split to get all the files names from.
2.) I still say re-sizing in flash is overkill..
again, FIGHT NICE,... or thread will be closed.. and possible BANS handed out if you guys wanna keep it up.
:)
take care
Alright guys, I've been gone all weekend. Whispers is correct. There will be no xml in the end, it will all be done through php. I'll post some more later with the xml so you can see exactly how I'm doing it for now.
Whispers... THANK YOU!
Also, it has not changed. I may not do it with the bitmap resize and just keep to my original method but this is interesting for me to play with. I want to know your reasons for saying it is overkill that way I can be informed on this. I do not really know what it is exactly I'm doing, that's why I posted and thank you very much for your help. Also, I mentioned above that I used smoothing on the loaded bitmaps. The image quality for my particular pictures come out looking good this way. ie: there is no noticable deterioration in picture quality. Thank everyone again for their help and interest in my question.
hi..
I have read that checking the "ALLOW SMOOTH" helps when you TWEEN your images so NOT to be so pixelated..
I also think taking a LARGE image and re-sizing it in Flash is NEVER the way to go... I am a firm believer that you do your IMAGE editing outside of Flash previous to loading using them in your project... (there are certain applications where you WOULD want to manipulate your image in Flash though.. I dont want it to be taken that way..but for most cases..no)
the bottom line is:
there are always more than way way to accomplish something...
If you want to learn ALL the ways.. awesome.. your just that more informed and ready to handle a variety of situations....
however there are certain, better approaches to tackle certain problems..
whatever works for you in the end is what you should use, if several things work, use the best method for the project to make it the most expandable, scalable application it can be...
it would be MORE work.. for the project to have to taken an image, copy it, re-sample it, shirnk it, and then use that to load/display (whatever) hen it will be for a regular load call to load a (smaller) pre-made version of the bigger image..
again, a simple one button push in Photoshop can be set up to point to a folder and re-size to whatever size you need them to be..
I'll consider all of this thank you.
I did read that allow smoothing helps when tweening too. But, I also noticed and read that when you use flash to resample the bitmap and use bitmapData.draw() to manipulate the size that the image will both "shift" pixels and can either band or tear. The image shifts about 2px up and to the left no matter what, unless you scale it slightly larger than you want and then move the x and y back over. Also, the colors tend to change slightly and the edges seem to diffuse. Dynamically smoothing the images takes care of most of these problems.
I noticed these problems when I first tried manipulating the size in flash. I only found someone else's solution to the problem was to use smoothing.
Just thought I'd throw that info out there. I don't know how much anyone has really played with doing this.
:thumbsup: good things to know. :)
mneil its good to see you are still intrested hey think you could upload a zip file that has the .fla .xml and an example picture in it so that i can see how all the files work togeather....i haven't had any luck with making the first .fla you uploaded work.
Hi all,
I'm currently working on a small gallery for a client. Still a work in progress, but it seems the resize code i use (copying the BitmapData to a temp var, then draw() it, then attach with smoothing true) gives pretty good results.
Here's the temp. file url:
http://www.genevieveparis.com/client...iemacleod.html
resize the window or go fullscreen on/off
gparis
Thanks gparis. That is exactly the method that I'm using. I like the look of it, and how it all loads in. I thought I uploaded my files on this thread but I guess not. I've got it all working but I didn't take the files home with me. I'll upload tommorrow so calmchess and anyone else who wants to can see. I do not have the interface yet like yours does but it will show people how to get the files in and resize them.
It runs pretty good on a cable connection. I ran it with sloppy at 56k to see how it would work; since I haven't really tested my own, and it took 20-30 seconds to see the first image. Have you tested speed yet gparis, and what did you get? Also, might I ask what the file size is of each of those pics? Oh, and I know your still working it, but I'm assuming a preloader too right? That's a pretty dumb question I know but I'm asking because I'm wondering if it will show loaded before the bitmapData.draw() has the chance to actually render the picture on slower processors; and if so, what kind of wait?
Again, thanks for all the interest guys.
gparis-
that is some nice looking re-sampling you got going on.. :)
this is a perfect example of where (IMHO) re-sample/re-sizing an IMAGE is useful/needed.
for a LARGE version of the images to still be used for the 'content' :)
now Im going to have to play with the class/code :)
What i also like with that method, is that when you click on the thumbnail, there is no "image loading" at all, they are all already loaded. There is only a fast "copy/paste". For that reason i used an animation for the loading of the thumbs so the whole loading process doesn't feel too long.(these thumbs are the actual big pictures scaled, copied, then pasted in the bigger container to the available size and at ratio)
gparis