Hi,
I'm programming a application with multiple displays and asyncronus FX on the different displays. At the moment is working fine, however I have two questions.
1. How to open a display with transparent backgroud? (I already defined a background for the screen and I want to have it in the display as well)
2. How can I output anything to the screen rather than to one of the opened display
Display and screens
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Display and screens
Just create a BGPic that has transparent areas (either through a mask or an alpha channel). Look at the WBApple or EuroCalc examples.ilbarbax wrote: I'm programming a application with multiple displays and asyncronus FX on the different displays. At the moment is working fine, however I have two questions.
1. How to open a display with transparent backgroud? (I already defined a background for the screen and I want to have it in the display as well)
That's not possible. Hollywood can't draw to the screen directly, only to displays.ilbarbax wrote: 2. How can I output anything to the screen rather than to one of the opened display
Re: Display and screens
No clue to write on the transparent display.
CreateBrush(99, dw-644, dh-136-130-5, #BLUE, {AlphaChannel = True, Clear = True})
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(5, {BGPic = 99, X = 643, Y = 137, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(5)
SelectDisplay(5)
TextOut(#CENTER,#CENTER,"111111")
it does not print 11111. If I remove clear option it works fine, but obviously without transparency but having a blue background.
CreateBrush(99, dw-644, dh-136-130-5, #BLUE, {AlphaChannel = True, Clear = True})
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(5, {BGPic = 99, X = 643, Y = 137, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(5)
SelectDisplay(5)
TextOut(#CENTER,#CENTER,"111111")
it does not print 11111. If I remove clear option it works fine, but obviously without transparency but having a blue background.
Re: Display and screens
Hi,
How do I retrieve the current screen resolution? Is there a Hollywood constant or command for this?
Alternatively is there a C: command for this?
How do I retrieve the current screen resolution? Is there a Hollywood constant or command for this?
Alternatively is there a C: command for this?
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
Re: Display and screens
Nevermind! ;p
Found the great GetAttribute() command, some useful functionality in that command I see.
Found the great GetAttribute() command, some useful functionality in that command I see.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
http://myevolve.wordpress.com
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Display and screens
That's normal behaviour. You're creating a fully transparent BGPic with alpha channel here. You won't be able to draw anything to this BGPic because it's fully transparent. Remember that the transparent areas of a BGPic act as a mask: You won't be able to draw on them. Drawing operations will only be visible on non-transparent areas of your BGPic!ilbarbax wrote:No clue to write on the transparent display.
CreateBrush(99, dw-644, dh-136-130-5, #BLUE, {AlphaChannel = True, Clear = True})
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(5, {BGPic = 99, X = 643, Y = 137, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(5)
SelectDisplay(5)
TextOut(#CENTER,#CENTER,"111111")
it does not print 11111. If I remove clear option it works fine, but obviously without transparency but having a blue background.
If you want to have a transparent BGPic with the text "111111" on it, you need to draw this text to the BGPic *before* actually displaying the BGPic, i.e.
Code: Select all
CreateBrush(99, dw-644, dh-136-130-5, #BLUE, {AlphaChannel = True, Clear = True})
SelectAlphaChannel(99)
TextOut(#CENTER,#CENTER,"111111")
EndSelect
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(5, {BGPic = 99, X = 643, Y = 137, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(5)
Re: Display and screens
Thanks Andreas, another brick is in position on my mind. However I need a dynamic behaviour having the possibility to write on the display at different times.
I Have anyway sorted out the situation using GrabDesktop command as follow:
Function NewBGDisplay(dsp, xa, ya, wa, ha)
GrabDesktop(99,{X = xa, Y = ya,Width=wa, Height=ha})
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(dsp, {BGPic = 99, X = xa, Y = ya, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(dsp)
EndFunction
I Have anyway sorted out the situation using GrabDesktop command as follow:
Function NewBGDisplay(dsp, xa, ya, wa, ha)
GrabDesktop(99,{X = xa, Y = ya,Width=wa, Height=ha})
BrushToBGPic(99,99)
FreeBrush(99)
CreateDisplay(dsp, {BGPic = 99, X = xa, Y = ya, Borderless = True, Fixed = True, Hidden=False})
OpenDisplay(dsp)
EndFunction