Capturing bitmapData while in FullScreen

Is this possible?? Limitation with the Flash player?
I am trying to do an image capture while in full screen, however the full image area is only partially captured, or the coordinates are off (see images below). The document size is 100x700, and the stage is set not to scale / aligned to bottom.
I've been able to capture the right size, however it always seems to capturing the image from the wrong start x,y position. There is some elements out of bounds but I am just trying to clip them depending on the current stage width and height.
In the source files you will see a few of my attempts commented off (below/attached). Is anyone willing to help me troubleshoot this.
Fullscreen Capture :
Normal Capture :
CODE :
import com.adobe.images.JPGEncoder;
///---------- [ Set Variables ] --------///
var zeroPos:Number=0-stage.stageWidth;
var xPos:Number = (stage.stageWidth-mouseX)+zeroPos;
var xPos2:Number = (stage.stageWidth+mouseX)+zeroPos;
var centerpointW:Number = stage.stageWidth/2;
var centerpointH:Number = stage.stageHeight/2;
var stage_top:Number = stage.stageHeight-(stage.stageHeight*.95);
var stage_bottom:Number = stage.stageHeight*.95;
var gap_dist:Number = 1;
var section_dist:Number = 10;
///---------- [ Set Stage ] --------///
stage.quality=StageQuality.HIGH;
stage.align=StageAlign.BOTTOM;
StageScaleMode.NO_SCALE;
///---------- [ Save Wallpaper ] --------///
function createJPG(m:MovieClip, q:Number, fileName:String){
    //test_pos.x = test_pos.y = 0;
    //test_pos.x = 500;
    //test_pos.width = stage.stageWidth;
    var jpgSource:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight,false,0xFFCC00);
    //var jpgSource:BitmapData = grab( m, new Rectangle(500-centerpointW, (700-stage.stageHeight), stage.stageWidth, stage.stageHeight), true );
    var jpgData:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight,false,0xFFCC00);
    var trans:Matrix = new Matrix();
    //var screenRectangle:Rectangle = new Rectangle((0-500), (700-stage.stageHeight), stage.stageWidth, stage.stageHeight);
    var screenRectangle:Rectangle = new Rectangle(500-centerpointW, (700-stage.stageHeight), stage.stageWidth, stage.stageHeight);
    //var screenRectangle2:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
    var wp_myDate:Date = new Date();
    var wp_timeNow:Number = wp_myDate.getTime();
    //trans.translate(500-centerpointW, 700-stage.stageHeight);
    //jpgSource.draw(m);
    //jpgSource.draw(m, new Matrix(0, 0, 0, 0, 500-centerpointW, 700-stage.stageHeight));
    //jpgSource.draw(m, trans, null,null,null,true);
    //jpgSource.fillRect(screenRectangle, 0xFF0000);
    var mxx:Matrix = new Matrix();
    mxx.tx = 500-centerpointW;
    mxx.ty = 700-stage.stageHeight;
    //jpgSource.draw(m, mxx);
    jpgSource.draw(m, null, null,null,screenRectangle,true);
    //jpgSource.draw(m, new Matrix(1, 0, 0, 1, 500-centerpointW, 700-stage.stageHeight));
    jpgData.copyPixels( jpgSource, screenRectangle, new Point(0, 0) );
    //jpgData.copyPixels( jpgSource, screenRectangle2, new Point(0, 0) );
    jpgSource.dispose();
    var jpgEncoder:JPGEncoder = new JPGEncoder(q);
    var jpgStream:ByteArray = jpgEncoder.encode(jpgData);
    //var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
    var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream");
    var jpgURLRequest:URLRequest = new URLRequest ("screenshot_download.php?name=" + fileName + wp_timeNow.toString()+".jpg");
    var jpgURLLoader:URLLoader = new URLLoader();
    jpgURLRequest.requestHeaders.push(header);               
    jpgURLRequest.method = URLRequestMethod.POST;               
    jpgURLRequest.data = jpgStream;
    navigateToURL(jpgURLRequest, "_self");
