Jump to content

Change the color of a picture using GDI+


x_bennY
 Share

Recommended Posts

I have a picture(white picture) inside my GUI with transparent background and i want to change the color of it! How could i do it?

This is how i'm creating it:

$idPic2 = GUICtrlCreatePic("", $logo_leftPos, $logo_topPos, $logo_Width, $logo_Height) ; resized picture
    $hBitmap2 = _Resource_GetAsImage('PNG_LOGO_NORMAL')
    $hBitmap_resized = _GDIPlus_ImageResize($hBitmap2, $logo_Width, $logo_Height) ;GDI+ bitmap
    $hHBitmap2 = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_resized) ;GDI bitmap
    _WinAPI_DeleteObject(GUICtrlSendMsg($idPic2, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap2))

With this function the image is created with transparent background, what i want to do is to put a option in the gui to change the color of the picture.

Thx!

Link to comment
Share on other sites

  • Moderators

@x_bennY please wait at least 24 hours before bumping your post. This may be the most important thing in the world to you, but you need to show some patience.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • 5 months later...

Check out 

_GDIPlus_ImageAttributesSetRemapTable

from the help file how to change a color.

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...