BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 04-15-2009, 07:11 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Custom Manager with transparent Background

Please Login to Remove!

Hi,

in my application, i want to use a Background Image.

I see the example and it work perfect.

Now my problem: in my Screen object i have a form with a large field in the first line, many field in the second and in the third and so on.

I create a GridManager for the second and third line that simulate a table.

So in the first line i use an VerticalFieldManager, then a GridManager and so on.

I think will be simple if i draw the background image in the paint() method of screen and try that the backgrounds of managers would be transparent but i can't find how.

I think that when the managers paint themself, they invalidate the entire region of the screen... how can i override this?

Any idea?

sorry for english
Offline  
Old 04-15-2009, 09:04 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

You shouldn't paint the background in paint() - try paintBackground() in the screen class.
Offline  
Old 04-17-2009, 08:21 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you for answer.

I try but it don't work.

I read example of background image (and color) but everyone use the paint method of the manager.

I need to set a background image for the screen because i need to add more than one manager to it.

I have overwrite the paintBackground method of MyScreenClass but when i add the CustomLayoutManager to screen it paint the white background...

Any idea?
Offline  
Old 04-17-2009, 10:16 PM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi!
i find a solution, but i have another problem

the solution is using something like this in the ScreenClass
Code:
VerticalFieldManager vfm = new VerticalFieldManager(	) {
//...
}
vfm.setBackground(BackgroundFactory.createSolidTransparentBackground(Color.COLOR_YOU_LIKE, 0)); //alpha - 0 (clear) to 255 (opaque)
this work and i can play with the alpha channel...

Now the problem is that my custom MainClass have a title.
I use paintBackground but seems that when it paint the title (in paint() i think), the background return white (i try it whitout the layout manager, only with the title) and the background image disappear...

Do you see a solution?
Thanks
Offline  
Old 04-19-2009, 11:07 AM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Mar 2009
Location: Bilbao
Model: 8900
PIN: N/A
Carrier: Vodafone
Posts: 29
Post Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

hi, i find THE solution, but i don't like so much.

I overwrite the paintBackground method and in this screen i change the background of MainManager (Screen.getMainManager) using
getMainManager().setBackground(BackgroundFactory.c reateSolidTransparentBackground(Color.WHITE, 200));

So i can see the background image as a water mark and setting the background of the others manager as totaly transparent the effect is the correct.

If anyone find a better solution...
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.