scale objects (bitmaps)

Hello

I had this imported bitmap (png file) and putting in a mc.
When I run the memoranda of agreement top id like to increase by 20% or something like that.

{run}
this.scaleX = 120;
}

Any tips?

Eric

Never mind :)

{run}
var myScale:Number = 120;
This ._xscale = myScale;
This ._yscale = myScale;
}

See you soon!

Eric

Tags: Adobe Animate

Similar Questions

  • V18.1.1 Illustrator don't scale objects with pointer

    as of today, January 19, 2014, with the object selection tool I can't scale objects individually or in a group! AAARGH! It's a quite necessary feature, anyone else having this problem?

    You may have inadvertently pressed Ctrl / Cmd + Shift + B. the shortcut to hide the rectangle enclosing. Press it again to display the bounding box, or the view menu, choose show the rectangle enclosing.

  • Scale object with Panel programmatically?

    Is there a way to activate the 'Object of scale with Panel' property of an object to front panel by programming?  It doesn't seem to be possible, but I wanted to check before you give up and do a hack to find a different solution.

    I think that the component "scaling" method will work for you.

  • Can I scale to bitmap or bitmapField?

    Image bitmap bitmap = Bitmap.getBitmapResource (fileName);
    BitmapField bitmapField = new BitmapField (bitmap, BitmapField.FIELD_HCENTER);

    I have Bittmap and I need scale it... can you hel me please?

    You can find a lot of discussion about it by typing 'ladder' in the search box, give it a try.
    first train: http://supportforums.blackberry.com/t5/Java-Development/Rotate-and-scale-bitmaps/ta-p/492524

    Also, check the int http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/EncodedImage.html#scale... )

  • How to convert the object Bitmap to byteArray.

    Hi all

    I had a problem in the conversion of the bitmap object to. BMP file.

    (Real need: capture the screen shot and convert that turned to the screen.) BMP image and I have to keep this image in the SCARD

    I shouldn't use any PNGEncodedImage or JPEGEncodedImage )

    I capture the screen shot using the

    Bitmap BM = new Bitmap (width, height);

    Display.screenshot (WB);

    to get the data from [] bytes of this bitmap object that I use

    Byte [] _bytes = getBytesFromBitmap (bitmap);

    public byte [] getBytesFromBitmap (Bitmap bmp) {}
    try {}
    int height = bmp.getHeight ();
    int width = bmp.getWidth ();
    int [] rgbdata = new int [width * height];
    ByteArrayOutputStream Bos = new ByteArrayOutputStream();
    DataOutputStream back = new DataOutputStream (bos);
    Graphics g = new Graphics (bmp);
    bmp.getARGB(rgbdata,0,width,0,0,width,height);
    for (int i = 0; i)< rgbdata.length="" ;="" i++)="">
    If (rgbdata [i]! = - 1) {}
    dos.writeInt (i);
    back. Flush();
    //l++;
    }
    }
    Bos.Flush ();
    Return bos.toByteArray ();
    }
    catch (Exception ex) {}
    Dialog.Alert ("getBytesFromBitmap:" + ex.toString ());
    Returns a null value.
    }

    If I use this byte array in the Sub statement I get the "IllegalArgumentException".

    BMPEncodedImage.createEncodedImage (_bytes, 0, _bytes .length);

    all can help me how I can get the byte [] data from the bitmap object?

    import java.io.ByteArrayOutputStream;import java.io.DataOutputStream;import java.io.IOException;
    
    import javax.microedition.lcdui.Image;
    
    /** * @author Samuel Halliday */public final class BMPGenerator {
    
        /**     * @param image     * @return     * @throws IOException     * @see {@link #encodeBMP(int[], int, int)}     */    public static byte[] encodeBMP(Image image) throws IOException {        int width = image.getWidth();        int height = image.getHeight();        int[] rgb = new int[height * width];        image.getRGB(rgb, 0, width, 0, 0, width, height);        return encodeBMP(rgb, width, height);    }
    
        /**     * A self-contained BMP generator, which takes a byte array (without any unusual     * offsets) extracted from an {@link Image}. The target platform is J2ME. You may     * wish to use the convenience method {@link #encodeBMP(Image)} instead of this.     * 

    * A BMP file consists of 4 parts:- *

      *
    • header
    • *
    • information header
    • *
    • optional palette
    • *
    • image data
    • *
    * At this time only 24 bit uncompressed BMPs with Windows V3 headers can be created. * Future releases may become much more space-efficient, but will most likely be * ditched in favour of a PNG generator. * * @param rgb * @param width * @param height * @return * @throws IOException * @see http://en.wikipedia.org/wiki/Windows_bitmap */ public static byte[] encodeBMP(int[] rgb, int width, int height) throws IOException { int pad = (4 - (width % 4)) % 4; // the size of the BMP file in bytes int size = 14 + 40 + height * (pad + width * 3); ByteArrayOutputStream bytes = new ByteArrayOutputStream(size); DataOutputStream stream = new DataOutputStream(bytes); // HEADER // the magic number used to identify the BMP file: 0x42 0x4D stream.writeByte(0x42); stream.writeByte(0x4D); stream.writeInt(swapEndian(size)); // reserved stream.writeInt(0); // the offset, i.e. starting address of the bitmap data stream.writeInt(swapEndian(14 + 40)); // INFORMATION HEADER (Windows V3 header) // the size of this header (40 bytes) stream.writeInt(swapEndian(40)); // the bitmap width in pixels (signed integer). stream.writeInt(swapEndian(width)); // the bitmap height in pixels (signed integer). stream.writeInt(swapEndian(height)); // the number of colour planes being used. Must be set to 1. stream.writeShort(swapEndian((short) 1)); // the number of bits per pixel, which is the colour depth of the image. stream.writeShort(swapEndian((short) 24)); // the compression method being used. stream.writeInt(0); // image size. The size of the raw bitmap data. 0 is valid for uncompressed. stream.writeInt(0); // the horizontal resolution of the image. (pixel per meter, signed integer) stream.writeInt(0); // the vertical resolution of the image. (pixel per meter, signed integer) stream.writeInt(0); // the number of colours in the colour palette, or 0 to default to 2n. stream.writeInt(0); // the number of important colours used, or 0 when every colour is important; // generally ignored. stream.writeInt(0); // PALETTE // none for 24 bit depth // IMAGE DATA // starting in the bottom left, working right and then up // a series of 3 bytes per pixel in the order B G R. for (int j = height - 1; j >= 0; j--) { for (int i = 0; i < width; i++) { int val = rgb[i + width * j]; stream.writeByte(val & 0x000000FF); stream.writeByte((val >>> 8 ) & 0x000000FF); stream.writeByte((val >>> 16) & 0x000000FF); } // number of bytes in each row must be padded to multiple of 4 for (int i = 0; i < pad; i++) { stream.writeByte(0); } } byte[] out = bytes.toByteArray(); bytes.close(); // quick consistency check if (out.length != size) throw new RuntimeException("bad math"); return out; } /** * Swap the Endian-ness of a 32 bit integer. * * @param value * @return */ private static int swapEndian(int value) { int b1 = value & 0xff; int b2 = (value >> 8 ) & 0xff; int b3 = (value >> 16) & 0xff; int b4 = (value >> 24) & 0xff; return b1 << 24 | b2 << 16 | b3 << 8 | b4 << 0; } /** * Swap the Endian-ness of a 16 bit integer. * * @param value * @return */ private static short swapEndian(short value) { int b1 = value & 0xff; int b2 = (value >> 8 ) & 0xff; return (short) (b1 << 8 | b2 << 0); } } Found form the Link mentioned below:
    http://javablog.co.uk/2007/12/26/j2me-bitmap-encoder/
  • size of an object Bitmap to 256 X 256.

    Hello

    How to estimate the size of the Bitmap a256X256 object.

    I want to use it to estimate the number of Bitmaps, I can be cached for a specific device. I wish that the size of the cache to be higher for devices with 128 MB of RAM and lower for those with 32 MB of Ram.

    -MO.

    Just used statistics from the memory of the JDE.  The RAM allocated to a Bitmap to 256 * 258 is 181248 allocated and 131460 used.

  • How to scale objects in one layer with each object in the same position

    I have a card with symbols on it, placed exactly where they should be. Is it possible to scale all the objects in a layer or group to be bigger, but not treat them as a layer that is stretched to scale proportionally? Basically, how could I do each larger symbol as if each is to be climbed from their centres?

    I tried to select a layer so that each object is selected, and then transforming them (specifying a percentage of the scale). As a result, the objects are enlarged, but it produces the same results as a normal click and drag the corner alignment point. Any ideas?

    Object--> transform each. Each object / group object must be properly structured and selected individually.

    Mylenium

  • Why add text in a text box scale objects below it.

    Y at - it an option to prevent this?

    Here is a screenshot before that I'm trying to add text.

    2015-09-08_1423.png

    and after I add text it resizes objects in the background.

    2015-09-08_1426.png

    These objects are not grouped or link, so I do not understand why it would impact them. Help, please.

    Remove empty carriage returns after the text in the text block. (Click on the insertion at the end of the text. Then arrow down until you can not arrow down more. Then press the delete key until the caret upward at the end of the text.) Blank lines are forcing the text block to grow to make room for them, which in turn causes the rectangle behind to grow.

  • How to get flat scale objects

    All the tools, object ellipse, square, Hexagon and star are not flat when I go out one... looks like they're on a plan in perspective, but I can't find a setting?

    Hide perspective grid. CMD + SHIFT + I

    See menu display

    See the manual

    Illustrator help | On the Perspective grid

  • Scale multiple objects, with the Center as a reference point, without moving the Group

    Hello-

    I want to scale multiple objects, their Center, without moving the group. I found how to change the objects of the Centre (setting of the reference point in the transformation to the Center and using the free transform tool Panel), but I would choose a bunch of objects and move towards the top of the Center, without the group get larger.

    I want to use it for the highlights on the plans. Say I have 25 small circles with numbers in them on the plan and I want to blow up to 200%, but I want to stay in the same place, is it possible to do both? Or do I have to re - intensify each object individually? The problem that I am running is even if I'm upgrading the scale objects from the Center, the moving objects and losing their place on the map. So, I made each of them individually.

    Thanks for any help!

    Not quite what you want, but if you make one, you can select the rest and the object > transform again > transform again individually.

  • Solution to resize properly transparent bitmaps

    Hello everyone,

    Recently, I tried to use Bitmap.scaleInto () to resize the transparent bitmap images in my application. Although this feature is a nice addition to JDE 5, it tends to produce bad results on the transparent bitmaps such as PNG24 files. The Forum posts that I found on the web for this problem talk using Bitmap.createAlpha () which restores transparency, but still produces artifacts in the final bitmap as the white edges and colours of the wicked pixels.

    To resolve this problem without the use of an external library, I created the following function. He always uses scaleInto(), but in a different way. I added some comments in the service and created a screenshot showing the results before and after (don't worry about the photos, they are a part of this project, I am working currently on). I write the result here in the hope that it will help others looking to achieve the same thing. The code has been tested in JDE 5 and 6 of JDE and the sample photos have been created using different combinations of types of filters and reports l / h.

    package com.patchou.ui;import net.rim.device.api.system.Bitmap;import net.rim.device.api.ui.Color;import net.rim.device.api.ui.Graphics;/** * * @author    Patchou * @version   1.01 * */public class GPATools{    /**     * Resizes a bitmap with an alpha channel (transparency) without the artifacts introduced     *   by scaleInto().     *     * @param bmpSrc        Source Bitmap     * @param nWidth        New Width     * @param nHeight       New Height     * @param nFilterType   Filter quality to use. Can be Bitmap.FILTER_LANCZOS,     *                           Bitmap.FILTER_BILINEAR or     *                           Bitmap.FILTER_BOX.     * @param nAspectRatio  Specifies how the picture is resized. Can be     *                           Bitmap.SCALE_TO_FIT,     *                           Bitmap.SCALE_TO_FILL or     *                           Bitmap.SCALE_STRETCH.     * @return              The resized Bitmap in a new object.     */    public static Bitmap ResizeTransparentBitmap(Bitmap bmpSrc, int nWidth, int nHeight, int nFilterType, int nAspectRatio)    {        if(bmpsrc== null)            return null;
    
            //Get the original dimensions of the bitmap        int nOriginWidth = bmpSrc.getWidth();        int nOriginHeight = bmpSrc.getHeight();        if(nWidth == nOriginWidth && nHeight == nOriginHeight)            return bmpSrc;
    
            //Prepare a drawing bitmap and graphic object        Bitmap bmpOrigin = new Bitmap(nOriginWidth, nOriginHeight);        Graphics graph = Graphics.create(bmpOrigin);
    
            //Create a line of transparent pixels for later use        int[] aEmptyLine = new int[nWidth];        for(int x = 0; x < nWidth; x++)            aEmptyLine[x] = 0x00000000;        //Create two scaled bitmaps        Bitmap[] bmpScaled = new Bitmap[2];        for(int i = 0; i < 2; i++)        {            //Draw the bitmap on a white background first, then on a black background            graph.setColor((i == 0) ? Color.WHITE : Color.BLACK);            graph.fillRect(0, 0, nOriginWidth, nOriginHeight);            graph.drawBitmap(0, 0, nOriginWidth, nOriginHeight, bmpSrc, 0, 0);
    
                //Create a new bitmap with the desired size            bmpScaled[i] = new Bitmap(nWidth, nHeight);            if(nAspectRatio == Bitmap.SCALE_TO_FIT)            {                //Set the alpha channel of all pixels to 0 to ensure transparency is                //applied around the picture, if needed by the transformation                for(int y = 0; y < nHeight; y++)                    bmpScaled[i].setARGB(aEmptyLine, 0, nWidth, 0, y, nWidth, 1);            }
    
                //Scale the bitmap            bmpOrigin.scaleInto(bmpScaled[i], nFilterType, nAspectRatio);        }
    
            //Prepare objects for final iteration        Bitmap bmpFinal = bmpScaled[0];        int[][] aPixelLine = new int[2][nWidth];
    
            //Iterate every line of the two scaled bitmaps        for(int y = 0; y < nHeight; y++)        {            bmpScaled[0].getARGB(aPixelLine[0], 0, nWidth, 0, y, nWidth, 1);            bmpScaled[1].getARGB(aPixelLine[1], 0, nWidth, 0, y, nWidth, 1);
    
                //Check every pixel one by one            for(int x = 0; x < nWidth; x++)            {                //If the pixel was untouched (alpha channel still at 0), keep it transparent                if(((aPixelLine[0][x] >> 24) & 0xff) == 0)                    aPixelLine[0][x] = 0x00000000;                else                {                    //Compute the alpha value based on the difference of intensity                    //in the red channel                    int nAlpha = ((aPixelLine[1][x] >> 16) & 0xff) -                                    ((aPixelLine[0][x] >> 16) & 0xff) + 255;                    if(nAlpha == 0)                        aPixelLine[0][x] = 0x00000000; //Completely transparent                    else if(nAlpha >= 255)                        aPixelLine[0][x] |= 0xff000000; //Completely opaque                    else                    {                        //Compute the value of the each channel one by one                        int nRed = ((aPixelLine[0][x] >> 16 ) & 0xff);                        int nGreen = ((aPixelLine[0][x] >> 8 ) & 0xff);                        int nBlue = (aPixelLine[0][x] & 0xff);
    
                            nRed = (int)(255 + (255.0 * ((double)(nRed-255)/(double)nAlpha)));                        nGreen = (int)(255 + (255.0 * ((double)(nGreen-255)/(double)nAlpha)));                        nBlue = (int)(255 + (255.0 * ((double)(nBlue-255)/(double)nAlpha)));
    
                            if(nRed < 0) nRed = 0;                        if(nGreen < 0) nGreen = 0;                        if(nBlue < 0) nBlue = 0;                        aPixelLine[0][x] = nBlue | (nGreen<<8) | (nRed<<16) | (nAlpha<<24);                    }                }            }
    
                //Change the pixels of this line to their final value            bmpFinal.setARGB(aPixelLine[0], 0, nWidth, 0, y, nWidth, 1);        }        return bmpFinal;    }}
    
    
    
    

    Here's an example of how to call the function:

    Bitmap bmp = Bitmap.getBitmapResource("picture.png");Bitmap bmpResized = GPATools.ResizeTransparentBitmap(bmp, 30, 60,    Bitmap.FILTER_LANCZOS, Bitmap.SCALE_TO_FIT);
    

    Here is the result:

    Let me know if you find this useful, all comments are appreciated .

    Cyril

    Thank you . I made a minor adjustment to the code (to check if the size of the original image is identical to the desired size). For some reason, I can't edit my original post that I posted the latest version on my blog. Links: http://www.patchou.com/2010/10/resizing-transparent-bitmaps-with-the-blackberry-jde/ .

    Moderator note: I've updated the code in the original post to match the latest version.

  • Resize the object inside the tab control

    Hello

    I have problems with the design of a user interface. I need to have multiple controls resize with panel inside a tab control.

    I see it right, there is no way to have a resize done inside a tab with decorations control that separates controls?

    I have not yet checked LabVIEW 2013.

    I have attached a vi in LV2012 as an example.

    Thanks in advance.

    Yes it is a feature I've wanted also over the years.  Here's the first result that I got from the exchange of idea, but I think that there are duplicates autour.

    http://forums.NI.com/T5/LabVIEW-idea-exchange/ability-to-fit-scale-object-within-tab-control-page/ID...

    Basically, you can't do nativly but you can trick it work for you.  You make a tab that is false the user interacts with, changes to the value of another tab that things in it and then you fix every thing you want it is in the tab where it is demonstrated.  This works well if the thing in your tab is an element able to evolve to adapt to it, but if in a tab, you have a chart and another you have a bunch of buttons that should not change, then you will get a strange behavior.  You can tell the chart is more scope to this component, but then you lose the 'ladder while resizing objects' that make a lot more native user interface research.

  • Uh-oh, graphic / bitmap question

    I'm still fumbling... I have a working set of an on-line tutorial. He plans to use a background image loaded from a file and then it scrolls. It is very good. Now, instead of using a loaded image, I made my own code to, leave a bitmap object and graphic. But the game does not have my graphic object bitmap as it does the loaded bitmap. Just hang.

    I was not able to find good handling to make my generated background similar to the original bitmap, loaded, so that it uses the game engine. Of course, I will be continually change my BG, adding to the incoming end, as it scrolls.

    What Miss me? Thank you.

    Error of the programmer, gentlemen. _backgroundBM had been reported overall in the class, so that other methods would have access to it. I was accidentally declaring its local, in the method initBackground, and chaos ensued.

    Sorry for the inconvenience. But stick with me, because I have more problems to solve!

  • Bitmap scaling problem

    I have a simple yet unusual problem... I can't scale a bitmap despite the use of scaleinto class. BTW, I use the BB Torch Simulator.

    My code is as follows:

    Create background bitmap

    Image bitmap bmpBkg = Bitmap.getBitmapResource ("sunlight2.png");

    Bitmap scaling

    Scaledbitmap bitmap =new Bitmap (Display.getWidth (),Display.getHeight ());

    bmpBkg.scaleInto (scaledbitmap, Bitmap.FILTER_BILINEAR);

    The problem is that even after the operation of scaleinto the height and width of the bmpBkg remain the same...?

    Can someone help me with this please?

    Thank you.

    According to me, Miss me something here:

    After:

    bmpBkg.scaleInto (scaledbitmap, Bitmap.FILTER_BILINEAR);

    isn't the Bitmap scaling in scaledbitmap rather than bmpBkg?

  • Drawing Bitmap on the custom field

    If I have a custom component that extends the scope I am able to draw Bitmap on it?

    I try to shoot in object overrided method in this way.

     protected void paint(Graphics g)    {         Bitmap = Bitmap.getBitmapResource("test.bmp");        if(picture != null)            g.drawBitmap(getPreferredWidth()+5,                          getPreferredHeight() + 5,                          picture.getWidth(),                          picture.getHeight(),                         picture,                          0,                          0);
    
        }
    

    But no picture on my component.  Specified test.bmp exists as a resource and object Bitmap appears correctly. No exceptions occur.

    Any comments? Maybe it's impossible to draw a bitmap on component expanded in such a way?

    Thanks in advance.

    Thanks for your suggestion. The problem wasn't in extention but in the region of destination, top and left. X and there were calculated with respect to the top and left of the main screen instead of top and left of the custom my field.

    Your message dropped a hint on how to survey. Thank you very much!

Maybe you are looking for