Sprite small large bitmap drawing

Hello

I have a circSprite spirte I draw on a large drawingBitmapbitmap.

drawingBitmapData = new BitmapData (800, 600, true, 0);

drawingBitmap = new Bitmap (drawingBitmapData);

stage.addChild (drawingBitmap);

var circSprite:Sprite = new Sprite();

circSprite.graphics.beginFill(0xFF0000,0);

circSprite.graphics.drawRect (0,0,160,160);

circSprite.graphics.endFill ();

circSprite.graphics.beginFill(0xFF00FF,1);

circSprite.graphics.drawCircle (40,40,40);

circSprite.graphics.endFill ();

mat: matrix var new matrix());

drawingBitmapData.drawWithQuality (circSprite, Matt, null, null, null, true, StageQuality.MEDIUM);

I would like to move the circSpirte to another post (100 100) - how can I do this?

Thank you!

Rolf

update of the matrix:

var rect:Rectangle = new Rectangle (0,0,800,600);

var bgColor:uint = 0xffffff;  //<- use="" your="" stage="">

mast. TX += 3;

drawingBitmapData.fillRect (rect, bgColor);  //<- to="" make="" it="" look="" like="" the="" previously="" drawn="" object(s)="" were="">

drawingBitmapData.drawWithQuality (circSprite, Matt, null, null, null, true, StageQuality.MEDIUM);

Tags: Adobe Animate

