Forum | | | | |  | want one bild&, where I a line reingezeichnet have with the GDI-commands reading and again as new Image with GDI moreover draw. the Musterbild place I left with startpaint hwin& dar.
Klappt not.
where lying the Error?
mfg CompileMarkSeparation $H windows.ph
$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
declare hwin&,bild&,ende%,bmp_gdi&,GraphicObject&
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
bild&=create(hnewpic,128,128,$ffffff)
startpaint bild&
line 10,10-120,120
endpaint
startpaint hwin&
drawpic bild&,10,10,0
endpaint
~GdipCreateBitmapFromHBITMAP(bild&, 0, Bmp_gdi&)
~GdipCreateFromHDC(%hdc,ADDR(GraphicObject&))
~GdipDrawImageI(GraphicObject&,bmp_gdi&,200,10)
~GdipDeleteGraphics(GraphicObject&)
| 05/06/09 ▲ | |
| | |
| |  | with such Topics must You always gaaanz loudly
                   
call - it rule the authoritative. 
(of it no idea Have...) |
| | | | | | |
| |  | Woooooo is andreas?
Hilf me time Please moreover with the graphic in GDI.
mfg |
| | | | | | |
| |  Andreas Miethe
 | OK ok, be already there . CompileMarkSeparation $H windows.ph
$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
declare hwin&,bild&,ende%,bmp_gdi&,GraphicObject&
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
bild&=create(hnewpic,128,128,$ffffff)
startpaint bild&
line 10,10-120,120
endpaint
startpaint hwin&
drawpic bild&,10,10,0
endpaint
#########
Hier ist Fehler No. 1
var gdiplusToken& = InitGDIPlus()GDIPlus starten
vergessen ?
##########
~GdipCreateBitmapFromHBITMAP(bild&,0,addr(Bmp_gdi&))
#########
Hier ist Fehler No. 2
~GdipCreateFromHwnd(hwin&,ADDR(GraphicObject&))
###########
~GdipDrawImageI(GraphicObject&,bmp_gdi&,200,10)
~GdipDeleteGraphics(GraphicObject&)
waitinput
|
| | | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 05/07/09 ▲ |
| | |
| |  | Jup, thanks. Klappt wonderful with the Image.
mfg |
| | | | | | |
| |  | Hello 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?
mfg 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)
InitGDIPlus()
hbitmap&=create(hnewpic,255,255,$ffffff)
hpic&=create(hnewpic,128,128,$ffffff)
startpaint hpic&
line 10,10-120,120
endpaint
~GdipCreateBitmapFromHBITMAP(hPic&,0,@Addr(lngImage&))
~GdipCreateHBITMAPFromBitmap(lngImage&,@Addr(hBitmap&))
startpaint hwin&
DrawPic hBitmap&,50,50;0
endpaint
WaitInput
DeleteObject hPic&
DeleteObject hBitmap&
~GdipDisposeImage(lngImage&)
End
|
| | | | | | |
| |  Andreas Miethe
 | 2peter Bierbach, Beitrag=52209, Zeitpunkt=08.05.2009
