<?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[Druckausgabe horizontal?]]></title><description><![CDATA[<p>Ich kann drucken, aber ich möchte gern das Blatt auch horizontal drucken können.<br />
Kann mir jemand helfen wie das geht?</p>
<p>Momentan löse ich es so. Ich lade ein Bitmap, welches ich drucken möchte und gebe es mit StretchBlt() zum Drucker. Ich habe aber auch Grafiken im Landscape Format und möchte diese natürlich dann im Querformat drucken können, nur gibt das der aktuelle Code nicht her.</p>
<p>Kann ich das dem Drucker sagen oder muss ich meine Grafik drehen?</p>
<pre><code class="language-cpp">printDC = GetPrinterDC(druckername);

di.cbSize	= sizeof(DOCINFO);
di.lpszDocName	= printjobname;
di.fwType	= NULL;
di.lpszDatatype	= NULL;
di.lpszOutput	= NULL;

if (printDC != NULL)
{
	printjobID=StartDoc(printDC, &amp;di);		
	if (printjobID &gt; 0)
	{
		StartPage(printDC);

		HBITMAP hBitmap, hbmNew;    
		hBitmap = (HBITMAP)LoadImage(NULL, startfilename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE); 

		HDC hdcSrc = CreateCompatibleDC(NULL);

		BITMAP bm;
		GetObject(hBitmap, sizeof(bm), &amp;bm);

		SelectObject(hdcSrc, hBitmap);
		hbmNew = CreateBitmap(bm.bmWidth, bm.bmHeight, bm.bmPlanes, bm.bmBitsPixel, NULL);
		StretchBlt(printDC,xanfang,yanfang,int(640*xdruckmult),int(840*ydruckmult),hdcSrc,0,0,640,840,SRCCOPY);

		DeleteDC(hdcSrc);
		EndPage(printDC);
		EndDoc(printDC);
	}
	DeleteDC(printDC);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/201802/druckausgabe-horizontal</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 14:31:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/201802.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 04 Jan 2008 09:39:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Druckausgabe horizontal? on Fri, 04 Jan 2008 09:39:25 GMT]]></title><description><![CDATA[<p>Ich kann drucken, aber ich möchte gern das Blatt auch horizontal drucken können.<br />
Kann mir jemand helfen wie das geht?</p>
<p>Momentan löse ich es so. Ich lade ein Bitmap, welches ich drucken möchte und gebe es mit StretchBlt() zum Drucker. Ich habe aber auch Grafiken im Landscape Format und möchte diese natürlich dann im Querformat drucken können, nur gibt das der aktuelle Code nicht her.</p>
<p>Kann ich das dem Drucker sagen oder muss ich meine Grafik drehen?</p>
<pre><code class="language-cpp">printDC = GetPrinterDC(druckername);

di.cbSize	= sizeof(DOCINFO);
di.lpszDocName	= printjobname;
di.fwType	= NULL;
di.lpszDatatype	= NULL;
di.lpszOutput	= NULL;

if (printDC != NULL)
{
	printjobID=StartDoc(printDC, &amp;di);		
	if (printjobID &gt; 0)
	{
		StartPage(printDC);

		HBITMAP hBitmap, hbmNew;    
		hBitmap = (HBITMAP)LoadImage(NULL, startfilename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE); 

		HDC hdcSrc = CreateCompatibleDC(NULL);

		BITMAP bm;
		GetObject(hBitmap, sizeof(bm), &amp;bm);

		SelectObject(hdcSrc, hBitmap);
		hbmNew = CreateBitmap(bm.bmWidth, bm.bmHeight, bm.bmPlanes, bm.bmBitsPixel, NULL);
		StretchBlt(printDC,xanfang,yanfang,int(640*xdruckmult),int(840*ydruckmult),hdcSrc,0,0,640,840,SRCCOPY);

		DeleteDC(hdcSrc);
		EndPage(printDC);
		EndDoc(printDC);
	}
	DeleteDC(printDC);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1430447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1430447</guid><dc:creator><![CDATA[jambu]]></dc:creator><pubDate>Fri, 04 Jan 2008 09:39:25 GMT</pubDate></item><item><title><![CDATA[Reply to Druckausgabe horizontal? on Fri, 04 Jan 2008 14:28:35 GMT]]></title><description><![CDATA[<p>ich glaub das kann man den drucker sagen</p>
<p>schau mal hier: <a href="http://www.codersource.net/mfc_print_tutorial_1.html" rel="nofollow">http://www.codersource.net/mfc_print_tutorial_1.html</a> (fast am ende)</p>
<pre><code class="language-cpp">CPrintDialog pd(TRUE);
if (GetPrinterDeviceDefaults(&amp;pd.m_pd))
{
    LPDEVMODE dev = pd.GetDevMode();
    GlobalUnlock(dev);
    dev-&gt;dmOrientation=DMORIENT_LANDSCAPE;
    dev-&gt;dmPaperSize=DMPAPER_A4;
}
DoPrintDialog(&amp;pd); 

The default function does only this:

CPrintDialog pd(TRUE);
DoPrintDialog(&amp;pd);
</code></pre>
<p>oder<br />
<a href="http://www.codeguru.com/forum/archive/index.php/t-200260.html" rel="nofollow">http://www.codeguru.com/forum/archive/index.php/t-200260.html</a></p>
<p>google einfach nach MFC printing landscape</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1430640</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1430640</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Fri, 04 Jan 2008 14:28:35 GMT</pubDate></item><item><title><![CDATA[Reply to Druckausgabe horizontal? on Mon, 07 Jan 2008 08:25:30 GMT]]></title><description><![CDATA[<p>Danke! Jedoch geht das wohl nur in Verbindung mit einem PrinterDialog, welchen ich nicht habe und auch so nicht nutzen kann. Das eine DirectDraw Fullscreen Anwendung. Ich speicher bei Buttondruck eine Bitmap und lasse diese Bitmap dann gestreckt, mit StretchBlt(), drucken. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432225</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432225</guid><dc:creator><![CDATA[jambu]]></dc:creator><pubDate>Mon, 07 Jan 2008 08:25:30 GMT</pubDate></item><item><title><![CDATA[Reply to Druckausgabe horizontal? on Mon, 07 Jan 2008 09:40:01 GMT]]></title><description><![CDATA[<p>Hast DU es versucht ob es nur mit einem PrinterDialog geht?<br />
Man kann auch ohne diesen Drucken.<br />
Tatsache ist das man den Drucker mitteilen muss als LANDSCAPE zu drucken und das geht eben so wie beschrieben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1432247</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1432247</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Mon, 07 Jan 2008 09:40:01 GMT</pubDate></item></channel></rss>