English
Forum

Done: Graphic image GDI draw

 
- Page 1 -


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  
 



 
- Page 1 -


Jup, thanks.
Klappt wonderful with the Image.

mfg
 
05/07/09  
 



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
 
05/08/09  
 




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
 
05/09/09  
 



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
 
05/09/09  
 




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
 
05/09/09  
 




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  
 



 
- Page 2 -


Jup, thanks, we've us at suggestion überschnitten.

your grosses rectangle is not yet transparent.
If I there one rectangle hinterlege, becomes it überdeckt.

How kannman the Change?

mfg
 
05/09/09  
 




Andreas
Miethe


2peter Bierbach, Beitrag=52252, Zeitpunkt=09.05.2009
Jup, thanks, we've us at suggestion überschnitten.

your grosses rectangle is not yet transparent.
If I there one rectangle hinterlege, becomes it überdeckt.

How kannman the Change?

mfg


understand not How the meant is.
can You an example post ?
 
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  
 




Andreas
Miethe


I habs time with a Image as background tested. functions correct !
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 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 :  [...] 
05/09/09  
 



Jup, now goes your example. thanks.

my letztes example shows it too once more with a others Copyversuch.

mfg
 
05/09/09  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.681 Views

Untitledvor 0 min.
ByteAttack10/02/15
iF05/11/15
Tommy03/16/15
Ernst05/26/14
More...

Themeninformationen

this Topic has 3 subscriber:

unbekannt (9x)
Andreas Miethe (6x)
iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie