Blended form

User137
User137 used Ask the Experts™
on
Is it possible in Delphi to have form which is transparent or blended to background with some color or texture?
What i know from windowsSDK, is regions, which sets the windows visible/touchable borders.

If it would be possible to get handle from behind the form, and what would be fastest way to in real time draw "the glass" on form.Canvas/DXDraw.Surface.Canvas/else?

OS is windows98.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
if you have D6,7 and Win2000,XP you may use AlphaBlend and AlphaBlendValue properties of the TForm to manage the alpha-channel to achieve partial or full window tranasparancy.

In othe case you really may use a set of functions for
Sorry, the property TransparentColor is also used for transaparancy purposes
Commented:
Any simple way
Get DevExpress components dxForumLib
TdxfShapedForm do it.
You put it component to form, then assign to
TdxfShapedForm one bitmap with background form
and picture in center.
Your form will be transparent
In SDK you can find working with regions,
and you can do it in Delphi, but it's very
complicated.
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Author

Commented:
Using Delphi 5, which doesn't have TransparentColor or alphablend ability.

Here comment from WindowsSDK help:
"Moving the WS_EX_TRANSPARENT window, however, results in the old window background moving to the new position, because Windows does not support fully functional transparent windows."

About dxForumLib, i couldn't find it from that page??? And is it free?

More hints needed...
Ok, if you've got a Win2K or WinXP you still may use the alpha channel trough the WinAPI.
But you may also use regions.
Take a look at CreateXXXRgn, CombineRgn and SetWindowRgn...

Commented:
What version of Delphi you use ?
And say me your e-mail I can send dxForumLib to you.

Author

Commented:
To stepashka: Regions are not a real solution. I need to draw blended image of background on form.

My Delphi version (5), and Windows98 already mentioned.

Ok here's 1 of my addresses you can send in (if it's not too big file):
valo@hytti.uku.fi
...and no viruses plz ;)

Commented:
can you recieve e-mail 1.59Mb ?
if not try download
http://www.devexpress.com/dxforumlib/eforumlibd5s.exe
password for archive I send to you
If password incorrect and you can recieve big e-mail
then write me
Only Win2K and XP supports the fully functional transparent window. In all other systems you will have problems while window movement.

Author

Commented:
to Mastadon: I got downloaded and password is correct. Shall hear results "soon"...

I found some functions wrom WindowsSDK help: GetWindow, GetWindowDC.
Could these be used to get handle to background of window? Are all windows graphics/canvas in storage somewhere even if they are not drawn?

Author

Commented:
Sorry, dxForumLib has many cool abilities such as transparent form, buttons and many more, but it can't blend image on desktop.

Have i asked a question that has NO answer? I'm still not updating to upper win than 98, Or later Delphi than version 5.

What i HAVE done is:
1.Hide form on every frame (setWindowRgn or form.visible)
2.Store desktop image in memory
3.Show form again
4.Draw image on form
5.Blend image on formimage

It works, but its WAY too slow.
As I said only W2K and XP have an ability to  show fully functionsl transparent and blended windows.
In other Win systems you can create the transparent window, but when you try to move it or some window under the your window moves the background of your window will not be refresh. The only way to avoid this is to hide your window when some underlying window was moved then copy needed desktop image to your window background and finally
paint all other controls of your window. But this way will cause flicker and is very slow.

Another way is to construct your window from some regions, but it's practically impossible if the configuration of your window is quite complex.

Author

Commented:
All right... won't lower the grade since this is all i'm gonna get with questions like this. Thanks for all anyway!

I made btw a form which blends its border-pixels to nearby pixels on desktop. Satisfies a bit when used with SetWindowRgn. At least some cool effects that work fast on win98.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial