gdip related - how to "remove" the transparency region of an image ?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mitchneal
Posts: 10
Joined: 31 Dec 2020, 20:24

gdip related - how to "remove" the transparency region of an image ?

Post by mitchneal » 31 Dec 2020, 20:36

Hi there and Happy New Year.

FYI : I've used ahk since 2016 :thumbup: and lost my old ahk forum account :lol:

My situation : I have an image on the clipboard, make a graphic with white background already. But when I paste it there, the transparency region doesn't preserve my white background. Is there anyway to create a new "layer" / bipmap and then merge two layers like photoshop ? :?:

Thanks ! :dance:

trust_me
Posts: 98
Joined: 29 Jul 2017, 10:46

Re: gdip related - how to "remove" the transparency region of an image ?

Post by trust_me » 02 Jan 2021, 08:12

yes it was quite easy ( if you already use gdip .... ? ), you can take a look at the examples for gdip here (example 6 is close for what you want to do:

https://www.autohotkey.com/boards/viewtopic.php?t=6517

to get the bitmap from clipboard:
pBitmap :=Gdip_CreateBitmapFromClipboard()

mitchneal
Posts: 10
Joined: 31 Dec 2020, 20:24

Re: gdip related - how to "remove" the transparency region of an image ?

Post by mitchneal » 09 Feb 2021, 10:15

trust_me wrote:
02 Jan 2021, 08:12
yes it was quite easy ( if you already use gdip .... ? ), you can take a look at the examples for gdip here (example 6 is close for what you want to do:

https://www.autohotkey.com/boards/viewtopic.php?t=6517

to get the bitmap from clipboard:
pBitmap :=Gdip_CreateBitmapFromClipboard()
thanks for the answer bro...

however, my problem is with the transparency of image.

In the example 6, Gdip_CreateBitmapFromFile(file1) can make a Bitmap with transparency.

But the Gdip_CreateBitmapFromClipboard doesn't recognize the transparency ... it must be something wrong with gdip !

Post Reply

Return to “Ask for Help (v1)”