Resizing the images

hi,
i want to resize and centering external images.
i have done with centering the images.
but how to do resizing.....here is my code....
// code for centering images starts
//Define center coordinates
var centerX:Number = _root.emptymc_mc.imagemc_mc._width / 2;
var centerY:Number = _root.emptymc_mc.imagemc_mc._height / 2;
var movieClipLoader:MovieClipLoader = new MovieClipLoader();
var loaderListener:Object = new Object();
//Use the onLoadInit function to get the loaded images
proportions
loaderListener.onLoadInit = function(target:MovieClip) {
trace(target._width + " x " + target._height)
target._parent._x = centerX - target._width / 2;
target._parent._y = centerY - target._height / 2;
// end resizing and centerring code
// now loading images into movie clip loader
movieClipLoader.addListener(loaderListener);
var movieClipHolder:MovieClip =
_root.emptymc_mc.imagemc_mc.createEmptyMovieClip(" container",
getNextHighestDepth());
var movieClipLoaderTarget:MovieClip =
movieClipHolder.createEmptyMovieClip("loader", 1);
//Load an image to the target
movieClipLoader.loadClip(_parent._parent.thumbs.fi
rstChild.childNodes[2].childNodes
.childNodes[0].nodeValue, movieClipLoaderTarget);
// end
now how to resize the images???

Thanks for the reply...
now its resizing and centering the images well but not
according to the aspect ratio.
see... i have one mc called imagemc_mc in which i want to
load the images.
so first i grab the width and height of the imagemc_mc in a
varibale.
var imgwidth = _root.emptymc_mc.imagemc_mc._width;
var imgheight = _root.emptymc_mc.imagemc_mc._height;
and then in onLoadInit() method first its check the width and
height of the target and is it is greater than imagemc_mc then it
resize the image to the imagemc_mc 's width and height.
if(target._width > imgwidth && target._height >
imgheight)
target._width = imgwidth;
target._height = imgheight;
else
target._parent._x = centerX - target._width / 2;
target._parent._y = centerY - target._height / 2;
target._parent._x = centerX - target._width / 2;
target._parent._y = centerY - target._height / 2;
its working ....but if image is greater than imagemc_mc then
the image is squeezing ....it is not according to the aspect ratio.
please reply..............
thanks a looooooooot

Similar Messages

  • Photoshop CC: Have a template that I moved image into.  Image is too small.  How do I resize the image while in the template?  Or must I go to original image file and resize there again and again until I get the right fit?

    I have a template that I am able to plug different pictures into at different times.  The problem is that when I plug an image into that template, I find that the image is either too big or too small.  Is there a way to plug the image into the template and resize the image (and not the template itself) OR will I have to go to the file with the original image and resize it there and then try to plug it in to the template to see if it fits------and if it does not fit, go back to the original file with the image and resize it again and see if that fits---and so on and so on...........?  I have tried the" image size" option but it's hit or miss------mostly miss!
    Thanks!

    Read up on Smart Objects. It looks like you have no idea as to how to create and use them.
    Jut create a Smart Object from the layer containing whatever it image it is that you are "plugging into your template".  But you do need to learn the application at its most basic levels.
    Photoshop is a professional level application that makes no apologies for its very long and steep learning curve.  You cannot learn Photoshop in a forum, one question at a time.
    Or is it possible that you don't even have Photoshop proper but the stripped-down Photoshop Elements?"
    If the latter is the case, you're in the wrong forum.  This is not the Elements forum.
    Here's the link to the forum you would want if you're working in Elements.:
    https://forums.adobe.com/community/photoshop_elements/content
    If you do have Photoshop proper, please provide the exact version number of that application and of your OS.
    (edited for clarification)

  • How resize the image after drag drop according to container

    Hi,
    I have a image which can be drag drop in different size of containers. After drop i want to resize the image by maintaining the aspect ratio according to the container in which it is going to be drop. I will be very thankful for your help.

    thank you, brother
    i will try it see if it is work
    whatever, i will report the result later

  • I updated to Photoshop cc 2014 and now can't resize the images like I used to.

    I updated to Photoshop cc 2014 and now can't resize the images like I used to. 
    I used to click on the image and then go to the corner hold down shift and resize it.  Now it won't do it.
    How do I do it now? 
    I have a project deadline and need to do this asap.  Panicking that I won't meet my deadline.

    Did you turn off the "show transform controls" option in the move tool?
    It sounds like you were using that previously.
    And you can always transform by using the Free Transform command (command/control T).

  • Guys, i want to ask on how to resize the images into 1200 pixels wide?

    Guys, i want to ask on how to resize the images into 1200 pixels wide, how to do it? and what are the step by steps on doing that? thank you!!!

    See this link: http://forums.adobe.com/docs/DOC-3691

  • Resize the image in the textpane

    Does anybody know how to resize the image in the textpane to fit the size of the textpane. I am trying to avoid scrolling. Any suggestions?

    Here is my code,
    JTextPane tp = new JTextPane();
    URL msn = new URL("http://www.msn.com");
    tp.setPage(msn);
    I am trying to make the webpage, which is returned by the URL, fit into the JTextPane without implementing scrolling. I would like to resize the webpage to fit into the JTextPane regardless of the size. Any suggestions? Thanks.

  • How to load images in List from Xml and view the image and resize the image & save in Flex?

    Hi Friends,
    I am new to flex i am doing application for image resizing rotating and save the resize image.
    I want to load the images from xml file to listcontrol and show that images as a icon in the listview,then i want to drag that image to panel that time it should show it original size of the Image.then it allows user to resize ,crop,rotate the image.then i want to save the resize image,when i save the resize image it should replace the original image in the xmllist.
    I am looking for some useful suggession ,if you dont mind want to see some snippet code.
    It will help me to understand the concept.
    Cheers,
    B.Venkatesan

    Not in Crystal Reports Basic for Visual Studio 2008. You'll have to upgrade to CR 2008 (12.x). Then use kbase [1320507|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] as a guide on how to do this.
    Ludek

  • In Aperture 3 creating a book using Formal theme and in Edit Layout I can move but not resize the image box even though handles appear and the manual says I should be able to. Help      image boxt

    Can I resize image boxes with the displayed handles as the User Manual suggests I can, when creating a book in Aperture 3 using the Formal Theme (with the beveled mask) and in Edit Layout mode?  I can move the box with the yellow guidelines, but those handles will not move to allow me to adjust size.  If I delete the box and add a photobox, I can resize, but I loose those nice beveled masks!

    Well I tried on my wife's MB and it worked fine, but keeps the same aspect ratio. Nearly there. I tried the local Apple outlet, but they had just taken Aperture off the demo machine .
    However, I have discovered that I can use the "right click" option for 'photo aspect ratio' and it will resize the box to accomodate my pictures.  By fiddling I can select an alternative ratio and/or picture and change the size of the frame up or down and try to get an appropriate size and ratio, e.g. if I have a small landscape picture, I can pop in a bigger square picture (it gets cropped) then choose a portrait mode (cropped differently) then pop in my landscape picture (still cropped, but bigger size), then use the option 'photo aspect ratio', I get it uncropped and bigger.  Not a really satisfactory work around, but better than nothing. 
    By combining they fiddling with aspect ratios and the pinch/squeeze routine - on the MB (or via Lion and a track pad I assume) - I should get there.
    Pity those pesky handles don't work!!
    Thanks folks for the help

  • I want resize the image and set position after retrieving from oracle datab

    How can I display image on web page after retrieving it from oracle database. Display is not problem but resize that image and position is very dificult .Please send me Guideline about blob object todisplay and resize it in web pages

    I tried to do the suggetion made by you but I was not able to solve the issue. I think I am close to it and with your help I should be able to resolve it. Let me explain you the brief about this issue.
    1. Another group uses Oracle Apex to load the images in to the database.
    2. I am fetching this data fron Oracle and displays in to Webpage using PHP.
    This is so far I tried. Please bear with me if I am doing anything wrong.
    1.I created program.php which calls the <IMG> as suggested by you.Snippet of the code is
    <div><img src="/oracle/image_story.php" alt="Image Stories" width="900" height="500" /></div>
    2. In the image_story.php, I used the following code.
    <?php
    $query = "SELECT *
              FROM IMAGE_STORY WHERE image_id = 50";
    if ($result = run_oracle($query, 'select')) { // Run the query.
         $num_results = count($result);
         if ($num_results > 0) {
         foreach($result as $row){
              $img = $row['DOCUMT']->load();
              header("Content-type: image/pjpeg");
              echo $img;
              //echo '<div><img src="'.$img.'" alt="Image Stories" width="900" height="500" /></div>';
    ?>
    When I run the program.php,Image is not displayed and it is showing as "X". To troubleshoot the issue,I run the image_story.php and echo $img is giving me the weird character like,
    "ÿØÿàJFIFddÿìDuckyPÿîAdobedÀÿÛ„          
    I used PL/SQL developer as a client to access the BLOB field from the database and in the HTML view, it is giving me the same output.
    Select * from image_story a where a.image_id = 50
    I am not sure the issue is with the MIME-TYPE,ENCODING or I am missing something here. I tried lot of Content-Type.
    Please guide me.

  • Can you resize the image in stickies

    Just wondering if there's a way to do that
    i kind of want to make the image smaller than their original size

    Does not appear so.  Resize in Preview>Tools>Adjust size   before you drag to Stickies.

  • How do i resize the image getting captured by ImageSnapshot???

    hey guys... so im taking an image of a movie clip using ImageSnapshot.captureBitmapData(myClip);
    i need to resize the bitmap data that i get back, the size needs to be 720X486
    the code i have is...
    var myClip:MovieClip = event.target as MovieClip;
    var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData(myClip);
    var pngEncode:PNGEncoder = new PNGEncoder();
    var ba:ByteArray = pngEncode.encode(imageBitmapData);
    any ideas??? i tried to use the matrix.scale, but i guess i didnt understand on how to use it properly...
    any help is greatly appretiated!!
    thanks

    Hi,
    You can also use the below approach to  capture the BitmapData of your moviclip(myClip).
    So that you can make use of matrix class to resize the bitmap image.
         var myClip:MovieClip = event.target as MovieClip;
         var imageBitmapData:BitmapData = new BitmapData(myClip.width,myClip.height);
        var pngEncode:PNGEncoder = new PNGEncoder();
        var ba:ByteArray = pngEncode.encode(imageBitmapData);
        var m:Matrix = new Matrix();
        imageBitmapData.draw(myClip,m);
        m.scale(1.2,1);
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • Resizing the Images parsed from XML feed and binding to Listbox...

    Hii..
    I have downloaded the xml feed and parsed images from feed. Binded them to listbox and displyaed in a listview.Using the below code
    XAML code:
     <Grid x:Name="ContentPanel" Margin="12,163,12,10" Grid.RowSpan="2"  >
     <ListBox x:Name="moviesList"
                    SelectionChanged="moviesList_SelectionChanged">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Border x:Name="brdTest" BorderBrush="Gray" BorderThickness="0,1,0,1" Height="360" Width="500">
                                <Grid Height="350" Width="300">
      <Image delay:LowProfileImageLoader.UriSource="{Binding MovieImage}" 
                                     HorizontalAlignment="Center" 
                                       Margin="-30,0,0,30"/>
                                    <StackPanel Margin="30,280,10,-20"
                                            Height="60"
                                            Orientation="Horizontal" 
                                              VerticalAlignment="Bottom">
                                        <TextBlock Text="{Binding MovieName}" 
                                               FontSize="35" />
                                  </StackPanel>
                                </Grid>
                            </Border>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
      </Grid> But in listbox Images of different widths and heights were displaying.
    As shown in below screenshot..
    I need to get all images of equal height and width.How can I resize them.Do we have any methods of resizing or compressing the images to equal heights and widths....Plzz..help me..
    ManyThanks in advance...

    Hi
    There is a similar thread on re-sizing image. Please see if it helps.
    https://social.msdn.microsoft.com/forums/windowsapps/en-us/00779641-d6d2-42af-b368-8b32f2c702cc/writeablebitmap-resizing
    Regards
    Varun Ravindranath Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you.

  • Resizing the image

    If I want to resize the object(say from 320x240 to 50x50), without disturbing its contents. How do I do that?
    -Hane

    If I want to resize the object(say from 320x240 to
    50x50), without disturbing its contents. How do I do
    that?
    -HaneWhat? That can't be done.
    Kaj

  • Drag n Drop image along with the ability to resize the image in hbox

    Hi All,
    Is there an application similar to paint where we can drag n drop images and also resize them in javafx application? and also can we draw a line and also resize it?
    Thank You
    Edited by: SathyaRao on Jun 3, 2012 3:08 AM
    Edited by: SathyaRao on Jun 3, 2012 6:49 AM

    Hello sathyaRao,
    I don't think there is anything like that . You need to develop by yourself . I've written some blog post which might be related with your requirement.
    - Draggable Node in Javafx 2.0
    - JavaFX Drag and Drop Cell in ListView
    For more please do some google on keywords like : javafx,drag,drop etc
    FYI: Documentation of JavaFX 2
    Thanks,
    Narayan

  • Using Javascript & Actions to resize an image and add the filename as text

    Hello,
    I am currently working on a way to take an image, resize it and add exactly what is in it's file name (before extension) as a text layer. I have succeded in this BUT am having issues with file names that require more than one line of text.
    I need the text to align to the bottom of the image & the script or action must then resize the image so that the text does not overlap.
    Any ideas on how this can be done?
    At the moment I am using:
    -"Fit Image.jsx" to resize my image to a specific size (This was included in the Photoshop CS5 scripts)
    - A script to add the file name without extension and place the file name at a specific position.
    AdFileName.jsx
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    try
      var docRef = activeDocument;
      // Now create a text layer at the front
      var myLayerRef = docRef.artLayers.add();
      myLayerRef.kind = LayerKind.TEXT;
      myLayerRef.name = "Filename";
      var myTextRef = myLayerRef.textItem;
      // strip the extension off
      var fileNameNoExtension = docRef.name;
      fileNameNoExtension = fileNameNoExtension.split( "." );
      if ( fileNameNoExtension.length > 1 ) {
       fileNameNoExtension.length--;
      fileNameNoExtension = fileNameNoExtension.join(".");
      myTextRef.contents = fileNameNoExtension;
      // off set the text to be in the middle
      myTextRef.position = new Array( docRef.width / 2, docRef.height / 2 );
      myTextRef.size = 12;
            myTextRef.font="Arial-BoldMT"
            //set position of text
            myTextRef.justification = Justification.CENTER;
            myTextRef.kind = TextType.PARAGRAPHTEXT;
            myTextRef.width= docRef.width;
            myTextRef.height= docRef.height/ 2;
            myTextRef.position= [0, docRef.height * 0.88];
    catch( e )
      // An error occurred. Restore ruler units, then propagate the error back
      // to the user
      preferences.rulerUnits = originalRulerUnits;
      throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );
    Can the position be changed to allow more rows of text but keep it aligned with the bottom of the layer?
    How can I script in a way to make the image resize based on the amount of text lines?
    Any help would be greatly appreciated.

    You can add a text layer any where the only thing you need to worry about is the size of the font you use.  You can normally calculate a font size by saving the images resoltuion and then setting its resolution to 72 DPI calculate a font size basied of the images pixel width and the number of characters you want in a line. After adding the text layer you can restore the image to its original resolution and align the text layer by making a selection and alignint the text layer to the selection.  There are nine posibilites like the positions in the selection you can align to like a tick tack toe board. You need to use a script to add the text layer because your retrieving the filename.  The positioning of the text layer could be done easily in an action the would use the scriot to add a text layer the do a select all  the align the added text layer to the selection.
    About your script don't make text paragraph just add new line characters to make a multi line text layer So it can be positioned easily
    I do just that with my stampexif action.  The action uses my stampexif Photoshop java script to add a multi line text layer containing some formatted EXIF data then the action centers the text layer and add a layer style to it. Link http://www.mouseprints.net/old/dpr/StampExif.jsx Example

Maybe you are looking for

  • I can't verify an email address for my Apple ID.

    It is an ID I've had forever, that most of my iTunes and iPhone app accounts are linked to. After I updated to iOS7 (last night) now it won't recognize my yahoo email. I go to the manage my account site and click "verify this address" and nothing hap

  • How do i identify how old my imac is?

    how old is my iMac?  Can I use an external monitor to extend the desktop?

  • How do I get Firefox to start up without trying to dialout? (Work offline setting is not saved on restart.)

    My home page is a local file. I do not want my browser dialing out at start up. It is hard to tell if there is a trojan or virus when it tries to dial out before I try to load a page. I turn off most automatic updates on extensions that have a settin

  • Refresh button issue in dashboard

    Hi All , my requirement is the data should be update/refresh once i hit/click on refresh button only, i have 3 combo boxes once i select diff  values from combo boxes and once i hit/click  refresh button only the data should be updated in dashboard c

  • Message Server 2005Q4 configure failure

    When I attempt to configure Messaging Server I have one task that consistently fails. The task is FAILED: /opt/SUNWmsgsr/lib/ldapmodify -h hardy.internal -p 389 -D cn=Directory Manager -j /opt/SUNWmsgsr/lib/config-templates/cfgdir12207 -c -e /opt/SUN