2 Questions about BGPic-Function
2 Questions about BGPic-Function
I want to enable composing in my flipclock project.
To get realtime Background-Transparency i want do use the BGpic-Function for the bottom-layer.
Before i put some hours of work into it, i want to know if:
1. Is it possible with BGPic to display some Layers above Bpic-layer, does it work?
2. Will the Scaling-Engine (resizing image with free aspect-ratio) of Hollywood working with BGPic?
To get realtime Background-Transparency i want do use the BGpic-Function for the bottom-layer.
Before i put some hours of work into it, i want to know if:
1. Is it possible with BGPic to display some Layers above Bpic-layer, does it work?
2. Will the Scaling-Engine (resizing image with free aspect-ratio) of Hollywood working with BGPic?
Re: 2 Questions about BGPic-Function
I'll paste this from the other forum section in case Andreas hasn't read it.
Fingus is in essence asking for transparent windows - and I am too.
FAO Andreas,
Hey, is there any chance of adding support for creating transparent displays/windows? I tried to do the same thing as Fingus sometime ago, using the GrabDesktop() trick - doesn't really work very well - users did need to move windows right!
I bet I am not the only who would also like to create a Splash window - transparency is needed there too - *think Adobe irregular-shaped splash windows*
Fingus is in essence asking for transparent windows - and I am too.
FAO Andreas,
Hey, is there any chance of adding support for creating transparent displays/windows? I tried to do the same thing as Fingus sometime ago, using the GrabDesktop() trick - doesn't really work very well - users did need to move windows right!
I bet I am not the only who would also like to create a Splash window - transparency is needed there too - *think Adobe irregular-shaped splash windows*
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: 2 Questions about BGPic-Function
@fingus: Every Hollywood display has a BGPic attached to it. You can't work without them. So yes, everything that you listed is possible.
Re: 2 Questions about BGPic-Function
I´m starting implementing compositing in my flipclock-project but i face one problem:
If in the area of the deepest layer (BGPic) are completely transparency areas, then the parts of the layers above are not shown there!
(For better visibility i set the background to white)
You see it in the screenshot with the clipped area of the whie flipclock-sheets on top and between main and secondary bar.
It seems the BGPic sets a kind of "mask". I try to set transparency for above layers to 0, but that doesn´t seem to have any effect on it.
If in the area of the deepest layer (BGPic) are completely transparency areas, then the parts of the layers above are not shown there!
(For better visibility i set the background to white)
You see it in the screenshot with the clipped area of the whie flipclock-sheets on top and between main and secondary bar.
It seems the BGPic sets a kind of "mask". I try to set transparency for above layers to 0, but that doesn´t seem to have any effect on it.
Re: 2 Questions about BGPic-Function
Did you get my PM on Amigaworld fingus?
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: 2 Questions about BGPic-Function
That's normal behaviour. The BGPic's shape will act as a mask for all drawing operations. If you do not want that, you have to draw to an offscreen BGPic and then switch to this BGPic to make the changes visible.fingus wrote: It seems the BGPic sets a kind of "mask".
Re: 2 Questions about BGPic-Function
I read the guide but don't know how to realise to draw all layers to a non visible bgpic and then to switch (by copybgpic(offscreen,visible) )to visible bpic. It should then have a black background picture?!? can you provide a small example with 1-2 brushes attached to it?That's normal behaviour. The BGPic's shape will act as a mask for all drawing operations. If you do not want that, you have to draw to an offscreen BGPic and then switch to this BGPic to make the changes visible.
This doesn't work:
Code: Select all
@BRUSH 1, "appleimg.png", {LoadAlpha = True}
EnableLayers()
DisplayBGPic(1, { x=-600, y =-600 }) ; draw to offscreen
DisplayBrush(1,#CENTER,#CENTER) ; attach a brush
Print("hello world!", #BLACK) ; attach a text
Box(50,50,100,100, #BLUE) ; attach a nox
CopyBGPic(1,2) ; copy to new bgpic2
DisplayBGPic(2) ; display it on the visible screen
@DISPLAY
{
Title = "test",
Borderless = True,
Layers = True,
sizeable = True,
scalemode=#SCALEMODE_LAYER,
Smoothscale=True,
KeepProportions=True,
width = 528,
height = 535,
active = False,
dragregion = {{type = #BOX, x = 0, y = 0, width = 528,height = 200}},
sizeregion = {{ type = #BOX, x = 0, y = 201, width = 528, height = 200}}
}
EscapeQuit(True)
; wait until something happens!
Repeat
WaitEvent
Forever
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: 2 Questions about BGPic-Function
Create an offscreen BGPic and then draw to it using SelectBGPic() together with #SELMODE_COMBO so that all drawing commands render to the color and alpha channel of the BGPic. When you're finished preparing your BGPic in this way, simply call EndSelect() and DisplayBGPic() to bring it to the front.
Re: 2 Questions about BGPic-Function
How to create an offscreen BGPic?Andreas wrote:Create an offscreen BGPic and then draw to it using SelectBGPic() together with #SELMODE_COMBO so that all drawing commands render to the color and alpha channel of the BGPic. When you're finished preparing your BGPic in this way, simply call EndSelect() and DisplayBGPic() to bring it to the front.
Is the meaning of offscreen here, drawing to a non-visible-area (left, top, down, right of the actual screen) or is this something like a double-buffered area?
The Manual didn't describe this and even the Example of BGPic there doesn't work and ends up with a "Didn't find Background-Picture 2".
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: 2 Questions about BGPic-Function
Normally you can create off-screen BGPics with CreateBGPic() but as you need a BGPic with an alpha channel, you have to create a brush first and then convert it to a BGPic. The code goes something like this:fingus wrote:How to create an offscreen BGPic?
Is the meaning of offscreen here, drawing to a non-visible-area (left, top, down, right of the actual screen) or is this something like a double-buffered area?
The Manual didn't describe this and even the Example of BGPic there doesn't work and ends up with a "Didn't find Background-Picture 2".
Code: Select all
tmp = CreateBrush(Nil, 640, 480, 0, {AlphaChannel = True, Clear = True})
tmp2 = BrushToBGPic(tmp, Nil)
FreeBrush(tmp)
SelectBGPic(tmp2, #SELMODE_COMBO)
....draw to it...
EndSelect
DisplayBGPic(tmp2)