Topic: Form background image

Is it possible to have an image as a form background instead of a color? If possible, how can it be done?

Adam
God... please help me become the person my dog thinks I am.

Re: Form background image

Hello Adam,


Yes, of course.


Just drop an image component on the Form (not dbImage), and load an image inside. Then resize it if needed (and if the image is not the exact same size as the form, tick stretch and untick proportional).

Then just add your buttons and so on top of it. Done smile


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Form background image

Hi Adam, Hi Mathias (long time no see - hope you're doing okay!),
Yes, I'd do it just the same way - drop an image on the form then place your components on top of it.
Sometimes the image is too dominant, so I just watermark it so it's more in the background
See attached.
Derek.

Post's attachments

Attachment icon adhimage.zip 624.16 kb, 445 downloads since 2016-10-20 

4 (edited by AD1408 2016-10-20 22:10:34)

Re: Form background image

Hi Mathias, Hi Derek,


Thanks for replies.....


Once again, I asked unclear question. My apologies.


I wanted to have a form background image then add image based buttons (Transparent)  on top of the bg image. It can be done with panel or group box but one problem with both; panel doesn't have transparency option; group box has but cannot get rid of the borders of the group box. That was the reason for the question. I thought if I can assign a bg image instead of color to a form then I could have transparent images on top.


-----------------------------------------------
edit:
Thanks guys... Looks like I need to take a break... Watch movie or hit the local bars... As Mathias pointed out it's simple... Funny enough I have been doing that before... Sorry for asking a silly question guys.

Adam
God... please help me become the person my dog thinks I am.

Re: Form background image

Hello again Adam,


If you want a panel to take the color, or the image of the background just add this to the "onshow" event of your form :

procedure Form1_OnShow (Sender: string; Action: string);
begin
    Form1.Panel1.ParentBackground := True;
end;

Then modify the BevelOuter property to bvnone and you'll have a completely transparent panel smile


Cheers


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: Form background image

Hello Ad1408 (and Mathias and Derek)

You can also replace buttons with images with PNG format.
PNG allows transparency (with a graphic software, you choose color of transparency).
I use it upon background image.
Behind OnClick Event of each image I place the script that goes.

JB