PDA

View Full Version : Set background color (system)


Eliminator
05-22-2006, 06:42 PM
Hello everyone

I would like to know if there is better a way to set the background color except the way I did it :

-- Set background color
Color = Registry.GetValue(HKEY_CURRENT_USER, "Control Panel\\Colors", "ButtonFace", true);
sLength = String.Length(Color);
FirstPos = String.Find(Color, " ", 1, true);
Red = String.Left(Color, FirstPos-1);
SecondPos = String.Find(Color, " ", FirstPos+1, true);
Blue = String.Right(Color, sLength-SecondPos);
Left = String.Left(Color, SecondPos-1);
Green = String.Right(Left, FirstPos-1);
Decimal = Red+(Green*256)+(Blue*65536)

Shape.SetFillColor("Plugin1", Decimal);

Denniz03
11-13-2006, 09:37 AM
Hi,

I've got the code rebuild and simplefied. ;)

I'm sorry but there is no other way to get the default windows color.

Denniz03



-- get color from registry
Color_rgb = Registry.GetValue(HKEY_CURRENT_USER, "Control Panel\\Colors", "ButtonFace", true);

-- break apart to red, green, blue
Color_red = String.Left(Color_rgb, 3);
Color_green = String.Mid(Color_rgb, 5, 3);
Color_blue = String.Right(Color_rgb, 3);

-- convert red, green, blue to colordef
Color_cdef = Math.RGBToNumber( Color_red, Color_green, Color_blue);

-- set background color to cdef
Shape.SetFillColor("Plugin1", Color_cdef);

Intrigued
11-13-2006, 06:53 PM
Here are some links where I and others have come up with solutions that will fit your needs and other ideas, offerings you may find usefull:

http://www.indigorose.com/forums/showthread.php?t=13855&highlight=decimal+color

http://www.indigorose.com/forums/showthread.php?t=13905&highlight=decimal+color

http://www.indigorose.com/forums/showthread.php?t=14609&highlight=decimal+color

Eliminator
11-15-2006, 04:14 PM
Thank you for your answers.

Intrigued
11-15-2006, 04:26 PM
You are welcome Eliminator. I hope at least one of them did, or does come in handy. The Search link above in this forum does a great job, sometimes you have to go a few pages deep but it can pay off big! A lot of us here have put mini projects into these forums as posts and are just waiting for those willing to take a few minutes to find them.

:yes

Nubi
11-17-2006, 08:59 AM
Hello! I from Russia. Tell how to make a transparent background please? Or how it in general to remove? I make graphic prompt, and a back background all kind spoils...

Eliminator
11-24-2006, 08:17 AM
Hi,

Have you tried to put a PNG file as background image?

I didn't try it but maybe it will work.

P.S. I found a project by TJ Tigger that did it so it is sure that there is a way to do it. Sorry, but I don't remember which project it was.

Good luck

Eliminator

holtgrewe
11-24-2006, 12:27 PM
Nubi,

I'm not sure I understand your question - you want a transparent background on a page?

Add an image (or .PNG) onto the page.
Change the transparency of the Image (or .PNG) to whatever you wish.

If you want to start with a black background you will need to create that in some photo / imaging software as a .JPG or .PNG

HTH.

bule
11-24-2006, 12:50 PM
Hello! I from Russia. Tell how to make a transparent background please? Or how it in general to remove? I make graphic prompt, and a back background all kind spoils...

Try with masking.

Window.SetMask();

Eliminator
11-27-2006, 10:36 AM
Bule has the best methode, because what I saw is a
Dialog.SplashImage("image.png", 3, true);
but it doesn't woork as a back ground image. So draw an image and do the mask for it in black and white like Bule said.

Sorry for my mistake and good luck

Eliminator