<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Wieso nur ein schwarzer Fleck?]]></title><description><![CDATA[<p>Hi ich möchte ein Bild, welches ich in den Ressourcen habe ausdrucken! (Es hat 256 Farben) Wenn ich es aber drucken will, sieht man auf dem Ausdruck nur ein schwarzes Rechteck!<br />
Wieso ist das so?</p>
<p>Hier der Code</p>
<pre><code class="language-cpp">CPrintDialog dlgPrint(FALSE,PD_ALLPAGES,this); 
	if (dlgPrint.DoModal()==IDOK) 
    { 
        CDC dcPrint; 
        dcPrint.Attach(dlgPrint.GetPrinterDC()); 
        DOCINFO myPrintJob; 
        myPrintJob.cbSize = sizeof(myPrintJob); 
        myPrintJob.lpszDocName = &quot;ADS&quot;; 
        myPrintJob.lpszOutput = NULL; 
        myPrintJob.lpszDatatype = NULL; 
        myPrintJob.fwType = NULL; 
        if (dcPrint.StartDoc(&amp;myPrintJob)&gt;=0) 
        { 
            // Als Hilfe wie man bestimmte Parameter abfragt 
            int te = dcPrint.GetDeviceCaps(ASPECTY); 
            int test = dcPrint.GetDeviceCaps(ASPECTX); 
            int m_iHorizont = dcPrint.GetDeviceCaps(HORZRES); 
            int m_iVerdikal = dcPrint.GetDeviceCaps(VERTRES);
			int zeilenabstand; 

            dcPrint.StartPage(); 

			CBitmap bmp; 
			//CBitmap bild; 
			bmp.LoadBitmap(IDB_BITMAP1); 

			CDC SpeicherDC; 
			peicherDC.CreateCompatibleDC(&amp;dcPrint); 
			SpeicherDC.SelectObject( &amp;bmp ); 

			dcPrint.StretchBlt( 0, 0, 640, 200, &amp;SpeicherDC, 0, 0, 100, 100, SRCCOPY );

		    dcPrint.EndPage(); //Seitenende 
            dcPrint.EndDoc(); //Dokuementenende
		} 
		dcPrint.DeleteDC(); //Druckauftrag löschen 
	}
</code></pre>
<p>Bitte helft mir!<br />
Vielen Dank für die Antworten!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/84945/wieso-nur-ein-schwarzer-fleck</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 07:19:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/84945.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 03 Sep 2004 17:47:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wieso nur ein schwarzer Fleck? on Fri, 03 Sep 2004 17:47:01 GMT]]></title><description><![CDATA[<p>Hi ich möchte ein Bild, welches ich in den Ressourcen habe ausdrucken! (Es hat 256 Farben) Wenn ich es aber drucken will, sieht man auf dem Ausdruck nur ein schwarzes Rechteck!<br />
Wieso ist das so?</p>
<p>Hier der Code</p>
<pre><code class="language-cpp">CPrintDialog dlgPrint(FALSE,PD_ALLPAGES,this); 
	if (dlgPrint.DoModal()==IDOK) 
    { 
        CDC dcPrint; 
        dcPrint.Attach(dlgPrint.GetPrinterDC()); 
        DOCINFO myPrintJob; 
        myPrintJob.cbSize = sizeof(myPrintJob); 
        myPrintJob.lpszDocName = &quot;ADS&quot;; 
        myPrintJob.lpszOutput = NULL; 
        myPrintJob.lpszDatatype = NULL; 
        myPrintJob.fwType = NULL; 
        if (dcPrint.StartDoc(&amp;myPrintJob)&gt;=0) 
        { 
            // Als Hilfe wie man bestimmte Parameter abfragt 
            int te = dcPrint.GetDeviceCaps(ASPECTY); 
            int test = dcPrint.GetDeviceCaps(ASPECTX); 
            int m_iHorizont = dcPrint.GetDeviceCaps(HORZRES); 
            int m_iVerdikal = dcPrint.GetDeviceCaps(VERTRES);
			int zeilenabstand; 

            dcPrint.StartPage(); 

			CBitmap bmp; 
			//CBitmap bild; 
			bmp.LoadBitmap(IDB_BITMAP1); 

			CDC SpeicherDC; 
			peicherDC.CreateCompatibleDC(&amp;dcPrint); 
			SpeicherDC.SelectObject( &amp;bmp ); 

			dcPrint.StretchBlt( 0, 0, 640, 200, &amp;SpeicherDC, 0, 0, 100, 100, SRCCOPY );

		    dcPrint.EndPage(); //Seitenende 
            dcPrint.EndDoc(); //Dokuementenende
		} 
		dcPrint.DeleteDC(); //Druckauftrag löschen 
	}
</code></pre>
<p>Bitte helft mir!<br />
Vielen Dank für die Antworten!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/599064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/599064</guid><dc:creator><![CDATA[addict]]></dc:creator><pubDate>Fri, 03 Sep 2004 17:47:01 GMT</pubDate></item><item><title><![CDATA[Reply to Wieso nur ein schwarzer Fleck? on Sat, 04 Sep 2004 16:21:47 GMT]]></title><description><![CDATA[<p>Ich habe etwas probiert und herausgefunden dass die Fukntion:</p>
<pre><code class="language-cpp">SpeicherDC.SelectObject( &amp;bmp );
</code></pre>
<p>nicht richtig ist! Diese schlägt fehl oder besser gesagt, wird nicht durchgeführt!<br />
Kann mir hier niemand sagen, woran das liegt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/599520</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/599520</guid><dc:creator><![CDATA[addict]]></dc:creator><pubDate>Sat, 04 Sep 2004 16:21:47 GMT</pubDate></item><item><title><![CDATA[Reply to Wieso nur ein schwarzer Fleck? on Sat, 04 Sep 2004 16:26:43 GMT]]></title><description><![CDATA[<p>Such mal nach SetMapMode</p>
]]></description><link>https://www.c-plusplus.net/forum/post/599526</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/599526</guid><dc:creator><![CDATA[phlox81]]></dc:creator><pubDate>Sat, 04 Sep 2004 16:26:43 GMT</pubDate></item><item><title><![CDATA[Reply to Wieso nur ein schwarzer Fleck? on Sat, 04 Sep 2004 16:33:47 GMT]]></title><description><![CDATA[<p>Habe ich vorher eingefüt!<br />
Sieht so aus:</p>
<pre><code class="language-cpp">CBitmap bmp; 
    CBitmap bild; 
    bmp.LoadBitmap(IDB_BITMAP1); 

    CDC SpeicherDC; 
    SpeicherDC.CreateCompatibleDC(dcPrint);
	SpeicherDC.SelectObject(bmp);
	SpeicherDC.SetMapMode(MM_LOENGLISH); 
   if(SpeicherDC.SelectObject(bmp))
   {

			dcPrint-&gt;StretchBlt( 0, 0, 640, 200, &amp;SpeicherDC, 0, 0, 100, 100, SRCCOPY );
   }
</code></pre>
<p>Aber beim &quot;if&quot; überspringt er immernoch den Rest!<br />
Wieso ist das so?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/599536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/599536</guid><dc:creator><![CDATA[addict]]></dc:creator><pubDate>Sat, 04 Sep 2004 16:33:47 GMT</pubDate></item></channel></rss>