jguinch Posted September 3, 2015 Share Posted September 3, 2015 HelloI'm looking for a way to apply a transparent color to a region in an image (crop a rect into the image).In the helpfile, I found _GDIPlus_BitmapSetPixel but I don't know if there is a constant for the transparent color (and if there is a faster way).The goal is to build some puzzle pieces from a bitmap Thanks in advance Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Luigi Posted September 3, 2015 Share Posted September 3, 2015 (edited) Hi jguinch!I don't have a code to your question. But, see this post: https://www.autoitscript.com/forum/topic/174611-have-some-autoit-code-to-cut-a-image-in-png-file/This code can found every neighboor pixel with same color, the result of all neighbor pixels is an array.With this array you can re-paint or apply the transparency.I thinking in this way, you get the pixel in this format:0xTTRRGGBB (TT: transparency, RR, GG, BB) and change the TT's value to 0 (or other value).You can obtain the pixel color with tranparency with _GDIPlus_BitmapGetPixel.Br, Luigi. Edited September 3, 2015 by Luigi Visit my repository Link to comment Share on other sites More sharing options...
Danyfirex Posted September 4, 2015 Share Posted September 4, 2015 _GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, 0x0) Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
UEZ Posted September 4, 2015 Share Posted September 4, 2015 (edited) A faster solution is to use _GDIPlus_BitmapLockBits. Check out the help file for an example. Edited September 4, 2015 by UEZ 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 More sharing options...
jguinch Posted September 4, 2015 Author Share Posted September 4, 2015 Thanks.Luigi : I want to apply a transparency to a region, not depending of a pixel color. Your link is still interesting.Danyfirex : nice, it works (it risks to be slow for several images, but it's a very good way).UEZ : OK, i will try it and come with either the solution, or probably questions. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now