Hello 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
|
| | | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 05/09/09 ▲ |
| | |
| |  | Jup, thanks. turn itself wonderful in the Bitmap. Thank you.
mfg |
| | | | | | |
| |  | so, turn itself wonderful. only is the entire Viereck not Transparent though I -1 there stand have. The colour $ff00ff have I as background give away.
somewhere mus the Error his of me?
who knows moreover?
mfg 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()
hpic&=create(hnewpic,128,128,$ff00ff)
Var ImWidth& = %BmpX
Var ImHeight& = %BmpY
startpaint hpic&
line 10,10-120,120
endpaint
Var Dig& = Sqrt(Sqr(ImWidth&) + Sqr(ImHeight&))
hbitmap&=create(hnewpic,Dig&,Dig&,$ff00ff)
~GdipCreateBitmapFromHBITMAP(hPic&,0,@Addr(lngImage&))
Var Imagedc& = 0
WhileLoop 0,180,2
StartPaint hBitmap&
~GdipCreateFromhDC(%hdc,ADDR(ImageDC&))
~GdipRotateWorldTransform(ImageDc&,single(&loop),1)
~GdipTranslateWorldTransform(ImageDc&,Single(Dig&/2),Single(Dig&/2),1)
~GdipDrawImageRectI(ImageDc&,lngImage&,ImWidth&/2,ImHeight&/2,-ImWidth&,-ImHeight&)
EndPaint
startpaint hwin&
DrawPic hBitmap&,100,100;-1,$ff00ff
endpaint
endwhile
WaitInput
DeleteObject hPic&
DeleteObject hBitmap&
~GdipDeleteGraphics(ImageDc&)
~GdipDisposeImage(lngImage&)
ExitGDIPlus(gdiplusToken&)
End
|
| | | | | | |
| |  Andreas Miethe
 | the can so not functions, there hPic& not transparent drawn becomes, only hBitmap&
there must You already The colour the Fensters using. 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()
hpic&=create(hnewpic,128,128,~GetSysColor(~COLOR_BTNFACE))
Var ImWidth& = %BmpX
Var ImHeight& = %BmpY
startpaint hpic&
line 10,10-120,120
endpaint
Var Dig& = Sqrt(Sqr(ImWidth&) + Sqr(ImHeight&))
hbitmap&=create(hnewpic,Dig&,Dig&,~GetSysColor(~COLOR_BTNFACE))
~GdipCreateBitmapFromHBITMAP(hPic&,0,@Addr(lngImage&))
Var Imagedc& = 0
WhileLoop 0,180,2
StartPaint hBitmap&
~GdipCreateFromhDC(%hdc,ADDR(ImageDC&))
~GdipRotateWorldTransform(ImageDc&,single(&loop),1)
~GdipTranslateWorldTransform(ImageDc&,Single(Dig&/2),Single(Dig&/2),1)
~GdipDrawImageRectI(ImageDc&,lngImage&,ImWidth&/2,ImHeight&/2,-ImWidth&,-ImHeight&)
EndPaint
startpaint hwin&
DrawPic hBitmap&,100,100;-1,~GetSysColor(~COLOR_BTNFACE)
endpaint
endwhile
WaitInput
DeleteObject hPic&
DeleteObject hBitmap&
~GdipDeleteGraphics(ImageDc&)
~GdipDisposeImage(lngImage&)
ExitGDIPlus(gdiplusToken&)
End
|
| | | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 05/09/09 ▲ |
| | |
| |  | thanks for your trouble.
have now this yet zwischengefügt : hbitmap1&
now is the GDI-Viereck Transparent. have knows as Transparent taken. it has but some weisse jags(The line), The not go away. How can this in the vorigen hbitmap1& verfeinern with GDI-command?
as pattern have I one rectangle there hintergelegt. CompileMarkSeparation $H windows.ph
$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
Declare hPic&,hwin&,lngImage&,hBitmap&,pixel&,hBitmap1&,hpic1&
Window 20,20-200,200
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
Var gdiplusToken& = InitGDIPlus()
hpic1&=create(hnewpic,128,128,$0000ff)
hpic&=create(hnewpic,128,128,$ffffff)
Var ImWidth& = %BmpX
Var ImHeight& = %BmpY
startpaint hpic&
UsePen 1,2,RGB(0,0,255)
line 10,10-120,120
endpaint
Var Dig& = Sqrt(Sqr(ImWidth&) + Sqr(ImHeight&))
hbitmap&=create(hnewpic,Dig&,Dig&,$ffffff)
hbitmap1&=create(hnewpic,Dig&,Dig&,$ffffff)
~GdipCreateBitmapFromHBITMAP(hPic&,0,@Addr(lngImage&))
Var Imagedc& = 0
startpaint hwin&
DrawPic hpic1&,80,80;0
endpaint
WhileLoop 0,180,10
StartPaint hbitmap&
~GdipCreateFromhDC(%hdc,ADDR(ImageDC&))
~GdipRotateWorldTransform(ImageDc&,single(&loop),1)
~GdipTranslateWorldTransform(ImageDc&,Single(Dig&/2),Single(Dig&/2),1)
~GdipDrawImageRectI(ImageDc&,lngImage&,ImWidth&/2,ImHeight&/2,-ImWidth&,-ImHeight&)
EndPaint
StartPaint hbitmap1&
DrawPic hBitmap&,0,0;-1
endpaint
startpaint hwin&
DrawPic hBitmap1&,100,100;-1
endpaint
sleep 100
endwhile
WaitInput
DeleteObject hPic&
DeleteObject hBitmap&
~GdipDeleteGraphics(ImageDc&)
~GdipDisposeImage(lngImage&)
ExitGDIPlus(gdiplusToken&)
End
mfg |
| | | | | | |
| |  Andreas Miethe
 | Probier the time ! 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, 450, 20, 650,500)
Var gdiplusToken& = InitGDIPlus()
hpic&=create(hnewpic,128,128,$ffffff)
Var ImWidth& = %BmpX
Var ImHeight& = %BmpY
startpaint hpic&
line 10,10-120,120
endpaint
Var Dig& = Sqrt(Sqr(ImWidth&) + Sqr(ImHeight&))
hbitmap&=create(hnewpic,Dig&,Dig&,$ffffff)
~GdipCreateBitmapFromHBITMAP(hPic&,0,@Addr(lngImage&))
Var Imagedc& = 0
temporäres DC und Bitmap erzeugen
##################################
Var TempDC& = ~CreateCompatibleDC(%hdc)
Var TempBmp& = ~CreateCompatibleBitmap(%hdc,Dig&,Dig&)
~SelectObject(TempDC&,TempBmp&)
~SetStretchBltMode(TempDC&,~COLORONCOLOR)
##################################
Speicherbitmap zur sicherung des Hintergrundes
##################################
mcls Dig&,Dig&
StartPaint -1
~BitBlt(%hdc,0,0,Dig&,dig&,~GetDC(hWin&),100,100,~srccopy)
EndPaint
##################################
WhileLoop 0,180,2
TempDC& = ~CreateCompatibleDC(%hdc)
TempBmp& = ~CreateCompatibleBitmap(%hdc,Dig&,Dig&)
~SelectObject(TempDC&,TempBmp&)
StartPaint hBitmap&
~GdipCreateFromhDC(%hdc,ADDR(ImageDC&))
~GdipRotateWorldTransform(ImageDc&,single(&loop),1)
~GdipTranslateWorldTransform(ImageDc&,Single(Dig&/2),Single(Dig&/2),1)
~GdipDrawImageRectI(ImageDc&,lngImage&,ImWidth&/2,ImHeight&/2,-ImWidth&,-ImHeight&)
EndPaint
hBitmap transparent in TempBitmap kopieren
##################################
StartPaint hBitmap&
~TransparentBlt(TempDC&,0,0,Dig&,Dig&,%hdc,0,0,Dig&,Dig&,$ffffff)
~DeleteDC(TempDC&)
endpaint
##################################
temporäres Bitmap anzeigen
##################################
startpaint hWin&
mCopyBmp 0,0-Dig&,Dig&>100,100;0
DrawPic TempBmp&,100,100;-1
endpaint
##################################
~DeleteObject(TempBmp&)
endwhile
WaitInput
DeleteObject hPic&
DeleteObject hBitmap&
~GdipDeleteGraphics(ImageDc&)
~GdipDisposeImage(lngImage&)
ExitGDIPlus(gdiplusToken&)ass=s4 href='./../../Function-References/XProfan/end/'>End
|
| | | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...]  | 05/09/09 ▲ |
| | |
|
AnswerThemeninformationenthis Topic has 3 subscriber: |