|
-
Sep 9th, 2004, 04:30 PM
#1
Thread Starter
Fanatic Member
Greying out an Icon (bmp)
Hi all.
I'm using BMP images stored in a ListView associated to a tree view for displaying icons on tree nodes. Now I am coding Cut/Copy/Paste operations and I'd like to grey out the icon of a Node that was "cut".
Any suggestions?
Thanks!
Don't ask why, just reboot!
-
Sep 9th, 2004, 08:15 PM
#2
Ex-Super Mod'rater
I did something similar to this a while back but I didn't really put much thought into it. What I did was just have a seperate icon for when its greyed out and greyed it out in my paint program before hand at design time. There may be a runtime solution but I think the simplest way is the better in this situation.
That is unless I've missunderstood the question .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Sep 10th, 2004, 11:38 AM
#3
Thread Starter
Fanatic Member
Well...
Thanks for answering, but I need such abitlity at runtime, since icons will change from one installation (client) to another.
Thanks anyway!
Alain
Don't ask why, just reboot!
-
Sep 10th, 2004, 08:24 PM
#4
Ex-Super Mod'rater
in that case how about writing a routine that creates the greyed out version when the new icons are added? This would n't be too hard I guess, depends exactly how you mean greyed out. First method I can think of is alphablending a plain grey color over it but depending on how you want it to look you would need to play with both the alpha value & the shade of grey (black, white or inbetween somewhere) .
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Sep 10th, 2004, 09:07 PM
#5
Thread Starter
Fanatic Member
That's pretty much what I am looking for. I've tried different colors with different ways of overlapping images together, but it doesn't look good.
Don't ask why, just reboot!
-
Sep 10th, 2004, 09:14 PM
#6
Ex-Super Mod'rater
What kind of methods have you used? Have you tried a proper Alpha blending formula yet? I'll do a search cos I know its been posted a couple of times....
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Sep 10th, 2004, 09:19 PM
#7
Ex-Super Mod'rater
Here is the alpha blending fuction that uses values between 0-255 for all its parts.
FinalPixel is what it sounds like, AlphaValue is the blending ratio 0 means the result will be Destination & 255 would make the result Source. Source would be the color of the grey to be added. Destination would be the color of the pixel to be altered.
Code:
FinalPixel = (AlphaValue * (Source + 256 - Destination)) / 256 + Destination - AlphaValue
When your thread has been resolved please edit the original post in the thread (  )
and amend "-[RESOLVED]-" to the end of the title and change the icon to  , Thank you.
When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

-
Sep 13th, 2004, 08:25 AM
#8
Thread Starter
Fanatic Member
All right!
Thanks, I'll try that. Now I have to put this part of the jop aside.
Thanks a lot for the help!
Hopefully I'll be able to do the same for you eventually...
Ciao!
Alain
Don't ask why, just reboot!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|