| |
|
|
| Andreas Miethe, Beitrag=52242, Zeitpunkt=09.05.2009
2peter Bierbach, Beitrag=52209, Zeitpunkt=08.05.2009Hello Andreas, I need once more your Help. I have one Image hpic& drawn. this transportiere I with the Gdi into hbitmap& and show it on.
now would like I the hpic& before rotate let around the Mittelpunkt and then first into hbitmap& bring.
How are the?
there had I too first schlau make. CompileMarkSeparation $H windows.ph
$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
Declare hPic&,hwin&,lngImage&,hBitmap&
Window 20,20-200,200
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
Var gdiplusToken& = InitGDIPlus()GDIPlus starten
hpic&=create(hnewpic,128,128,$ffffff)
Var ImWidth& = %BmpX Breite und
Var ImHeight& = %BmpY Höhe sichern, brauchen wir zum Berechnen
startpaint hpic&
Rectangle 0,0-4,4
line 10,10-120,120
endpaint
Diagonale berechnen, hier kann ich endlich mal was mit dem
Satz des Pythagoras anfangen !
Var Dig& = Sqrt(Sqr(ImWidth&) + Sqr(ImHeight&)) Diagonale ( a²+b² = c² ) die Wurzel von c² ist die Diagonale
hbitmap&=create(hnewpic,Dig&,Dig&,0)
~GdipCreateBitmapFromHBITMAP(hPic&,0,@Addr(lngImage&))
StartPaint hBitmap&
Var Imagedc& = 0
~GdipCreateFromhDC(%hdc,ADDR(ImageDC&))
~GdipRotateWorldTransform(ImageDc&,Single(225.0),1)=45 Grad nach rechts
~GdipTranslateWorldTransform(ImageDc&,Single(Dig&/2),Single(Dig&/2),1)
~GdipDrawImageRectI(ImageDc&,lngImage&,ImWidth&/2,ImHeight&/2,-ImWidth&,-ImHeight&)
EndPaint
startpaint hwin&
DrawPic hBitmap&,0,0;0
DrawPic hPic&,180,180;0
endpaint
WaitInput
DeleteObject hPic&
DeleteObject hBitmap&
~GdipDeleteGraphics(ImageDc&)
~GdipDisposeImage(lngImage&)
ExitGDIPlus(gdiplusToken&) GDIPlus beenden
End
|
|
|
| |
|
|