if Region > 0
then
begin
GdipCreateHBITMAPFromBitmap(pointer(img), hbmReturn, $000000);
if hbmReturn <> 0
then
begin
ABitmap := TBitmap.Create;
ABitmap.Handle := hbmReturn;
ABitmap.Width := btW;
ABitmap.Height:= btH;
FHImageButton := CreateWindowEx(WS_EX_TRANSPARENT, SKIMAGEBUTTON,
'
', Style, x, y, btW, btH, hOwner, ButID, SkinEngine.skInstance,
nil);
if FHImageButton <> 0
then
begin
SkinEngine.SetImageProperty(FHImageButton, PROP_IMAGE_BACK, Img);
SkinEngine.SetImageProperty(FHImageButton, PROP_STYLE, BS_BITMAP);
SkinEngine.SetImageProperty(FHImageButton, PROP_STATEMAX, StateMax);
ARgn := BitmapToRegion(ABitmap.Handle, imgw, imgh,
RGB(255,0,255), 0);
SetWindowRgn(FHImageButton, ARgn, True);
ABitmap.Free;
end else
begin
// Lösche das Image
SkinEngine.DeleteResource(hOwner, Img);
end;
end;