<?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[GDI+ DrawImage malt wo es nicht soll!]]></title><description><![CDATA[<p>Hmm ... also das Problem was hier auftritt ist, das obwohl Koordinaten für die Bitmap pPercentBitmapPart angegeben wurden der die einfach an die Stelle 0, 0 setzt. Jemand ne Idee?</p>
<p>Hier der Code:</p>
<pre><code class="language-cpp">Gdiplus::Pen pen(Gdiplus::Color(128, 128, 128));
		/************************************************************************/
		/*  Draw percent bar edges                                              */
		/************************************************************************/
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 - 55, rect.bottom - 30, (rect.right - rect.left) / 2 - 51, rect.bottom - 30);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 - 50, rect.bottom - 35, (rect.right - rect.left) / 2 - 50, rect.bottom - 31);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 + 55, rect.bottom - 30, (rect.right - rect.left) / 2 + 51, rect.bottom - 30);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 + 50, rect.bottom - 35, (rect.right - rect.left) / 2 + 50, rect.bottom - 31);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 + 55, rect.bottom - 20, (rect.right - rect.left) / 2 + 51, rect.bottom - 20);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 + 50, rect.bottom - 15, (rect.right - rect.left) / 2 + 50, rect.bottom - 19);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 - 55, rect.bottom - 20, (rect.right - rect.left) / 2 - 51, rect.bottom - 20);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 - 50, rect.bottom - 15, (rect.right - rect.left) / 2 - 50, rect.bottom - 19);
		/************************************************************************/

		brush.SetColor(Gdiplus::Color(255, 255, 255));
		Gdiplus::Bitmap*	pMemBitmapPercent		= new Gdiplus::Bitmap(114, 10);
		Gdiplus::Graphics*	pMemGraphicsPercent		= Gdiplus::Graphics::FromImage(pMemBitmap);

		for (unsigned short percent = 0; percent &lt; (100 / 7); ++percent)
		{
			Gdiplus::GraphicsPath* path = new Gdiplus::GraphicsPath;
			path-&gt;AddLine((percent * 7) + 10, 0, (percent * 7) + 5, 0);		// top right	=&gt; top left
			path-&gt;AddLine((percent * 7) + 10 + 5, 0, (percent * 7) + 5, 9);	// top right	=&gt; bottom right
			path-&gt;AddLine((percent * 7) + 5, 9, (percent * 7), 9);			// bottom right	=&gt; bottom left
			path-&gt;AddLine((percent * 7) + 10, 0, (percent * 7), 9);			// bottom left	=&gt; top left
			pMemGraphicsPercent-&gt;FillPath(&amp;brush, path);
			delete path;
		}
		Gdiplus::Rect percent_rect(4, 0, min(m_percent, 100), 10);
		Gdiplus::Bitmap* pPercentBitmapPart = pMemBitmapPercent-&gt;Clone(percent_rect, PixelFormatDontCare);
		pMemGraphics-&gt;DrawImage(pPercentBitmapPart, (rect.right - rect.left) / 2 - 50, rect.bottom - 29);
		delete pMemGraphicsPercent;
		delete pMemBitmapPercent;

		graphics.DrawImage(pMemBitmap, 0, 0);
		delete pMemBitmap;
		delete pMemGraphics;
