Fantastic Posted January 11, 2010 Posted January 11, 2010 (edited) I am using Yashied Icons.au3 for merging 2 icons and then displaying.The problem is that after merging 2 icons I get black background.Is there any workaround getting transparent background ?Please note that I need transparent background and not colored.And here a sample code ( you will need Yashied Icons.au3)#include-once #include <GUIConstantsEx.au3> #include 'icons.au3' GUICreate('Test', 200, 200, -1, -1) GUISetBkColor(0xE0FFFF) $pic = GUICtrlCreatePic('', 10, 10, 64, 64) $icon1 = _Icons_Icon_Extract(@SystemDir & '\shell32.dll', 4, 48, 48) $icon2 = _Icons_Icon_Extract(@SystemDir & '\shell32.dll', 100, 32, 32) $hIcon = _Icons_Icon_Merge(0, $icon1, $icon2, 16, 16) $hBitmap = _Icons_Bitmap_CreateFromIcon($hIcon) _SetHImage($pic, $hBitmap) _WinAPI_DeleteObject($hBitmap) _WinAPI_DestroyIcon($hIcon) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSEAny help will be appreciated.It's solved, look at post #5 Edited January 11, 2010 by Fantastic [u]My current project:[/u] [size="1"]A bootable USB[/size]Webpage:*http://mylittlesoft.blogspot.com/
Yashied Posted January 11, 2010 Posted January 11, 2010 _Icons_Icon_Merge() function does not support transparency, but you can do so:$hIcon = _Icons_Icon_Merge(0xE0FFFF, $icon1, $icon2, 16, 16)If it does not fit, you can read here or here. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Fantastic Posted January 11, 2010 Author Posted January 11, 2010 _Icons_Icon_Merge() function does not support transparency, but you can do so: $hIcon = _Icons_Icon_Merge(0xE0FFFF, $icon1, $icon2, 16, 16) If it does not fit, you can read here or here. Is there any way editing your _Icons_Icon_Merge() function to support transparency like it's done here. I'll have a look at those links of course and thank you. [u]My current project:[/u] [size="1"]A bootable USB[/size]Webpage:*http://mylittlesoft.blogspot.com/
Yashied Posted January 11, 2010 Posted January 11, 2010 For icons - No. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Fantastic Posted January 11, 2010 Author Posted January 11, 2010 (edited) For icons - No. Thanks again Yashield. After playing with your first example I just did what I wanted. Next I'll try with your UDF if I can have the same effect. Code will be posted here. Slyghtly modded code but works (again you will need Icons.au3) #Include 'Icons.au3' GUICreate('MyGUI', 350, 250) GUISetBkColor(0xE0FFFF) $sRegPath = "HKLM\SOFTWARE\AutoIt v3\AutoIt" If StringInStr("X64IA64", @OSArch) Then $sRegPath = StringReplace($sRegPath, "SOFTWARE", "SOFTWARE\Wow6432Node") $TestImage = RegRead($sRegPath, "InstallDir") & "\Examples\GUI\msoobe.jpg" $Pic1 = GUICtrlCreatePic($TestImage, 30, 0, 350, 250) $hPic1 = GUICtrlGetHandle($Pic1) $Pic2 = GUICtrlCreatePic('', 40, 40, 48, 48) $hPic2 = GUICtrlGetHandle(-1) GUISetState() ; Set Icon $hDC = _WinAPI_GetDC($hPic2) $hMemDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, 48, 48) _WinAPI_SelectObject($hMemDC, $hBitmap) $hIcon = _Icons_Icon_Extract(@SystemDir & '\shell32.dll', 130, 48, 48) $hIcon2 = _Icons_Icon_Extract(@SystemDir & '\shell32.dll', 4, 48, 48) _WinAPI_DrawIconEx($hMemDC, 0, 0, $hIcon, 48, 48, 0, 0, 3) _WinAPI_DrawIconEx($hMemDC, 16, 16, $hIcon2, 32, 32, 0, 0, 3) _WinAPI_ReleaseDC($hPic2, $hDC) _WinAPI_DeleteDC($hMemDC) _SetHImage($Pic2, $hBitmap) _WinAPI_DeleteObject($hBitmap) _WinAPI_DestroyIcon($hIcon) _WinAPI_DestroyIcon($hIcon2) Do Until GUIGetMsg() = -3 GUIDelete() /Solved Edited January 11, 2010 by Fantastic [u]My current project:[/u] [size="1"]A bootable USB[/size]Webpage:*http://mylittlesoft.blogspot.com/
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