Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 660
Registered: ‎10-08-2009
My Device: Bold 9900
My Carrier: Telus

Screenshot for submission

Hi, I am wondering how you guys are creating screenshots for submission.

 

The VMWare doesn't seem have take snapshot options so I'm printing screen then cropping in photoshop individually. Is there a better way to do this?

 

 

----------------------------------------------------------
Twitter: @gyubok
Developer
Posts: 229
Registered: ‎08-14-2009
My Device: Bold 9900, DevAlpha A
My Carrier: Vodafone DE

Re: Screenshot for submission

I personally use MS OneNote to take screenshots. It's pretty straight forward but it works. On Windows you could also use the build in "sniping tool" and there are lots of other tools out there.

Willy R.
-
If my post solved your problem, make it easier for others to find by Accepting it as a solution or provide a Kudo if it was helpful for you. Thanks.
Developer
Posts: 660
Registered: ‎10-08-2009
My Device: Bold 9900
My Carrier: Telus

Re: Screenshot for submission

Ah, snipping tool works great! Thanks for the suggestion!

----------------------------------------------------------
Twitter: @gyubok
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: Screenshot for submission

I screen shot the window (in Windows), cut out so its just the application part and then scale down to 640x375.

Developer
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook
My Carrier: N/A

Re: Screenshot for submission

[ Edited ]

if you're on Mac OS X you can press Command + Shift + 4 to bring up a screen shot selection tool, then optionally use Preview to scale/crop the images.


PlayBook Applications:
Drop Swatch
Trusted Contributor
Posts: 108
Registered: ‎12-28-2010
My Device: Free PlayBook
My Carrier: Verizon

Re: Screenshot for submission

In windows ctrl PrtScn to copy the simulator screen to the clipboard. Then paste in paint to crop it is how I do it.

Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Screenshot for submission

This sounded like a useful thing to automate, so I crufted together something one could integrate into an app.  I used the SWIPE_START event so merely clicking in the upper bezel area will trigger it, but you could attach it to any other event, or even have it run on a timer to save multiple images over time (with adjustments to the file name generation).

 

 

package
{
    import caurina.transitions.Tweener;

    import com.adobe.images.PNGEncoder;

    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.filesystem.File;
    import flash.filesystem.FileMode;
    import flash.filesystem.FileStream;
    import flash.geom.Matrix;
    import flash.text.TextFieldAutoSize;
    import flash.utils.ByteArray;

    import qnx.events.QNXApplicationEvent;
    import qnx.system.QNXApplication;
    import qnx.ui.text.Label;

    [SWF(height="600", width="1024", frameRate="30", backgroundColor="#cccccc")]
    public class Snapshot extends Sprite
    {
        public function Snapshot()
        {
            decorate();
            // install handler (replace with any other mechanism you wish)
            QNXApplication.qnxApplication.addEventListener(QNXApplicationEvent.SWIPE_START, swipeStart);
        }

        // populate with something for demo purposes
        public function decorate():void
        {
            graphics.beginFill(0x8833ee, 1);
            graphics.drawCircle(100, 100, 50);
            graphics.beginFill(0x923456, 0.8);
            graphics.drawRect(1024-100, 600-50, 100, 50);
            graphics.endFill();

            var title:Label = new Label();
            title.text = "Test Snapshot";
            title.width = 200;
            addChild(title);
        }

        private function swipeStart(e:Event):void
        {
            // save copy of entire stage, scaled to 62.5% size for App World screenshots
            const scale:Number = 0.625;
            var snap:BitmapData = new BitmapData(stage.stageWidth * scale, stage.stageHeight * scale);
            var mat:Matrix = new Matrix();
            mat.scale(scale, scale);
            snap.draw(stage, mat);

            // Save to /root/snapshot.png on simulator.  Retrieve using ftp
            var name:File = File.userDirectory.resolvePath('snapshot.png');
            var data:ByteArray = PNGEncoder.encode(snap);
            var file:FileStream = new FileStream();
            file.open(name, FileMode.WRITE);
            file.writeBytes(data);
            file.close();

            // optional gloss: indicate success
            var result:Label = new Label();
            result.text = "Snapshot saved to " + name.nativePath;
            result.autoSize = TextFieldAutoSize.LEFT;
            result.x = 200;
            result.y = 10;
            addChild(result);

            function removeResult():void { removeChild(result); }
            Tweener.addTween(result, {y: 300, time: 3, transition: "easeOutBounce",
                onComplete: removeResult});
        }
    }
}

 

 

You'll need to download and include the as3corelib library to get the PNGEncoder routine.

 

The above saves a single snapshot.png file scaled to 600x375 in the /root folder (which is currently where File.userDirectory points).  You can retrieve it from the simulator using FTP, connecting to the IP address of the simulator and logging in as user "root" with the same thing as the password.  If using a console version of FTP, type "binary" after logging in, then "get snapshot.png".  That will copy the file to your host machine in the current directory.  Users of graphical FTP clients are assumed to know how to use their software to do the same.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Highlighted
Trusted Contributor
Posts: 108
Registered: ‎12-28-2010
My Device: Free PlayBook
My Carrier: Verizon

Re: Screenshot for submission

Thanks for the post Peter. A friend asked me this morning if I knew how to do that.

Developer
Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: Screenshot for submission

Nice solution Peter. I used GIMP to create my screenshots.
-------------------------------------------
BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Screenshot for submission

The notes after my above screenshot code refer to using FTP to get the files out.  That's not possible with the new simulator (called Beta 2 or Beta 3 depending on who you ask, but 0.9.2 in any case).  There is an SSH mechanism, but using scp or sftp over it (the usual means) doesn't work yet.  I've summarized some workarounds in the meantime.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!