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 401901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:04:34+00:00 2026-05-12T17:04:34+00:00

Is it possible to make some kind of ‘dynamic’ thumbnails for mxml components which

  • 0

Is it possible to make some kind of ‘dynamic’ thumbnails for mxml components which I’m using in my application? By ‘dynamic’ I mean if I change some layout in mxml component, my thumbnail refreshes according to new layout without any screen capturing, photoshoping or similar =)

Edit:
I am using a FlexBook component, which makes a ‘book’ of mxml components (because each page has many independent interactions). I think that problem could be that bitmap data does not exist until I actually start to turn pages. But I would like to get bitmap data on creation complete.

Thanks!


Ok, let me try to explain little more because I see this is more complicated than I thought it will be..

I am using a FlexBook component, which makes a ‘book’ of mxml components (because each page has many independent interactions). I think that problem could be that bitmap data does not exist until I actually start to turn pages. But I would like to get bitmap data on creation complete…

Thanks for help!
m.

  • 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-12T17:04:34+00:00Added an answer on May 12, 2026 at 5:04 pm

    Here is a function I coded long time ago. It takes a DisplayObject(mxml components are DisplayObject too), it will return a Bitmap of it.

    You may write a handler to listen for Event.RENDER of the mxml component to update the Bitmap when the component is changed.

    Another thing you can try on the FlexBook component is to set creationPolicy="all"…

    /**
     * This function returns a Bitmap that have the same look of a given DisplayObject.
     * Ref.: http://qops.blogspot.com/2008/05/bitmap.html
     * @author Andy Li andy@onthewings.net
     * @version 20080529
     */
    package net.onthewings{
        import flash.geom.Point;
        import flash.geom.Rectangle;
        import flash.geom.Matrix;
        import flash.display.DisplayObject;
        import flash.display.Bitmap;
        import flash.display.BitmapData;
        import flash.display.PixelSnapping;
        import flash.display.Stage;
    
        public function bitmapEquivalentOf(obj:DisplayObject, extendsRectSidesBy:Number = 0, clipOutside = null,alpha:Boolean = true):Bitmap {
            if (obj.width && obj.height) {
                var bitmapData:BitmapData = new BitmapData(obj.width, obj.height, alpha, 0xFFFFFF);
                var rect:Rectangle = obj.getBounds(obj);
                var matrix:Matrix = new Matrix;
                matrix.translate(-rect.x, -rect.y);
                bitmapData.draw(obj, matrix);
                var bitmap:Bitmap = new Bitmap(bitmapData, PixelSnapping.AUTO, true);
                bitmap.x = rect.x;
                bitmap.y = rect.y;
                var ebd:BitmapData;
    
                if (clipOutside) {
                    var h:Number;
                    var w:Number;
                    if (clipOutside is Stage) {
                        h = clipOutside.stageHeight;
                        w = clipOutside.stageWidth;
                    } else {
                        h = clipOutside.height;
                        w = clipOutside.width;
                    }
                    if(!(h && w)){
                        return null;
                    }
                    var pt:Point = obj.localToGlobal(new Point(rect.x,rect.y));
                    ebd = new BitmapData(w, h, true, 0xFFFFFF);
                    ebd.copyPixels(bitmap.bitmapData,new Rectangle(-pt.x,-pt.y,w,h),new Point(0,0));
                    bitmap =  new Bitmap(ebd, PixelSnapping.AUTO, true);
                } else if (extendsRectSidesBy) {
                    ebd = new BitmapData(bitmapData.width+extendsRectSidesBy*2, bitmapData.height+extendsRectSidesBy*2, true, 0xFFFFFF);
                    ebd.copyPixels(bitmap.bitmapData,bitmap.bitmapData.rect,new Point(extendsRectSidesBy,extendsRectSidesBy));
                    bitmap =  new Bitmap(ebd, PixelSnapping.AUTO, true);
                    bitmap.x = rect.x - extendsRectSidesBy;
                    bitmap.y = rect.y - extendsRectSidesBy;
                }
                return bitmap;
            } else {
                return null;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Visual c# Express Edition, is it possible to make some (but not all)
Is it possible in ASP.NET to take a string containing some HTML and make
Is it possible to make a site with ASP.NET MVC Framework using .NET 2.0?
Is it possible to make such buttons ( http://img225.imageshack.us/img225/6452/buttonslw9.jpg ) using CSS? It should
I would like to make some kind of thumbnail with capturing BitmapData or ImageSnapshot
How is it possible to make prototype methods in C#.Net? In JavaScript, I can
Is it possible to make it appear to a system that a key was
Is it possible to make efficient queries that use the complete regular expression feature
Is it possible to make a POST request from Ruby with open-uri?
Is it possible to make the text in a TextBox unselectable without disabling the

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.