If any of you have used the new Windows Live Messenger, then you'll know what I'm talking about.
I'm making a messenger with a similar look. It's a blue colored theme that uses a single image as the background.
I'd like to let the user choose a color for the theme and have it apply that color to the image. Sort of like the Selective Color feature in Adobe Photoshop.
I'm somewhat familiar with DIB programming, but I'm not quite sure how to do this.
I have a vague idea of what you are wanting to accomplish. I am imagining a monochromatic image, modifying the hue to change the color. Could you show us your blue-theme image, and what it should look like if the user wanted it red?
Hm didn't really see any code in there that I could use for this...the DMA code was helpful though but I think I may stick to the basic GetDIBits() API, etc.
Anyone have any suggestions? Or algorithms to alter a color based on hue/saturation? I could probably work it out myself from there.
I put the image into picturebox1 and gave picturebox2 a red background, then using this code from the APIGuide i got the picture below.
VB Code:
'This project requires two picture boxes
'Both picture boxes should contain a picture
Const AC_SRC_OVER = &H0
Private Type BLENDFUNCTION
BlendOp As Byte
BlendFlags As Byte
SourceConstantAlpha As Byte
AlphaFormat As Byte
End Type
Private Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal BLENDFUNCT As Long) As Long
Private Declare Sub RtlMoveMemory Lib "kernel32.dll" (Destination As Any, Source As Any, ByVal Length As Long)