Ferin wrote:Example with brush with transparent regions works when we load bg picture,what in case i want to display just some text,
lets say with TextOut(), is there anyway to make background 100% transparent and dipslay text only without any bg picture?
I haven't found a way to render something directly over transparent bgpic, but you can first create an alpha transparent brush and then draw the text into the brush (SelectBrush with a suitable combo mode), and then use that brush as a new bgpic (BrushToBGPic). Then you can have your text or other graphics over a transparent display.
For example i want to make digital clock, window size will be 200x200 pixels, i want to make it fully transparent, so
it looks like digits of the clock sit on WB backdrop or menu top bar. As i understand to get that effect user gonna need to
switch composition on. But how it's going to look in Morphos and AROS, or even windows, macosx?
Actually, I think that constantly updating program (clock) is harder to make with hardware compositing mode, because if you do it like I said above (BrushToBGPic), you are likely to see glitches when the bgpic gets changed. So it doesn't look good when updated once per second or not even once per minute.
But if you use software rendering hack mentioned in previous posts, then you can have screengrab as the bgpic and draw other things over it normally. I think that would work well, but the downside is of course if you want to move the window, it will need manual re-drawing then.
Next case, i want to make some kind of glow effect around object, text or/and brush, that blends nicely in WB's screen.
How to achieve that, is it possible at all?
Apart from that setting bg picture determines the dimensions of our app's window, even if i set width and height attributes
of DISPLAY function, is there anyway of overriding that 'feature' without resizing background picture and still have transparent
area beyond pictures bondaries? To be precise, i have 100X100 background and want my window to be 200x200. Background's
picture has an irregular shape with transparent pixels around it and i need 50 pixels transparent 'frame' around it.
That's easy with the previously mentioned ways. Create a brush with size 200x200 (make it transparent or use screengrab depending if doing hw or sw rendering), render your own 100x100 background with glow effects you want in the middle of it, and use the result as a new bgpic.
I've used this method in my
RNOWidgets program when creating automatic drop shadows for widgets. If you have access to a MorphOS machine, have a test run with it. You can enable/disable compositing mode and enable/disable dropshadows from the settings etc.
Here is one image where you can see the shadows in action.
Regarding software hack version. Would it work on AOS3.x with Planamarama plugin?
I still haven't had time to check the plugin and have no idea how it works, but why not?
And how to make it 'flush' background every set amount of time in most efficient way?
I mean how often should i clear background and what functions/loops use for it.
I wouldn't like to do it time based, because most of the updates would be unnecessary, and when you have moved the window, updating wouldn't probably hit in the right time either.
I made it (in RNOWidgets) so that background is refreshed only when window gets deactivated and it has been moved (user has moved the window and then clicks somewhere else and our window gets deactivated). I do it by installing InactiveWindow and MoveWindow event handlers, and in move window function I only set a variable which tells if the window has been moved, if it hasn't it's useless to re-draw the background. Then the inactive window function re-draws the background only if the move variable is set.