Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / DarkGDK.Net C#, SetColorKey BUG?

Author
Message
yerrel
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: Planet Earth.. :-)
Posted: 28th Jan 2009 23:13 Edited at: 29th Jan 2009 02:44
Okay m8s!

Could this be a bug or am i doing something wrong?

I want to set transparent color with the values: 255, 0, 255.
This is my code:

Image balloon = new Image("balloon_red.jpg");
balloon.SetColorKey(System.Drawing.Color.FromArgb(255, 0, 255));


But the color is displayed instead of making it transparent.
Any help appreciated.

Best regards,
Yerrel


Yo!
I've just solved this problem.
It's a bit odd though. but anyhow this is how i work-around it:

// First declare Balloon with empty-string.
Image balloon = new Image("");

// Than use the command for it
balloon.SetColorKey(System.Drawing.Color.FromArgb(255, 0, 255));

balloon = new Image("balloon_red.bmp");

Is this a bug or what? The manual stated that the SetColor() must be used before loading etc.. but this command cannot be instantiated with just Image.SetColorKey().

Very frustrating indeed!

Anyhow! if someone out there have a fix for this than please post it!

Best regards,
Yerrel

MSI K8T NEO-2 F2.0, 8XAGP, 2x512Mb Dual Channel... Dark GDK..... http://www.binary-coder.com
kBessa
17
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 31st Jan 2009 05:07
I think there should be a new constructor, one that accepts the filename and the ColorKey, like:

Image myImage = new Image("myImage.bmp", Color.Fuchsia);


APEX, may you add it?

[center][center]
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 31st Jan 2009 15:49
The function should be static, it's probably a bug.

[b]Yuor signutare was aresed by a deslyxic mud...
BOX2D V2 HAS HELP FILES! AND A WIKI!

Login to post a reply

Server time is: 2024-09-30 17:37:17
Your offset time is: 2024-09-30 17:37:17