function grab( source:DisplayObject, rect:Rectangle, smoothing:Boolean ):BitmapData{
    if( !source is IBitmapDrawable )
        throw new Error( "Cannot create BitmapData.  Source must implement IBitmapDrawable" );
    var bmpData1:BitmapData = new BitmapData( stage.stageWidth, stage.stageHeight, true, 0x00000000 );
    var bmpData2:BitmapData = new BitmapData( rect.width, rect.height, true, 0x00000000 );
    bmpData1.draw( source, null, null, null, null, smoothing );
    bmpData2.copyPixels( bmpData1, rect, new Point( 0, 0 ) );
    bmpData1.dispose();
    return bmpData2;
function onSaveWallpaper($event:MouseEvent):void {
    //stage.displayState=StageDisplayState.NORMAL;
    createJPG(this, 90, stage.stageWidth+"x"+stage.stageHeight);
captureTab.addEventListener(MouseEvent.CLICK, onSaveWallpaper);
///---------- [ Fullsreen Functions ] --------///
function showFullScreen($event:MouseEvent):void {
    stage.displayState=StageDisplayState.FULL_SCREEN;
    stage.align=StageAlign.BOTTOM;
fsTab.addEventListener(MouseEvent.CLICK, showFullScreen);
Here's the code for the php ("screenshot_download.php") :
<?php
if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
    // get bytearray
    $im = $GLOBALS["HTTP_RAW_POST_DATA"];
    // add headers for download dialog-box
    header('Content-Type: image/jpeg');
    header("Content-Disposition: attachment; filename=".$_GET['name']);
    echo $im;
}  else echo 'An error occured.';
?>

Thanks all. I was able to resolve this issue :
Here it is in action (right click for fullscreen option) :
http://todreamawake.com/beta_test.html?load_stage=main_menu
I decided to break from this while I worked on making other updates to the site. And yesterday I took another look at it, and took me about 15mins to relize what I was doing wrong. Turns out I had it in one of my attemps but my calculations was backwords.
    var jpgSource:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight);
    var trans:Matrix = new Matrix();
    trans.translate(centerpointW-500, stage.stageHeight-700);
     //  I had this as 500-centerpointW, 700-stage.stageHeight
    jpgSource.draw(m, trans, null,null,null,true);
    var jpgEncoder:JPGEncoder = new JPGEncoder(85);
    var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
    var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
     var jpgURLRequest:URLRequest = new URLRequest("screenshot_download.php?name=sketch_"+fileName);
    jpgURLRequest.requestHeaders.push(header);
    jpgURLRequest.method = URLRequestMethod.POST;
    jpgURLRequest.data = jpgStream;
     navigateToURL(jpgURLRequest, "_self");
Thanks again, I attached the updated FLA if it can help anyone else.

Similar Messages

  • JMF video while in Fullscreen Exclusive

    I am trying to show a video (using JMF) in my window while in fullscreen exclusive mode. Its for a game. It works occasionally. What I've done is turned of the repetitive rendering (from the game loop), and just added the visual component to the window (it can do its own painting). Sometimes it works fine, other times you just hear the sound, and other times its just grey or black.
    Does anybody have any idea how to get the current frame, and draw it so that I can keep the repetitive rendering (from the game loop) running.
    Any other ideas are appreciated too.

    Never written a fullscreen exclusive application. In fact, I've never even heard of such a thing.
    http://download.oracle.com/javase/tutorial/extra/fullscreen/exclusivemode.html
    "In full-screen exclusive applications, painting is usually done actively by the program itself"
    Ah. So no, I don't think JMF would support that because it's not going to be actively rendering, only passively rendering in response to paint requests. It's AWT/Swing based, after all...
    But, the fact that JMF doesn't support it does not mean JMF can't support it. JMF provides a custom Renderer interface which you could implement to actively render the stuff. It'll essentially give you a copy of the video frame in a Buffer object which you can then turn into an image using the BufferToImage class and then render that however you'd render an image for a full screen exclusive application...

  • Need to capture webinar while away from mac

    need to capture webinar while away from mac. automator is so complicated. is there a simpler better way to capture.
    thanks erryjay

    Hi,
    You would like to retrieve the returning value of the dynpro in a Batch input session ?
    bad idea
    try to make a CALL TRANSACTION inside a program. But you can't add you own logic inside a batch-input.
    Maybe you could do this using eCAT
    regards
    Fred

  • Flash Player freezes on 2nd monitor while playing fullscreen game on 1st one

    Flash Player freezes (shows something like slideshow with frame rate near 1-2 per sec, everything is ok with sound) on 2nd monitor while playing fullscreen game on 1st one.
    Windows 8, flash player 12, chrome.
    Tried to use other versions of flashplaers, other browsers - didnt help me.
    SOLVED: my computer for some reason didnt want to download updates. that was the reason of this problem.
    Thanks in advance.
    Philip

    Ok, Have just finished re-starting comp and have installed 10.3 & much to my suprise the games on Kongregat and Facebook are working. Have also, just to be safe checked the Firefox plug-in to make sure it was running the correct plug-in
    Shockwave Flash
    Shockwave Flash 10.3 r183
    I imagine this is it...I would have thought it should've been adobe flash but???  I will proccede to put it through the normal paces and pray it doesn't  die on me   will update as needed on this page.

  • PS CC 2014 gets stuck while going fullscreen (F key) with color plugins(eg. magicpicker/coolorus/kuler) enabled. Please Help.

    Hello,
    I am using Photoshop version 2014.2.2 (20141204.r.310x64) and Extension Manager version 7.3.2.39 running on a Windows 7 64-bit operating system with a Quadro K3000m graphics card and 16gb ram.
    I have a very peculiar problem which I am not able to find the solution for.
    If I have a color plugin enabled and I go fullscreen using the F key, photoshop gets stuck and it will only close when forcefully shut down using the task manager. No amount of waiting restores photoshop back. I first thought it was just one plugin - Magicpicker but then I removed it and installed Coolorus and still the same thing happened. Finally I tried Adobe Color and the same thing happens.
    I am unable to find a solution anywhere. It would be of great help if anybody can shine a light on this issue.
    Warmly.

    To rule out third party plugins, hold Shift while starting Photoshop. If that fails to help, try turning off GPU acceleration in the preferences and restarting Photoshop,
    Benjamin

  • Capture video while playing audio in WP8 or WP81

    Hi,
    Whenever I try to record a video using the CaptureSource it stops whatever audio was playing. How do I prevent recording video from stopping the audio being played?
    Thank you

    Hi Baracat,
    Could you explain any scenario why you want to capture the video while playing the audio? You want to record the audio played from your device to your video?
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Capture KeyboardEvent While Minimized

    Is it possible for an AIR application to capture a
    KeyboardEvent while it's minimized and out of focus?
    Thank you!

    Thank you for your posts!
    ASnewbie: Well, Google Desktop shows gadgets when you double
    click Shift. You can have any other application on focus and it
    will still show gadgets when you double click Shift.

  • Capturing Quantity while posting to AUC

    Hi
    While posting to AUC, we are trying to capture the quantity of asset.  In field status group for the GL and in posting key 70, we made quantity field as required entry.Still, the quantity field is not available on the screen.
    The client is insisting on capturing the quantity while posting to AUC.
    Regards
    Priyadarshini

    you can do the auc through "F-90"directly.

  • XScreensaver activates while running fullscreen SDL applications

    I have a fairly default install of Xscreensaver (i.e. nothing changed except certain screensavers selected/deselected) set to time out after 3 minutes. In some fullscreen applications, it will act as it should, but while running others-- seemingly those that use SDL-- it will activate, seemingly oblivious to the fact that input is still being received within the application. I have tested confirmed using Xonotic, which has GLX and SDL versions; the GLX version runs fine, but the SDL version does not disable the screensaver while running. I would prefer not to have to shut off the screensaver through xscreensaver-command -disable each time I run such an application. How can I universally fix this bug for my SDL programs?
    EDIT: I should note that I have not only tested this error in Xonotic. The same issue occurs in OpenArena, Dwarf Fortress, etc., all of which use SDL for, I suppose, input.
    Last edited by DrKillPatient (2012-07-01 06:18:42)

    I have a fairly default install of Xscreensaver (i.e. nothing changed except certain screensavers selected/deselected) set to time out after 3 minutes. In some fullscreen applications, it will act as it should, but while running others-- seemingly those that use SDL-- it will activate, seemingly oblivious to the fact that input is still being received within the application. I have tested confirmed using Xonotic, which has GLX and SDL versions; the GLX version runs fine, but the SDL version does not disable the screensaver while running. I would prefer not to have to shut off the screensaver through xscreensaver-command -disable each time I run such an application. How can I universally fix this bug for my SDL programs?
    EDIT: I should note that I have not only tested this error in Xonotic. The same issue occurs in OpenArena, Dwarf Fortress, etc., all of which use SDL for, I suppose, input.
    Last edited by DrKillPatient (2012-07-01 06:18:42)

  • ITunes 11 cut my subtitles while playing fullscreen

    Hi everyone,
    I updated to Mavericks today and got this problem.
    While I playing a movie without full screen, my subtitles are fine but If I play movie a fullscreen, iTunes cut my subtitles from the end of the movie frame.
    First Image : I'm playing a movie with Turkish subtitle on my desktop screen and subtitles are fine.
    Second Image : When I played a movie in fullscreen subtitles was cut from the end of the movie frame. (for eg. look at "Henry"s "y" letter.)
    I didn't have a that problem before upgrading to Mavericks.
    By the way, this black transparent frame is also new with Mavericks but I couldn't find the way to remove them.
    Thanks in advance.
    (Sorry for my English)

    Well, it seems that didn't really work. You can set your own style, but unless you use a Small (or I assume, Extra Small) as the text size, the subtitle will cut off on a film with a smaller aspect ratio than 1.85:1. For example: Star Trek: Into Darkness (AR 2.35:1) cuts off the subtitle below the film frame if the text size is Medium. Before Mavericks installation, subtitles for 2.35:1 films used to appear below the film frame in the black area; now they are in the film frame and cut off if they are two lines and text size Medium.

  • How do I show the bookmarks toolbar while in fullscreen on Firefox 20? In older versions you could edit the userChrome.css file. Does that still exist?

    After searching for this option, it appears it was very easy to do in older versions of firefox on windows 7. Many posts say you can edit the userChrome.css file to add:
    #PersonalToolbar[moz-collapsed="true"] {
    visibility: visible !important;
    However, on 2 machines with firefox 20, I've searched for that file and cannot find it. Does it even exist any more? if not, how can I set firefox to go to fullscreen mode and continue to show the bookmarks toolbar? Unchecking hide toolbars does not work for the bookmarks toolbar.

    userChrome.css does not exist by default. You can create it; it's an ordinary text file. Note that you do need a namespace at the beginning of the file.
    You could try this:
    @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
    #PersonalToolbar[moz-collapsed="true"]{
    visibility: visible !important;
    #navigator-toolbox[inFullscreen="true"]{
    margin-top:-62px !important;
    I added the second rule to prevents the toolbar area from rolling all the way up. The specific value may need to be adjusted by a few pixels depending on your toolbar heights.

  • Capturing audio while using airtunes?

    Does anybody out there know if there is a way to capture whats playing on Airtunes to an mp3 file? The stereo out mix cant be used because airtunes does not output through the soundcard. Thanks.

    Hi Stuart:
    Audio Hijack sounds like the solution for you: http://rogueamoeba.com/audiohijack/

  • ED not capturing properly while posting IR

    Hi
    I am facing problem when creating Invoice with ref to GR.
    In PO ED is capturing properly, in PartII also it is capturing ED properly,  But when I am trying to POST IR, if I go to simulate invoice it is showing wrong ED ie lesser than the actual amount to be captured. Please find solution. And I have checked G/L accs, acc keys, cond types.
    Regards
    venkat
    Edited by: garapati on Dec 21, 2007 10:19 AM

    Hi,
    Check whether all condition type in tax default (customization)are correct or not.
    Regards,
    Chetan.

  • Position controls (casing) while in fullScreen at the bottom of the screen

    Hi,
    I need to be able to position the controls at the very bottom of the screen and have the controls stretch from left to right - anyone know the code to acheive this?
    Having looked up Capabilities in the Help - totally confused me
    Kind Regards,
    Boxing Boom

    Hi,
    No not publishing at 100% x 100% and not using a scaleMode - full screen takeover is set to false. Just need a way to align the controls to stretch along the bottom while in full screen mode. The controls are in a separate mc - would the scaleX help me out here?
    Kind Regards,
    Boxing Boom

  • Runnng external swf Actionscript while in fullscreen mode

    I am using Flash 9.0 (CS3 Pro). I am coding in Actionscript
    3.0
    I have two swf files, both interactive. During playback of
    the, a mouse event launches the second. I also want the mouse event
    to trigger a switch to fullscreen mode. The second swf is
    non-linear and requires user input to jump to the appropriate frame
    of the timeline. Everything tests and runs perfectly during
    standard screen mode but whenever I try to load and play the
    external swf file in fullscreen mode, Flash recognizes the
    actionscript built into the original SWF but ignores all of the
    Actionscript (this.stop(), this.gotoAndPlay(), etc.) embedded in
    the second (external) swf file.
    How can I get external swf files to load with their scripted
    functionality in fullscreen mode?
    Thanks for the help.
    Aaron
    The code I am using is:
    // --- this is the code contained in the first swf file
    // function to launch second SWF file
    function movieLaunch(event:MouseEvent):void
    // Sets display mode to fullscreen. With this line present,
    Flash does not look at any Actionscript in ip.swf
    // If I comment the below line out, the second SWF plays
    correctly and has full functionality
    stage.displayState = "fullScreen";
    // load and launch second movie (ip.swf) which is located in
    the same directory
    var request:URLRequest = new URLRequest("ip.swf");
    var loader:Loader = new Loader();
    loader.load(request);
    addChild(loader);
    // Sets the listener for the button that will launch the
    second movie.
    launchMovieButton.addEventListener(MouseEvent.CLICK,
    movieLaunch);
    Text

    The keyboard is disabled in fullscreen mode. This may be
    causing the problem?

Maybe you are looking for

  • Page Setup options cached somewhere?

    I'm trying to help someone in my office who can no longer select "Tabloid" size paper in the Page Setup. We have a Xerox Splash G640 which gives me about fifteen different page sizes in the Page Setup window, but even after deleting her printer from

  • How to access to my Mac Book Pro's iTunes with Apple TV?

    All right, I'm new on Mac. Just bought a Mac Book Pro, Time Capsule, iPhone 5 and Apple TV! I'm using my TC as an external HD, since I allready have everything backed up on another non-wifi HD.I've already imported some files from the TC to iTunes. W

  • Formatting Excel Attachment output in SO_DOCUMENT_SEND_API1

    Hi ABAPers, I'm hoping someone can get me started with a requirement.  I"m using SO_DOCUMENT_SEND_API1 to email a file as an excel attachment.  I'm required for a four digit code to show as (0003).  Instead, when I open the excel attachment, it displ

  • Benefits in the portal

    Hi , I have the following doubts: We are implementing ESS-Benefits. In the portal the employees can add, display, remove benefits. The question is: ¿if the employee can do this operations, this can be danger if not exist a control for management this

  • Customizing exchange for ticketing system

    I posted this in a system center operations manager 2012 forum but maybe it belongs in a exchange 2010 forum. I set up subscriptions in SCOM to email out alerts when i get a hardware alert. I would like to send these email alerts directly to our tick