Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Zitat von »"ChrisJ"«
BitBlt ist sinnlos.
Schau dir mal die Funktion PageGDICalls() an.
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
[ System.Runtime.InteropServices.DllImportAttribute( "gdi32.dll" ) ] private static extern bool BitBlt( IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, IntPtr hdcSrc, int nXSrc, int nYSrc, System.Int32 dwRop ); private void button1_Click(object sender, System.EventArgs e) { PrintDialog foo = new PrintDialog(); foo.Document = printDocument1; DialogResult res = foo.ShowDialog(); if ( res == DialogResult.OK ) { printDocument1.Print(); } } private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { Graphics graphicsSrc = this.CreateGraphics(); Image image = new Bitmap( this.Size.Width, this.Size.Height ); Graphics graphicsDst = Graphics.FromImage( image ); IntPtr srcDC = graphicsSrc.GetHdc(); IntPtr dstDC = graphicsDst.GetHdc(); BitBlt( dstDC, 0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height, srcDC, 0, 0, 13369376 ); graphicsSrc.ReleaseHdc( srcDC ); graphicsDst.ReleaseHdc( dstDC ); e.Graphics.DrawImage( image, 0, 0 ); } |
C-/C++-Quelltext |
|
1 |
Form.drawToBitmap(); |
C-/C++-Quelltext |
|
1 2 |
this.Invalidate(); this.Refresh(); |
Werbeanzeige