Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 676119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:53:35+00:00 2026-05-14T00:53:35+00:00

I can take snapshot of a component. But the problem is the component is

  • 0

I can take snapshot of a component. But the problem is the component is lil bigger with scroll bars. The saved image has scrollbars (only the visible area is getting saved). What i need is I want the entire component to be saved as an image.

This exact functionality is available while we print the component using FlexPrintJob, where by setting the FlexPrintJobScaleType.NONE.

But here in my case i want it to be saved using ImageSnapShot ( not thru FlexPrintJob ).

Thanks Advance,
Sriss

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:53:35+00:00Added an answer on May 14, 2026 at 12:53 am

    I thought I knew how to do this, but there seem to be lots of awkward issues. I got it working but it’s not nice. 🙁 Maybe you can improve on it.

    Here’s the code for an example application. And below is the code for the MyCanvas class. When you click the button an image of the Canvas container but without scrollbars should be drawn.

        <?xml version="1.0" encoding="utf-8"?>
        <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:my="*">
            <mx:Script><![CDATA[
                import flash.display.BitmapData;
                import flash.events.Event;
                import mx.containers.Canvas;
                import mx.graphics.ImageSnapshot;
                import flash.geom.Matrix;
                import mx.core.ScrollPolicy;
    
                public function onclick():void
                {
                    var bitmapData:BitmapData = ImageSnapshot.captureBitmapData(canvas);
                    canvas.addEventListener("BitMapReady", onBitMapReady);
                    canvas.horizontalScrollPolicy = ScrollPolicy.OFF;
                    canvas.CreateBitMapData();
                }
                private function onBitMapReady(e:Event):void
                {
                    DrawBitmapDataAt(canvas.bitMapData, 100, 100);
                    canvas.removeEventListener("BitMapReady", onBitMapReady);
                    canvas.horizontalScrollPolicy = ScrollPolicy.AUTO;
                }
                private function DrawBitmapDataAt(bitmapData:BitmapData,x:int,y:int):void
                {
                    var matrix:Matrix = new Matrix();
                    matrix.tx = x;
                    matrix.ty = y;
                    box.graphics.lineStyle(0,0,0);
                    box.graphics.beginBitmapFill(bitmapData, matrix, false);
                    box.graphics.drawRect(x,y,bitmapData.width,bitmapData.height);
                }
            ]]></mx:Script>
            <mx:Box id="box">
                <my:MyCanvas width="50" height="50" backgroundColor="white" id="canvas">
                    <mx:Button label="Hello" click="onclick()" />
                </my:MyCanvas>
            </mx:Box>
        </mx:Application>
    

    MyCanvas class:

    package  
    {
        import flash.events.Event;
        import flash.events.TimerEvent;
        import mx.containers.Canvas;
        import flash.display.BitmapData;
        import mx.core.ScrollPolicy;
        import mx.graphics.ImageSnapshot;
        import flash.utils.Timer;
    
        public class MyCanvas extends Canvas
        {
            public var bitMapData:BitmapData;
            private var creatingBitMap:Boolean = false;
            private var timer:Timer;
    
            public function CreateBitMapData():void
            {
                this.horizontalScrollPolicy = ScrollPolicy.OFF;
                creatingBitMap = true;
            }
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
            {
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                if (creatingBitMap == true && this.horizontalScrollBar == null)
                {
                    bitMapData = ImageSnapshot.captureBitmapData(this);
                    this.dispatchEvent(new Event("BitMapReady"));
                    creatingBitMap = false;
                    timer = new Timer(10);
                    timer.addEventListener(TimerEvent.TIMER, onTimer);
                    this.width += 1;
                    timer.start();
                }
            }
            private function onTimer(e:TimerEvent):void
            {
                this.width -= 1;
                trace("timer");
                timer.removeEventListener(TimerEvent.TIMER, onTimer);
                timer.stop();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How I can take snapshot of first page of PDF file in Linux? I
I'm working on a project wherein a user can take a snapshot of themselves
I'd like to take a snapshot of html and save it as image for
I want to make an app that can take a snapshot with the cam
Is there a good library I can use in c# to take a screenshot/snapshot?
can i get validation on weight which can take decimal values and also integer.
Scriptaculous's Effect.Morph can take a CSS class and apply it over a period of
Zlib::GzipReader can take an IO, or IO-like, object. as it's input, as stated in
Is there anyway we can take input from command line in Objective-C, the way
I have a complex action which can take a long time to run. If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.