</code></pre>
<p>... ok der Code istnoch nicht optimiert aber das ist ja auch nicht der Punkt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/178683/gdi-drawimage-malt-wo-es-nicht-soll</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 17:11:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/178683.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Apr 2007 13:52:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GDI+ DrawImage malt wo es nicht soll! on Fri, 13 Apr 2007 13:52:13 GMT]]></title><description><![CDATA[<p>Hmm ... also das Problem was hier auftritt ist, das obwohl Koordinaten für die Bitmap pPercentBitmapPart angegeben wurden der die einfach an die Stelle 0, 0 setzt. Jemand ne Idee?</p>
<p>Hier der Code:</p>
<pre><code class="language-cpp">Gdiplus::Pen pen(Gdiplus::Color(128, 128, 128));
		/************************************************************************/
		/*  Draw percent bar edges                                              */
		/************************************************************************/
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 - 55, rect.bottom - 30, (rect.right - rect.left) / 2 - 51, rect.bottom - 30);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 - 50, rect.bottom - 35, (rect.right - rect.left) / 2 - 50, rect.bottom - 31);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 + 55, rect.bottom - 30, (rect.right - rect.left) / 2 + 51, rect.bottom - 30);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 + 50, rect.bottom - 35, (rect.right - rect.left) / 2 + 50, rect.bottom - 31);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 + 55, rect.bottom - 20, (rect.right - rect.left) / 2 + 51, rect.bottom - 20);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 + 50, rect.bottom - 15, (rect.right - rect.left) / 2 + 50, rect.bottom - 19);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 - 55, rect.bottom - 20, (rect.right - rect.left) / 2 - 51, rect.bottom - 20);
		pMemGraphics-&gt;DrawLine(&amp;pen, (rect.right - rect.left) / 2 - 50, rect.bottom - 15, (rect.right - rect.left) / 2 - 50, rect.bottom - 19);
		/************************************************************************/

		brush.SetColor(Gdiplus::Color(255, 255, 255));
		Gdiplus::Bitmap*	pMemBitmapPercent		= new Gdiplus::Bitmap(114, 10);
		Gdiplus::Graphics*	pMemGraphicsPercent		= Gdiplus::Graphics::FromImage(pMemBitmap);

		for (unsigned short percent = 0; percent &lt; (100 / 7); ++percent)
		{
			Gdiplus::GraphicsPath* path = new Gdiplus::GraphicsPath;
			path-&gt;AddLine((percent * 7) + 10, 0, (percent * 7) + 5, 0);		// top right	=&gt; top left
			path-&gt;AddLine((percent * 7) + 10 + 5, 0, (percent * 7) + 5, 9);	// top right	=&gt; bottom right
			path-&gt;AddLine((percent * 7) + 5, 9, (percent * 7), 9);			// bottom right	=&gt; bottom left
			path-&gt;AddLine((percent * 7) + 10, 0, (percent * 7), 9);			// bottom left	=&gt; top left
			pMemGraphicsPercent-&gt;FillPath(&amp;brush, path);
			delete path;
		}
		Gdiplus::Rect percent_rect(4, 0, min(m_percent, 100), 10);
		Gdiplus::Bitmap* pPercentBitmapPart = pMemBitmapPercent-&gt;Clone(percent_rect, PixelFormatDontCare);
		pMemGraphics-&gt;DrawImage(pPercentBitmapPart, (rect.right - rect.left) / 2 - 50, rect.bottom - 29);
		delete pMemGraphicsPercent;
		delete pMemBitmapPercent;

		graphics.DrawImage(pMemBitmap, 0, 0);
		delete pMemBitmap;
		delete pMemGraphics;
</code></pre>
<p>... ok der Code istnoch nicht optimiert aber das ist ja auch nicht der Punkt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1265356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1265356</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Fri, 13 Apr 2007 13:52:13 GMT</pubDate></item><item><title><![CDATA[Reply to GDI+ DrawImage malt wo es nicht soll! on Fri, 13 Apr 2007 14:37:12 GMT]]></title><description><![CDATA[<p>Achja ... wenn fragen zum Code sind stellt sie einfach ... mir ist nur wichtig zu wissen warum DrawImage das Bild nicht an die angegebene Stelle setzt <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/1265389</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1265389</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Fri, 13 Apr 2007 14:37:12 GMT</pubDate></item><item><title><![CDATA[Reply to GDI+ DrawImage malt wo es nicht soll! on Sat, 14 Apr 2007 21:53:20 GMT]]></title><description><![CDATA[<p>Och meno der Code ist doch leicht verständlich und schön strukturiert ... hat keiner ne Idee warum DrawImage so falsch funktioniert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1266220</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1266220</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sat, 14 Apr 2007 21:53:20 GMT</pubDate></item><item><title><![CDATA[Reply to GDI+ DrawImage malt wo es nicht soll! on Sun, 15 Apr 2007 10:29:28 GMT]]></title><description><![CDATA[<p>Armer (D)Evil <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";D"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1266378</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1266378</guid><dc:creator><![CDATA[mikey]]></dc:creator><pubDate>Sun, 15 Apr 2007 10:29:28 GMT</pubDate></item><item><title><![CDATA[Reply to GDI+ DrawImage malt wo es nicht soll! on Sun, 15 Apr 2007 11:23:08 GMT]]></title><description><![CDATA[<p>Hm, haste mal im Debugger geguckt und die Werte verfolgt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1266400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1266400</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sun, 15 Apr 2007 11:23:08 GMT</pubDate></item><item><title><![CDATA[Reply to GDI+ DrawImage malt wo es nicht soll! on Sun, 15 Apr 2007 11:27:57 GMT]]></title><description><![CDATA[<p>Ja sind alle korrekt ... selbst wenn ich beim DrawImage feste Werte eingebe setzt er die Prozent-Leiste auf 0, 0</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1266405</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1266405</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 15 Apr 2007 11:27:57 GMT</pubDate></item><item><title><![CDATA[Reply to GDI+ DrawImage malt wo es nicht soll! on Sun, 15 Apr 2007 11:48:07 GMT]]></title><description><![CDATA[<p>War nur nen Tippfehler ... der Code ist sonnst vollkommen korrekt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> Ich depp ...</p>
<p>pMemBitmapPercent muss es auch beim erstellen vom pMemGraphicsPercent heißen ^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1266416</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1266416</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Sun, 15 Apr 2007 11:48:07 GMT</pubDate></item></channel></rss>