Jump to content

Position of label and delete previous data


Recommended Posts

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.

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

×
×
  • Create New...