开发者

flash image gallery - load images through xml resize images

I have a flash image gallery that loads images through xml. Images have to be croped for thumbnails. So u have to have two folders, one for the thumbnails an another file for the big size images. I would like to know if there is a way to load only one image ( and not this image's thumbnail too) and with a script or something, to resize开发者_Python百科 this image to get the thumbnail. To make my self clearer here is the xml code:

pic  image../gallery_flash/imageGallery/images/watches/i1005.jpg  image
    thumb../gallery_flash/imageGallery/thumbs/watches/i1005.jpg thumb       
pic

(For some reason it doesnt show the xml right...)

I dont want to have the line ( thumb>../gallery_flash.), but only load one image and get the thumbnail also. I dont know if i made my self clear or if my english is good. Thank you in advance! Look forward to reading a responce!


Take your big image bitmap and draw it on BitmapData with scale:

const zoom:Number = 0.1;
var matrix:Matrix = new Matrix;
matrix.scale(zoom, zoom);

var _thumbBitmap:BitmapData = new BitmapData(THUMB_WIDTH, THUMB_HEIGHT, false, 0xFFFFFF);
_thumbBitmap.draw(yourImageBitmap, matrix, null, null, null, true);

More: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#draw%28%29

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