ich will hier pBitmap und hBitmap zurück bekommen um diese an verschiedenen Stellen im Hauptteil zur Verfügung zu haben.
Code: Select all
LoadPicture(Path) {
pBitmap := Gdip_CreateBitmapFromFile(picname)
hBitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
return {"hBitmap": hBitmap, "pBitmap": pBitmap}
}
Gdip_RotateBitmap(pBitmap, Angle, Dispose=1) { ;-- returns rotated bitmap. By Learning one.
Gdip_GetImageDimensions(pBitmap, Width, Height)
Gdip_GetRotatedDimensions(Width, Height, Angle, RWidth, RHeight)
Gdip_GetRotatedTranslation(Width, Height, Angle, xTranslation, yTranslation)
pBitmap2 := Gdip_CreateBitmap(RWidth, RHeight)
G2 := Gdip_GraphicsFromImage(pBitmap2), Gdip_SetSmoothingMode(G2, 4), Gdip_SetInterpolationMode(G2, 7)
Gdip_TranslateWorldTransform(G2, xTranslation, yTranslation)
Gdip_RotateWorldTransform(G2, Angle)
Gdip_DrawImage(G2, pBitmap, 0, 0, Width, Height)
hBitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
Gdip_ResetWorldTransform(G2)
Gdip_DeleteGraphics(G2)
if Dispose
Gdip_DisposeImage(pBitmap)
return hBitmap
} ; http://www.autohotkey.com/community/viewtopic.php?p=477333#p477333
Code: Select all
BOPic:= Object()
picname:= % RamDiskPath . "\sppreview-" . SubStr("00000" . page, -6) . ".png"
BOPic:= LoadPicture(picname)
;-: Preview Picture
Gui, BOPV: Add, Picture, % "xm y" (LText2Y + LText2H + 5) " vLPic1 Section 0xE BackGroundTrans HWNDhLPic1", % "HBITMAP: " BOPic["hBitmap"]
...
...
BOPVPageTurn:
BOPic["hBitmap"]::= Gdip_RotateBitmap(BOPic["pBitmap"], 90, 1)
GuiControl, BOPV: , LPic1, % "HBITMAP: " BOPic["hBitmap"]
return
Code: Select all
... , % "HBITMAP: " BOPic.hBitmap
Code: Select all
... , % "HBITMAP: " BOPic[hBitmap]
Bisher war ich mit Trial und Error und Nachlesen irgendwann erfolgreich.
Dieses mal nicht.