Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
mousumi_78 #1
Resize Bitmap image in image control in flex3
I am loading an image in image control initially. Then I am applying color
transform to that image and want to load that bitmap image in flex3. That is
working, but automatic resize is not working then. If I load another image then
auto resize is working fine. Doesnt Image control support resizing of bitmap
object of same image?.
Here is the portion of code:
<mx:Image source="{imgpath}" id="myImage"
creationComplete="imageCompleted();" x="20" y="30" width="365" height="440"
maintainAspectRatio="true"
/>
private function applyColor(event:Event):void{
myBitmapDataObject = new BitmapData(myImage.width, myImage.height, true,
0x00CCCCCC);
myBitmapDataObject.draw(myImage.content);
myBitImage = new Bitmap(myBitmapDataObject);
myBitmapDataObject.colorTransform(myBitmapDataObje ct.rect, new
ColorTransform(1, 1, 1, 1, 39, 76, 135, 100));
myImage.removeChildAt(0)
myImage.load(myBitImage);
}
Any help is appreciated.
mousumi_78 Guest
-
image select, resize and locally store (flex3 airexample)
Hi Jacob, I've tried out your script as it seems to be a good starter for an application I'm about to write. In my case, I don't want to create... -
Resize image on the fly
Does anybody know any custom tag or snippet that can resize image on the fly based on the user's selection, ie thumbnail 300x400 600x800 ... -
Determining Bitmap image resolution
Is there a way to determine the resolution of an embedded bitmap image in Illustrator. I have a client who has submitted a .png file embedded in the... -
Why can't I use a bitmap image over a video?
I have a video clip. I've also created a 32 bit alpha channel image of an old TV. The idea is that the video clip plays "inside" the old TV (the... -
Open Image in 'Kodak Image Edit Control' with web browser.
hi, 1.I want to show a image file of type '.tif' in the browser window; for that I'm writting as ASP code page. 2.This '.tif' type image can be... -
slaingod #2
Re: Resize Bitmap image in image control in flex3
You need to create the BitmapData as the original loaded image size, not the
mx:Image height and width. You are simply transforming/copying only a portion
of the original size that corresponds to the Image size. Ie. say you have a
400x400 image and your Image is 100x100. Your BitmapData is being created at
100x100, NOT 400x400 as you would need to do. Just because you resize the
Image, doesn't mean the underlying BitmapData is also resized.
Also, generally, addChild would be used after removeChild, never used load
myself. Not sure if it matters.
slaingod Guest
-
slaingod #3
Re: Resize Bitmap image in image control in flex3
You need to create the BitmapData as the original loaded image size, not the
mx:Image height and width. You are simply transforming/copying only a portion
of the original size that corresponds to the Image size. Ie. say you have a
400x400 image and your Image is 100x100. Your BitmapData is being created at
100x100, NOT 400x400 as you would need to do. Just because you resize the
Image, doesn't mean the underlying BitmapData is also resized.
Also, generally, addChild would be used after removeChild, never used load
myself. Not sure if it matters.
slaingod Guest



Reply With Quote

