Forum | | | | | Hello, i want one Bildausschnitt of hwin1& reading, which with GDIPlus displayed becomes. left appear only one black Viereck, no Image.
mfg CompileMarkSeparation $H windows.ph
$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,ImageObject1&,GraphicObject&,Attributes&
Declare Color_Matrix#,hwin&,hwin1&
declare bmi#,b#
declare Handle&,Neu&
gdiplusToken& = InitGDIPlus()GDIPlus starten
Window 20,20-200,200
cls
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
hWin1& = Create(text, hwin&, Test, 200, 20, 300,300)
ImageObject& = gdipLoadImage(eisbaer.jpg)
If ImageObject&
~GdipCreateFromHWND(hwin1&,ADDR(GraphicObject&))
~GdipDrawImageI(GraphicObject&,ImageObject&,20,0)
~GdipCreateImageAttributes(Addr(Attributes&))
Endif
If ImageObject&
~GdipCreateFromHWND(hwin1&,ADDR(GraphicObject&))
~GdipDrawImageI(GraphicObject&,ImageObject&,150,200)
~GdipCreateImageAttributes(Addr(Attributes&))
~GdipDisposeImageAttributes(Attributes&)
~GdipDisposeImage(ImageObject&)
~GdipDisposeImage(ImageObject1&)
~GdipDeleteGraphics(GraphicObject&)
Dispose Color_Matrix#
Endif
handle&=create(hpiccopy,hwin1&,0,0,128,128)
struct bmpHEADER=Size&,Width&,Height&,Planes%,BitCount%,Compression&,SizeImage&,X#(24)
dim bmi#,bmpHEADER
bmi#.Size&=sizeof(bmi#)------------------Größe von BITMAPINFOHEADER
~GetDIBits(%hdc,Handle&,0,0,0,bmi#,0)--Dummy-Aufruf, um bmpHeader zu füllen (Rückgabe: 1=OK)
print sizeof(bmi#)
dim b#,bmi#.SizeImage&-----------------Bereich für Bildinformationen (Pixel) bereitstellen
~GetDIBits(%hdc,Handle&,0,bmi#.Height&,b#,bmi#,0)--Eigendliche Bilddaten aus Handle ermitteln
Neu&=~CreateDIBitmap(%hdc,bmi#,4,b#,bmi#,0)------Neue DIB mit geänderten Farben erzeugen
startpaint hwin&
drawpic Neu&,10,10;0
endpaint
Waitinput
ExitGDIPlus(gdiplusToken&)
../function-references/XProfan/end/'>End
|
| | | | |
| | Jörg Sellmeyer | without The pertinent Includes becomes the well hardly someone testing can. at least one Linkverweis would helpful. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/05/09 ▲ |
| |
| | |
| | | | |
| | Jörg Sellmeyer | | | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/05/09 ▲ |
| |
| | | means is GDIPlus for such things mist. derweil the image Yes displayed becomes in the GDI-appeal.... |
| | | | |
| | Jörg Sellmeyer | Tschuldigung - was one Error for may part. I had the image wrong stored. Worans lying can I you but neither say. Perhaps has Andreas Miethe Yes time one eye on it. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/05/09 ▲ |
| |
| | Andreas Miethe
| Hello Peter,
so ought to it weg CompileMarkSeparation $H windows.ph
$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,ImageObject1&,GraphicObject&,Attributes&
Declare Color_Matrix#,hwin&,hwin1&
declare bmi#,b#
declare Handle&,Neu&
gdiplusToken& = InitGDIPlus()GDIPlus starten
Window 20,20-200,200
cls
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
hWin1& = Create(text, hwin&, Test, 200, 20, 300,300)
ImageObject& = gdipLoadImage(eisbaer.jpg)
If ImageObject&
~GdipCreateFromHDC(~GetDC(hwin1&),ADDR(GraphicObject&))
~GdipDrawImageI(GraphicObject&,ImageObject&,0,0)
Endif
Handle des Bismaps
~GdipCreateHBITMAPFromBitmap(ImageObject&,Addr(Handle&),0)
struct bmpHEADER=Size&,Width&,Height&,Planes%,BitCount%,Compression&,SizeImage&,X#(24)
dim bmi#,bmpHEADER
bmi#.Size&=sizeof(bmi#)------------------Größe von BITMAPINFOHEADER
Print ~GetDIBits(%hdc,Handle&,0,0,0,bmi#,0)--Dummy-Aufruf, um bmpHeader zu füllen (Rückgabe: 1=OK)
print sizeof(bmi#)
dim b#,bmi#.SizeImage&-----------------Bereich für Bildinformationen (Pixel) bereitstellen
~GetDIBits(%hdc,Handle&,0,bmi#.Height&,b#,bmi#,0)--Eigendliche Bilddaten aus Handle ermitteln
Neu&=~CreateDIBitmap(%hdc,bmi#,4,b#,bmi#,0)------Neue DIB mit geänderten Farben erzeugen
~StretchDiBits(~Getdc(hwin&),0,0,200,200,80,80,200,200,b#,bmi#,0,~SRCCOPY)
Waitinput
~GdipDisposeImage(ImageObject1&)
~GdipDeleteGraphics(GraphicObject&)
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 : [...] | 03/05/09 ▲ |
| |
| | | not integrally. I have in the rechten Window 2 Images shifts reingesetzt with GDIPlus in hwin1& this would like I on the left Page with Getdibits etc Show in the hwin&.
look you the at times, whether to the can make?
mfg CompileMarkSeparation $H windows.ph
$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,ImageObject1&,GraphicObject&,Attributes&
Declare Color_Matrix#,hwin&,hwin1&
declare bmi#,b#
declare Handle&,Neu&
gdiplusToken& = InitGDIPlus()
Window 20,20-200,200
cls
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
hWin1& = Create(text, hwin&, Test, 400, 20, 300,300)
ImageObject& = gdipLoadImage(eisbaer.jpg)
~GdipCreateFromHDC(~GetDC(hwin1&),ADDR(GraphicObject&))
~GdipDrawImageI(GraphicObject&,ImageObject&,0,0)
~GdipCreateFromHDC(~GetDC(hwin1&),ADDR(GraphicObject&))
~GdipDrawImageI(GraphicObject&,ImageObject&,30,30)
Handle des Bismaps
~GdipCreateHBITMAPFromBitmap(ImageObject&,Addr(Handle&),0)
struct bmpHEADER=Size&,Width&,Height&,Planes%,BitCount%,Compression&,SizeImage&,X#(24)
dim bmi#,bmpHEADER
bmi#.Size&=sizeof(bmi#)------------------Größe von BITMAPINFOHEADER
~GetDIBits(%hdc,Handle&,0,0,0,bmi#,0)--Dummy-Aufruf, um bmpHeader zu füllen (Rückgabe: 1=OK)
dim b#,bmi#.SizeImage&-----------------Bereich für Bildinformationen (Pixel) bereitstellen
~GetDIBits(%hdc,Handle&,0,bmi#.Height&,b#,bmi#,0)--Eigendliche Bilddaten aus Handle ermitteln
Neu&=~CreateDIBitmap(%hdc,bmi#,4,b#,bmi#,0)------Neue DIB mit geänderten Farben erzeugen
~StretchDiBits(~Getdc(hwin&),0,0,200,200,0,0,300,300,b#,bmi#,0,~SRCCOPY)
Waitinput
~GdipDisposeImage(ImageObject1&)
~GdipDeleteGraphics(GraphicObject&)
ExitGDIPlus(gdiplusToken&)
End
|
| | | | |
| | Andreas Miethe
| Hello Peter,
means so ? CompileMarkSeparation $H windows.ph
$H includes\Functions_GDIPLUS.ph
$H includes\GDIP_Imageging.ph
$I includes\GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,ImageObject1&,GraphicObject&,Attributes&
Declare Color_Matrix#,hwin&,hwin1&
declare bmi#,b#
declare Handle&,Neu&
gdiplusToken& = InitGDIPlus()
Window 20,20-200,200
cls
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
hWin1& = Create(text, hwin&, Test, 330, 100, 300,300)
ImageObject& = gdipLoadImage(eisbaer.jpg)
Warum 2 mal das Graphic-Object anlegen ?, einmal reicht !
#########################################################
~GdipCreateFromHWND(hwin1&,ADDR(GraphicObject&))
~GdipDrawImageI(GraphicObject&,ImageObject&,0,0)
~GdipCreateFromHDC(~GetDC(hwin1&),ADDR(GraphicObject&))
~GdipDrawImageI(GraphicObject&,ImageObject&,30,30)
Temporär-Bimpap anlegen
Var TempDc& = ~CreateCompatibleDC(%hdc)
Handle& = ~CreateCompatibleBitmap(%hdc,width(hWin1&),height(hWin1&))
~SelectObject(TempDC&,Handle&)
Vom Fenster ( hWin1&) ins TempDC und damit ins Temporär-Bitmap
~Bitblt(TempDC&,0,0,width(hWin1&),height(hWin1&),~GetDC(hWin1&),0,0,~SRCCOPY)
Device-Context freigeben
~ReleaseDC(0,TempDC&)
struct bmpHEADER=Size&,Width&,Height&,Planes%,BitCount%,Compression&,SizeImage&,X#(24)
dim bmi#,bmpHEADER
bmi#.Size&=sizeof(bmi#)------------------Größe von BITMAPINFOHEADER
~GetDIBits(%hdc,Handle&,0,0,0,bmi#,0)--Dummy-Aufruf, um bmpHeader zu füllen (Rückgabe: 1=OK)
dim b#,bmi#.SizeImage&-----------------Bereich für Bildinformationen (Pixel) bereitstellen
~GetDIBits(%hdc,Handle&,0,bmi#.Height&,b#,bmi#,0)--Eigendliche Bilddaten aus Handle ermitteln
Neu&=~CreateDIBitmap(%hdc,bmi#,4,b#,bmi#,0)------Neue DIB mit geänderten Farben erzeugen
~StretchDiBits(~Getdc(hwin&),0,0,width(hWin1&),height(hWin1&),0,0,width(hWin1&),height(hWin1&),b#,bmi#,0,~SRCCOPY)
Waitinput
~DeleteDC(TempDC&)
~DeleteObject(Handle&)
~GdipDisposeImage(ImageObject1&)
~GdipDeleteGraphics(GraphicObject&)
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 : [...] | 03/06/09 ▲ |
| |
| | | thanks. functions class. can one for Bitblt somehow one original Profanbefehl take?
mfg |
| | | | |
| | Andreas Miethe
| there You one Bitmap-lever need for GetDiBits falls me in the momentum no passender commands one. |
| | | 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 : [...] | 03/06/09 ▲ |
| |
| | | i'll GDIs SelectObject & Co. well never understand... |
| | | | |
|
AnswerThemeninformationenthis Topic has 4 subscriber: |