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

Web and WebWorks Development

Reply
Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Window Covers in WebWorks app issue

Snapshot mode is a snapshot of the application window. You should be able to switch to that mode and set a region of the screen to take a snapshot of. When you call updateCover, it will take a snapshot and use it as the window cover.

 

The default mode is a snapshot, but of the entire screen.

 

The label is just a helper method with no direct control over the location.

 

You can totally use an image generated from a canvas. It would be up to you to paint what you want on the canvas, then capture it as a png and save to a file. Then you can apply that image as the cover using this API. You can get the size you need using this API as well.

Tim Windsor
Open Source Technical Lead
Developer
Posts: 114
Registered: ‎06-14-2010
My Device: Passport
My Carrier: Virgin Mobile Canada

Re: Window Covers in WebWorks app issue

I've been using Snapshot mode, but it doesn't work the way I expected: I use

 

	blackberry.ui.cover.setContent(blackberry.ui.cover.TYPE_SNAPSHOT, {
    	x: 0,
	y: 0,
	width: parseInt(theActiveFrameWidth),
	height: parseInt(theActiveFrameHeight)});

 but that just defines the region of the regular screen to show, it doesn't take a "snapshot" of that region.

 

What I would like to do is briefly show an HTML construct that is optimized for use as the Window Cover, then remove it from the screen and when the app is minimized have the already-snapped snapshot be used as the window cover.

 

There will be times where I want to rerender the Window Cover (when the contents change) and resnap it and store it again.

 

I would be happy if I could detect the swipe up gesture, render the object and do the snapshot... but I think it's too late to do more screen processing if the swipeup gesture has already occurred, right? That is, the Snapshot is taken as the static image of the app before the swipeup gesture starts, not during or after, correct?

Retired
Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Window Covers in WebWorks app issue

The blackberry.ui.cover.updateCover method is the one that should take the snapshot, after you've set the region with the setContent method.

 

If you turn on the run_when_backgrounded permission for your app, then you would be able to run the code you need to create the window cover. Then you'd be able to detect the pause event and still run some JavaScript.

Tim Windsor
Open Source Technical Lead
Developer
Posts: 114
Registered: ‎06-14-2010
My Device: Passport
My Carrier: Virgin Mobile Canada

Re: Window Covers in WebWorks app issue

I will try that right now! While i've got your ear, do you have any advice for resolving my other question related to sending HTML via invokeEmailComposer to send my data log as an HTML email replete with links that allow the recipient to see on a map where a transaction was recorded?

 

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Composing-a-HTML-email/m-p/28630...