Foro | | | |  | ¡Hola, Yo möchte una Bildausschnitt de hwin1& einlesen, welches con GDIPlus dargestellt se. Links erscheint sólo una schwarze Viereck, kein Bild.
mfg KompilierenMarcaSeparación $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 | sin la zugehörigen Incluye se el wohl kaum alguien testen puede. Zumindest una Linkverweis wäre hilfreich. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 05.03.2009 ▲ |
| |
| |  |
| | | | |
| |  Jörg Sellmeyer | | | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 05.03.2009 ▲ |
| |
| |  | Also es GDIPlus para solche Sachen mist. derweil el Bild sí adecuado se en el GDI-Aufruf.... |
| | | | |
| |  Jörg Sellmeyer | Tschuldigung - war una Fehler meinerseits. Tuve el Bild falso gespeichert. Worans liegt kann Yo Usted aber auch no sagen. Tal vez ha Andreas Miethe sí veces una Auge en él. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 05.03.2009 ▲ |
| |
| |  Andreas Miethe
 | ¡Hola Peter,
así debería lo ir  KompilierenMarcaSeparación $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 : [...]  | 05.03.2009 ▲ |
| |
| |  | No bastante. Yo habe en el rechten Ventana 2 Bilder versetzt reingesetzt con GDIPlus en hwin1& Dieses möchte I el linken Página con Getdibits usw Mostrar en el hwin&.
Schau dir el veces a, si al hacer kann?
mfg KompilierenMarcaSeparación $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
 | ¡Hola Peter,
also así ? KompilierenMarcaSeparación $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 : [...]  | 06.03.2009 ▲ |
| |
| |  | Gracias. Funktioniert klasse. ¿Puede uno para Bitblt irgendwie una original Profanbefehl nehmen?
mfg |
| | | | |
| |  Andreas Miethe
 | Como Usted una Mapa de bits-Handle necesidad para GetDiBits fällt me en el Moment kein passender Befehl una. |
| | | 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 : [...]  | 06.03.2009 ▲ |
| |
| |  | Yo voluntad GDIs Seleccionar objeto & Co. wohl niemals verstehen... |
| | | | |
|
RespuestaThemeninformationenDieses Thema ha 4 subscriber: |