Similar Questions

  • scrolling problem large bitmap image

    City previous forums:

    Comments: comments
    scrolling problem large bitmap image
    Posted: Sep 28, 2007 14:47
     
    I want to scroll through a large bitmap image.i have read previous threads.i have added a null field before bitmap field. But the big picture scrolls, but shows an arrow down.
    Please help me.
    Thanks in advance.

    wang0043

    Messages: 12
    Join date: September 2007

    Re: image to large bitmap scrolling problem
    Posted the: October 1, 2007 03:35
     
    I have the same problem. After testing different ways using the BitmapField, I just changed paint the bitmap on the screen instead. More write the paint method and use drawbitmap to draw the bitmap to the screen. Track action wheelball to paint the bitmap can achieve the effect of view.

    Comments
    Re: image to large bitmap scrolling problem
    Posted the: 3 October 2007 18:10
     
    Can you guys post the code on how it's done?
    Thank you

    Comments: vicky
    Re: image to large bitmap scrolling problem
    Posted the: July 19, 2008 02:33
     
    Hello

    I get the same scrolling image problem. Can you please suggest some way

    thanx

    What kind of manager added the BitmapField to?  The support of the Manager there vertical or horizontal scrolling style defined?

    Here is an example of code that I use to show how to scroll through a screen image:

    Scrolling Image recipe

    The image of "test.png" is in the same folder as the source of java if you want to download that as well.

  • Crop a part large bitmap shortly by given the height and width

    Hello guys '

    I need to combine the portion of the bitmap image in 4 large bitmaps. It's not a problem to combine.

    But I don't know how of the cultures of the big picture.

    are there any examples of code to just anyone?

    Please help me guys

    TNX'

    You can put the bitmap in a table, remove the pixels you want to go and recreate a bitmap image

  • Try to compensate a bitmap drawing

    I have a loaded image and I want to cut a number of rectangles to use on my screen. I can copy the top-left corner with no problems, but if I try to compensate for my rectangle to copy it seems that copies that result are empty.

    The method to work is graphicLoaded and if I use any x, y offset I get 25 copies of the top left corner. But if I use a shift, a single chart. I know that I must look at this evil, but can not understand. Any help would be appreciated.

    package
    {
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.display.Sprite;
    import flash.display.Loader;
    Import 12345678910111213import;
    import flash.display.BitmapData;
    import flash.geom.Rectangle;
    import flash.events. *;
    flash.net import. *;
    /**
    * ...
    * @author Chris
    */
    SerializableAttribute public class GraphicTest extends MovieClip
    {
    private var background: DisplayObject, in the foreground: DisplayObject;
    private var url: String = "spintest.jpg";
    private var loader: Loader = new Loader ();
    private var layout: Array = new Array();

    public void GraphicTest()
    {
    If (stage)

    {

    init (new Event ("Event"));
    }
    on the other
    {

    addEventListener (Event.ADDED_TO_STAGE, init);
    }
    }

    private void init(e:Event):void
    {
    removeEventListener (Event.ADDED_TO_STAGE, init)
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, graphicLoaded);

    Loader.Load (new URLRequest (url));

    }

    private void graphicLoaded(event:Event):void
    {

    var doWidth:Number = 128;
    var doHeight:Number = 96;
    var bmp:Bitmap;
    var bd:BitmapData;
    var x: Number, y: Number;
    var cliprect:Rectangle;
    for (x = 0; x < 5; x ++)
    {
    layout [x] = new Array();
    for (y = 0; y < 5; y ++)
    {

    BD = new BitmapData (doWidth, doHeight, true, 0xffffff);
    BMP = new Bitmap (bd);

    clipRect = new Rectangle (x * doWidth, y * doHeight, doWidth, doHeight);
    trace (clipRect);
    EDI Draw (charger, null, null, null, cliprect, false);


    BMP.x = x * doWidth;
    BMP.y = y * doHeight;


    addChild (bmp);

    layout [x] [y] = bmp;

    }
    }

    stage.addChild (this);
    Background = loader;

    }

    }

    }

    The cliprect to draw() is a Rect. _destination_... not a Rect. source try to replace the line to draw with this copyPixels line:

    bd.copyPixels (loader, clipRect, new Point (0, 0));

  • 5 times more large bitmap?

    import flash.display.BitmapData;

    holder1._visible = false;
    holder1b._visible = false;
    one_slct.onRelease = function() {}
    var bmd:BitmapData = new BitmapData (300,200);
    BMD. Draw (_root.gmb_mc);
    holder1.attachBitmap (BMD, 1);
    };

    The size of the original MC is 300 x 200. Using the above code how can I convert it to a bitmap 5 times larger than the original MC? (the original MC is a vector drawing)
    import flash.display.BitmapData;
    to import flash.geom.Matrix;
    holder1._visible = false;
    holder1b._visible = false;
    one_slct.onRelease = function() {}
    var bmd:BitmapData = new BitmapData (1500,1000);
    mat: matrix var new matrix());
    mat.a is mat.d = 5;.
    BMD. Draw (_root.gmb_mc, Matt);
    holder1.attachBitmap (BMD, 1);
    };
  • Bitmap drawing

    Hello

    I'm a newbie to blackberry experience a custom UI control. I would like to know if it is possible to draw a bitmap to a x and position there and stretch that bitmap to a desired width and height.  Also I am interested to know if I could change the color of the pixels of the bitmap image. Code snippets would be great! Thank you!

    The following link to solve your problem of Bitmap scale

    http://supportforums.BlackBerry.com/T5/Java-development/zoom-on-bitmap-field/m-p/501235#M101442

    and according to the function change the color of the pixel in the Bitmap to set the RBG value.

    This function returns the new Bitmap with different colors.

    public static Bitmap generateHitBitmap(Bitmap passBitmap) {
             Bitmap retBitmap;  // Altered, tinted bitmap being returned
             int[] argbData; // Array holding the ARGB data
             int redData;  // The red value of a pixel
    
             // Create a new, empty bitmap with the same dimensions
             retBitmap = new Bitmap(passBitmap.getType(), passBitmap.getWidth(), passBitmap.getHeight());
    
             // Prepare the ARGB array
             argbData = new int[passBitmap.getWidth() * passBitmap.getHeight()];
    
             // Grab the ARGB data
             passBitmap.getARGB(argbData, 0, passBitmap.getWidth(), 0, 0, passBitmap.getWidth(), passBitmap.getHeight());
    
             // Loop through each pixel in the array
             for (int lcv = 0 ; lcv < argbData.length ; lcv++) {
                // Get the red data by masking out the 2nd byte
                redData = (argbData[lcv] & 0x00FF0000) >> 16;
    
                // Increase the red value by 80 (maximum of 255)
                redData += 80;
                if (redData > 255) redData = 255;
    
                // Shift it back to the right place, and set it back into array
                redData = redData << 16;
                argbData[lcv] = (argbData[lcv] & 0xFF00FFFF) + redData;
             }
    
             //  Set the return Bitmap to use this altered ARGB array
             retBitmap.setARGB(argbData, 0, passBitmap.getWidth(), 0, 0, passBitmap.getWidth(), passBitmap.getHeight());
    
             return retBitmap;
          }
    

    Thank you

    Vivek Kumar Srivastava

  • App - small on screen drawing space?

    Hello, I wrote a drawing application. All over the screen is used as the design with the exception of a small area at the bottom of the screen and a small area on the side of the screen. These small areas contain buttons for the different options in my application.

    I'm a little confused about the uses and what exactly these sweeping gestures are leaving the app, minimize application etc... I want to know if there's a chance that when the user is "drag" his finger draw the app will be released because a gesture of exit app event will be dispatched.

    There are some areas that I should turn off the drawing canvas?

    BONE scan gestures are recognized on the bezel (not the screen).

    You should be able to use the entire screen without any problems.

  • Enter small/large letters - 40RL939 TV

    Hello
    How can I change the size of letters when you enter the password for WiFi? Default large letters are active, but my password also has letters and numbers, and I have no idea how to change it?

    Hello!

    I think you can change the size of the letters by pressing the color button. I don't remember witch. It is indicated at the bottom of the screen.

  • I'll make a small program that draw a curve function 2D using openGL, doable?

    1, I have a lot of sample data, it can be map plot a 2D of the distribution of the dot.

    2, then I need to climb a curve function, such as:

    CVI can use OpenGL functions: there is a specific OpenGL instrument located in \toolslib\custctrl\cviogl.fp. There is also an example of program that actually use the OGL functions to draw 3D sufraces: see the code in \apps\oglscxi fodler.

    That said, because you're dealing with 2D plots, do you really need OpenGL? All the steps you mentioned above could be addressed with the standard of CVI functions: for example, you can use a PlotXY () call properly formatted to draw the curves as in step #1, PolyFit () for calculating the interpolating to step #2 (which also goves the formula you as in step #5) and cursors to draw research as in the #4 step.

  • Ink cartridge 564 for C5380 v. small large

    I have a C5380 and bought a Photo Balck replacement cartridge. It is a CB317WA and the same (small) size as CMYK cartridges.

    Problem I have is that it replaces a CN684W, which is the largest size black Photo cartridge.

    The new (CB317WA) says it's for the C5380, but it does not in the Photo Black compartment. The re is a leg of positioning in the "rear" of the cratridges, in the sahpe of a 't'. on the small CMYK cartridges, this 't' is backwards. Pictured big black format, it is not. My black cartridge replacement Photo (CB317WA) is smaller but the hind is reversed and does not in the black slot Photo even if that's what it is designed for. (The packaging clearly States ONLY for 5 printers cartridge and lists as C5380 supported.)

    I do not understand what I did wrong...

    Hello there editor61, I hope you are well

    I read your post on ink, disorders of the cartridge. It seems the sound that you can try to insert the photo black cartridge in the slot of regular black ink, which will not work.

    This is a link to a guide that will show you what ink is what reference number:

    Ink cartridge information

    Also, here is a guide for the replacement of the ink cartridges

    If there is still a problem with the ink cartridges, contact HP directly to your options with them:

    If you call in North America, the number is 1-800-474-6836 and for all other regions: click here.

    Have a great Tuesday

  • does anyone know if the new iPhone is more smaller, larger or the same size as thye 5s?

    does anyone know if the new iPhone is the same size as the 5s?

    As stated on the website of Apple, which is at your disposal, it is the same.

  • Bitmap Sprite

    Hi, I have a problem how addChild bitmap Sprite. I have a bitmap image in my library. Now, I want to add in my display object "Sprite". I can put my movieClip library bitmap, but I want to do in pure as3. Please give me an idea.

    Your library bitmap image must have a class name - which will extend from BitmapData. If you just need to make a new Bitmap with it and then add the bitmap to the sprite:

    var spr:Sprite = new Sprite();
    var bmp:Bitmap = new Bitmap (new mybitmap (500,500)); requires a 500 x 500 with mybitmap class name bitmap in the library
    spr.addChild (bmp);
    addChild (RPD);

  • Can't scale bitmap smooth down

    smooth.JPG

    Hello

    I work on the text deforming and here's some of my code

    var shape: Shape = new Shape();

    shape.graphics.beginBitmapFill (bitmap.bitmapData.clone (), true, false, null);

    As you can see I put 'true' in the 'smooth' setting and this runs bi-lineaire interpolation when the bitmap stretches.

    However, when a large bitmap is reduced, no interpolation is performed and result is not smooth (see the inserted picture)

    What should I do to create bitmap looking for gentle content?

    You just draw (n) version deformed mesh full size to a BitmapData, then used that BMD on the scale?

    I did not mesh distorted anything before you import, but if you can draw as vector data correctly in pixels (BMD) then you can scale this object converted using the matrix. A 2-step procedure is not ideal, but it is relatively expensive if you are not all images.

  • Help decide whether to use vector/bitmap when you use createjs to export to html5

    I am using the createjs exporter to create one, click on html5 and explore the application. I am trying to get information on whether to use bitmap or vector for my components I see General information that bitmap create vector and additional memory is CPU intensive (especially on mobile), but I would like to have a deeper understanding so I can make better decisions.  I also see support in the shade and maybe some layer of mixture - and I'm curious to know how performance and impacts.  This project will essentially be a background image with different sprites animating several frames on the screen. Are there cases where I should use for my background image vector - or is this a death sentence for mobile devices? Are there any circumstances where his prefeable to use the vector in my animations?  What is worse on mobile performance - a vector full screen background or a sprite small vector storyboarding?

    I am ready to start this project (which is intended to display in PC and mobile as html5), but I'm trying to decide if its wise to make all of this vector, or just convert everything to bitmap.

    Did someone either give me advice or have existing discussions or documentation you can refer me to?

    Thank you.

    the only way to know if the addition of a function (as shadow) will ruin your app is to try it.

    There is probably no instance where a background image of vector occur so a bitmap image.  but, the bitmap memory requirements must not exceed available memory, and to call something an image background means, the background image is always in the background and its representation in the form of bitmap does not change frequently.

    because it's so much easier to use with flash vectors, you would usually create an app for the most part vectorized (using the cacheAsBitmap and cacheAsBitmapMatrix everywhere, it is useful, but being aware of the limited memory, you can use) and test performance frequently during development.  If the performance is sufficient, you're good.

    If performance is unacceptable, you will need to check you're exceeds the available memory and the loss of cacheAsBitmap, and if you put much strain of the processor using manipulation of vector.

  • Loading a display in a Bitmap object

    I try to load a sprite into a bitmap, but cannot get the sprite to fill the bitmap image. Here are the results I get:

    http://CID-a4f813eb28a76ba8.SkyDrive.live.com/self.aspx/.public/BitmapIssue.PNG

    Here are the applicable part of the code that I use that gets these results:

    function() {return A.apply (null, [this] .concat ($A (arguments)))}

    addChild (container); Add sprite to see full size
    BD = new BitmapData (container.width, container.height, false, 0xff0000); color for effect
    b = new Bitmap (bd);
    EDI Draw (container);
    addChild (b); Add bitmap image to compare to sprite

    Try:

    to import flash.geom.Matrix;

    function() {return A.apply (null, [this] .concat ($A (arguments)))}

    addChild (container); Add sprite to see full size
    BD = new BitmapData (container.width, container.height, false, 0xff0000); color for effect
    b = new Bitmap (bd);

    var mat: Matrix = container.transform.matrix;

    mast. TX = - mat.tx;

    mast. Ty = - mat.ty;

    EDI Draw (Container, Matt);
    addChild (b); Add bitmap image to compare to sprite

Maybe you are looking for

  • I get an incorrect sender address when I discovered the email from the sender; Why is this happening?

    The emails that I receive as an invitation to iSqFt.com submission are the list of the sender as a contractor, but when I find out they are actually ITB leave another contractor. iSqFt.com said they did research on their end and so they referred me t

  • Skype auto log on when I connect

    Hey! When I try to log on to Skype my Skype to disconnects me directly! Someone knows how to fix this?

  • Increase the size of RAM if I update the BIOS?

    Hi everyone out there! I was told that my BIOS update would more RAM from 1 GB to be installed in my Compaq Presario S5200UK with ASUSTeK A7N8X - motherboard. Is it good or bad? I have upgraded the BIOS V3.14 to V3.21 then went online to a retailer o

  • Studio report - sum dynamic lines?

    Well, I have to build a relationship with cost center and the dimensions of the employee on the line and time in the column.  The thing is I want to give me only the cost center\employee combinations that have given and a subtotal of each cost center

  • How can I add two values together?

    I use the tip action:Expression: variable1 = variable1 + '1 '.I wish that Captivate to add '1' to the previous value of variable1, not add them.  If variable1 began as 154, after the expression is executed, it must so 1541, not 155.Is it possible to