Adobe Dreamweaver Forums



Last 10 THreads :         Issue with Firefox & Flash Player Installation (Last Post : hhgttg - Replies : 1 - Views : 29 )           »          Up Button Event Handling Problem (Last Post : ABCJARED - Replies : 0 - Views : 1 )           »          audio (Last Post : Captiv8r - Replies : 1 - Views : 2 )           »          Kintana Dummy Page (Last Post : KiahMom - Replies : 4 - Views : 5 )           »          Dreamweaver CS3 Problem on Windows Vista (Last Post : confused_pam - Replies : 14 - Views : 15 )           »          adobe flash player installs but doesn't play (Last Post : kellyg1 - Replies : 1 - Views : 2 )           »          Video Conversion adds slight gray background (Last Post : JRStaf4ord - Replies : 0 - Views : 1 )           »          help getting links in scrolling menu to work (Last Post : NedWebs - Replies : 11 - Views : 12 )           »          left join won't work in query of query? (Last Post : Ian Skinner - Replies : 4 - Views : 5 )           »          Video Conversion adds slight gray background (Last Post : JRStaf4ord - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-06-2008, 01:16 AM
AcidGuy
 
Posts: n/a
Diggs:
Default Flex Image Component Filled with image

Hi guys, any of you knows a way to stretch a picture in a component "Image"
without the proper scaling?, the thing is i did it before astro with certain
code in php, so the user for example uploaded a picture and it got to the right
size, but sometimes they had to wait to upload to the server to see the
standard size preview.

now with astro, nice thing you can load the image at runtime and just preview
it "how is going to be" before uploading the image to the server....

this is the closest thing have gotten, but still the image cant get to a
certain size, that will be Heigth : "300", width : "400", when loaded directly
with image component, it just kept scaling, so certain areas of the image
component ketp empty..... it doesnt matter if it distorts....

i am porting my project from php to flex...
have learned many things about flex, great language, but cant get this working
properly.

probably is a simple thing for some of you guys, help!.

here is the code is currently in....


private function image_completeHandler(event:Event):void
{

bmd = Bitmap(event.currentTarget.content).bitmapData;

// Retrieve a temporary reference to the original BitmapData object
originalBitmapData = bmd;
// Set the amount by which to scale the bitmap
var scaleFactor:Number = .5;
// Calculate the new dimensions of the scaled bitmap
var newWidth:int = originalBitmapData.width * scaleFactor;
var newHeight:int = originalBitmapData.height * scaleFactor;
// Create a new BitmapData object, sized to hold the scaled bitmap
scaledBitmapData = new BitmapData(400, 300, bmd.transparent);
// Create a transformation matrix that will scale the bitmap
scaleMatrix = new Matrix( );
scaleMatrix.scale(scaleFactor, scaleFactor);


//scaleMatrix.d = 1;

// Draw the scaled bitmap into the new BitmapData object
scaledBitmapData.draw(originalBitmapData, scaleMatrix);
// Replace the original BitmapData object with the
// new, scaled BitmapData object
bmd = scaledBitmapData;

bitmap = new Bitmap(bmd);

/// IMAGE COMPONENT...
imagenTransformada.source = bitmap;


}



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-06-2008, 01:26 AM
slaingod
 
Posts: n/a
Diggs:
Default Re: Flex Image Component Filled with image

You can use scaleContent="true" and maintainAspectRatio="false" so that you image stretches.
Reply With Quote
  #3 (permalink)  
Old 10-06-2008, 02:26 AM
AcidGuy
 
Posts: n/a
Diggs:
Default Re: Flex Image Component Filled with image

nice, slaingod... thx. fixed....
now 1 posibility is opened to send the filereference to the image to the
server... and the user to preview like going to be save on the server....

but another possibility, would not be nice, the user for example that big
image is compressed into flash(changing bitmapdata height, width) then be sent
for example to php and not the "fileference" from the original file which cout
be many mbs??

anyone how to get handled width,height in bitmapdata, or...
is possible to take the picture on the "Image" component and get it ready for
sending it to server?

thx, if this is resolved, theses steps could be great for a tutorial, thx
again slaingod.



Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 09:28 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk