Foro | | | | - Página 1 - |
|  | Möchte una bild&, wo Yo una Linie reingezeichnet habe con el GDI-Befehl einlesen y otra vez como neues Bild con GDI daneben dibujar. Das Musterbild lugar Yo links con startpaint hwin& dar.
Klappt no.
Wo liegt el Fehler?
mfg KompilierenMarcaSeparación $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&)
| 06.05.2009 ▲ | |
| |
| | | | | - Página 1 - |
|  | Jup, danke. Klappt wunderbar con el Bild.
mfg |
| | | | |
| |  | ¡Hola Andreas, Yo brauche todavía una vez deine Ayuda. Yo habe una Bild hpic& suscrito. Dieses transportiere I, con el Gdi en el hbitmap& y zeige lo a.
Nun möchte Yo el hpic& vorher rotieren dejar en el Mittelpunkt y luego sólo en el hbitmap& bringen.
Como va el?
mfg KompilierenMarcaSeparación $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
¡Hola Andreas, Yo brauche todavía una vez deine Ayuda. Yo habe una Bild hpic& suscrito. Dieses transportiere I, con el Gdi en el hbitmap& y zeige lo a.
Nun möchte Yo el hpic& vorher rotieren dejar en el Mittelpunkt y luego sólo en el hbitmap& bringen.
Como va el?
Como musste Yo mich auch primero schlau hacer. KompilierenMarcaSeparación $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 : [...]  | 09.05.2009 ▲ |
| |
| |  | Jup, danke. Dreht se wunderbar en el Mapa de bits. Gracias.
mfg |
| | | | |
| |  | So, dreht se wunderbar. Nur es el gesamte Viereck no Transparent obwohl Yo -1 hay posición habe. El Farbe $ff00ff Yo como Hintergrund vergeben.
Irgendwo mus el Fehler ser de me?
Wer blanco más?
mfg KompilierenMarcaSeparación $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
 | Das kann así no trabajo, como hPic& no transparent suscrito se, sólo hBitmap&
Como musst Usted ya el Farbe la ventana benutzen. KompilierenMarcaSeparación $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 : [...]  | 09.05.2009 ▲ |
| |
| |  | Gracias para deine Mühe.
Posesiones ahora dieses todavía zwischengefügt : hbitmap1&
Jetzt es el GDI-Viereck Transparent. Posesiones blanco como Transparent genommen. Lo ha aber algunos weisse Zacken(el Linie), el no weggehen. ¿Cómo se puede uno dieses en el vorigen hbitmap1& verfeinern con GDI-Befehlen?
Als Muster Yo una Rechteck como hintergelegt. KompilierenMarcaSeparación $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 el veces ! KompilierenMarcaSeparación $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='./../../funktionsreferenzen/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 : [...]  | 09.05.2009 ▲ |
| |
| | | | - Página 2 - |
| |  | Jup, danke, wir haben uns beim Vorschlag überschnitten.
Su grosses Rechteck es todavía no durchsichtig. Wenn Yo como una Rechteck hinterlege, se lo überdeckt.
Como kannman el ändern?
mfg |
| | | | |
| |  Andreas Miethe
 | 2peter Bierbach, Beitrag=52252, Zeitpunkt=09.05.2009
Jup, danke, wir haben uns beim Vorschlag überschnitten.
Su grosses Rechteck es todavía no durchsichtig. Wenn Yo como una Rechteck hinterlege, se lo überdeckt.
Como kannman el ändern?
mfg
Verstehe no como el gemeint es. ¿Puede Usted una Ejemplo puesto ? |
| | | 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 : [...]  | 09.05.2009 ▲ |
| |
| |  Andreas Miethe
 | Yo habs veces con un Bild como Hintergrund getestet. Funktioniert einwandfrei ! KompilierenMarcaSeparación $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 Background& = Create(hPic,0,&DSKBMP)
Startpaint hWin&
DrawSizedPic BackGround&, 0,0 - 650,500;0
EndPaint
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&)
sleep 1
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 : [...]  | 09.05.2009 ▲ |
| |
| |  | Jup, ahora va dein Ejemplo. Gracias.
Mein letztes Ejemplo zeigt lo auch todavía una vez con un otro Copyversuch.
mfg |
| | | | |
|
RespuestaThemeninformationenDieses Thema ha 3 subscriber: |