Valnurat Posted March 2, 2018 Posted March 2, 2018 Hi. I'm trying to position labels on my form controlled by my image that I collect from AD. The problem is that the images from AD is not the same size. I don't mind it is not the same position, but I would like previous data should be deleted. Func GetComputer($sName) Local $iIdx = _ArraySearch($aResult,$sName,0,0,0,0,1,1) $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle $USERIMAGE = _AD_GetObjectAttribute($aResult[$iIdx][0], 'thumbnailPhoto') If not @error Then $hBitmap = _GDIPlus_BitmapCreateFromMemory($USERIMAGE) ;load binary saved GIF image and convert it to GDI+ bitmap format Local $iW = _GDIPlus_ImageGetWidth($hBitmap), $iH = _GDIPlus_ImageGetHeight($hBitmap) _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 2, 25) ;display image in GUI EndIf $lName = GUICtrlCreateLabel("", $iW + 10, 25, $iWidthCell+100,25) GUICtrlSetData($lName,_AD_FQDNToDisplayname($aResult[$iIdx][0])) ndFunc Do you have a smart trix to accomplish my request? Yours sincerely Kenneth.
Bilgus Posted March 2, 2018 Posted March 2, 2018 I'm not completely sure what you are asking but I think you intend to blank out the previous picture? _GDIPlus_GraphicsClear($hGraphics, 0xFFFFFFFF)
Valnurat Posted March 5, 2018 Author Posted March 5, 2018 Yes, that it correct and the label too. Yours sincerely Kenneth.
Valnurat Posted March 5, 2018 Author Posted March 5, 2018 If I use it that command the my form is just going black. I just want to clear the previously image, before showing a new one. Yours sincerely Kenneth.
Bilgus Posted March 5, 2018 Posted March 5, 2018 IF anything it should turn it white $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle _GDIPlus_GraphicsClear($hGraphics, 0xFFFFFFFF)
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