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

Java Development

Reply
Developer
Posts: 204
Registered: ‎08-09-2010
My Device: 9930, PlayBook
My Carrier: Verizon Wireless

Manipulating the graphics object when painting the browser field with overlays in OS 7

[ Edited ]

You have always been able to manipulate a display object such as a field or screen by overloading the paint() method. The project that I have been working on requires custom overlays and screen transitions on a browserfield (using RenderingApplication not BrowserField2). Unfortunately the browser field in OS 7 by default gets rendered on top of all other controls. I was able to work around this issue after Garett (gbeukeboom) helped resolve a ticket I submitted to JIRA:

https://www.blackberry.com/jira/browse/JAVAAPI-2141

What needed to be done is the following:

1) Create and add an AbsoluteFieldManager
2) Create a ComponentCanvas Manager
3) Add the BrowserField to the AbsoluteFieldManager
4) Add the ComponentCanvas to the AbsoluteFieldManager at the same location as the browser field
5) Add other fields to the ComponentCanvas (or perform custom paint operations)

I am performing all of the steps and am able to paint over the browser field. What I am unable to do at this point is call the paint method on any of the managers and actually get the graphics object that contains the rendered browserfield. I need to be able to do this so I can manipulate the final image that gets rendered. Does anyone have any suggestions?

Here are a couple of things I would like to do. Note: These already work in OS 6 and below:

-mirroring the graphical content of the browser field
-scanning lines of the image to find a "white" line so I can hide cut off text at bottom of the screen with a white rectangle
-animating graphical content of browser field

Thanks in advance!

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Manipulating the graphics object when painting the browser field with overlays in OS 7

Hi Doug,

 

I am investigating whether this is possible in the new BrowserField implementation, were you able to get this to function using the previous implementation? The overlay functionality described in your post will work with the old "BrowserField" implementation.

 

Regards,

Garett
@garettBeuk
--
Goodbye everybody!
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: Manipulating the graphics object when painting the browser field with overlays in OS 7

Hi Doug, 

 

I just confirmed, you will be unable to get access to the graphics object of the BrowserField due to the way it is now rendered using the WebKit rendering engine.

 

Regards,

Garett
@garettBeuk
--
Goodbye everybody!
Developer
Posts: 204
Registered: ‎08-09-2010
My Device: 9930, PlayBook
My Carrier: Verizon Wireless

Re: Manipulating the graphics object when painting the browser field with overlays in OS 7

Hi Garett,

 

I appreciate you looking into this.

 

If you do happen to find a work-around please let me know as this breaks several features of our app for OS 7 users.  I will continue to do the same!

New Developer
Posts: 14
Registered: ‎04-01-2012
My Device: 9630
My Carrier: MTN

Re: Manipulating the graphics object when painting the browser field with overlays in OS 7

Hi Streak81 can you share some code samples on how you solved this issue? Thanks.