English
Forum

Can View GDIPlus not Images in PNG Getdib

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




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  
 



in the attachment

10 kB
Hochgeladen:03/05/09
Downloadcounter27
Download
68 kB
Hochgeladen:03/05/09
Downloadcounter58
Download
 
03/05/09  
 




Jörg
Sellmeyer
here's same at the beginning the lever of ImageOject& already zero
CompileMarkSeparation
ImageObject& = gdipLoadImage(eisbaer.jpg)
 $D ,ImageObject&e>
 
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....
 
03/05/09  
 




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




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
 
03/06/09  
 




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...
 
03/06/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

1.819 Views

Untitledvor 0 min.
Andre Rohland10/06/15
funkheld01/11/14
Uwe Lang09/27/12
iF04/20/12
More...

Themeninformationen



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