<?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[TPNGObject mit TImage - TypeCast - Problem]]></title><description><![CDATA[<p>Hallo!</p>
<p>Benutzt noch jemand die schöne PNG - Komponente von <a href="http://pngdelphi.sourceforge.net" rel="nofollow">http://pngdelphi.sourceforge.net</a> ?</p>
<p>Ich habe dazu nämlich eine Frage / Problem:<br />
Und zwar habe ich in einem TImage-&gt;TPicture ein PNGObject geladen. Das geht ja ganz einfach über den Bild-Editor (oder über Picture-&gt;Assign() ).<br />
Nun möchte ich jedoch einzelne Pixel-Werte werändern. Dies geht laut Dokumentation über die Property &quot;TPNGObject-&gt;Pixels[x,j]=TColor&quot;.</p>
<p>Nun weiß ich nicht, wie man auf &quot;Pixels[]&quot; zugreifen kann, wenn mein TPNGObject in diesem TImage &quot;steckt&quot;. Da es abgeleitet davon ist, muss man ja irgendwie an die Eigenschaft &quot;Pixels&quot; kommen.</p>
<pre><code class="language-cpp">TImage-&gt;Picture-&gt;Pixels[1,1]
</code></pre>
<p>und</p>
<pre><code class="language-cpp">TImage-&gt;Picture-&gt;Graphic-&gt;Pixels[1,1]
</code></pre>
<p>haben bei mir nicht zum erfolg geführt.</p>
<p>Zusatz:<br />
Ich habe noch dies ausprobiert, aber irgendwie will der Compiler noch zustäzliche Argumente haben, aber eigentlich habe ich alles angegeben:</p>
<pre><code class="language-cpp">((TPNGObject *)Image2-&gt;Picture-&gt;Graphic)-&gt;Pixels[1,1]=clRed;
</code></pre>
<p>Kann mir jemand helfen?</p>
<p>Zitat aus der Doku zu TPNGObject:</p>
<blockquote>
<p>This is the main object for the component. By default it's derived from TGraphic in order to integrates with Delphi and to be able to be used with TPicture, TImage and many others. To gain access to when using TImage or TPicture, typecast the TImage.Picture.Graphic or TPicture.Graphic to TPNGObject. The object provides access to some interesting and important features.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/topic/93464/tpngobject-mit-timage-typecast-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 19:31:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/93464.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 29 Nov 2004 17:23:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TPNGObject mit TImage - TypeCast - Problem on Mon, 29 Nov 2004 17:36:52 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Benutzt noch jemand die schöne PNG - Komponente von <a href="http://pngdelphi.sourceforge.net" rel="nofollow">http://pngdelphi.sourceforge.net</a> ?</p>
<p>Ich habe dazu nämlich eine Frage / Problem:<br />
Und zwar habe ich in einem TImage-&gt;TPicture ein PNGObject geladen. Das geht ja ganz einfach über den Bild-Editor (oder über Picture-&gt;Assign() ).<br />
Nun möchte ich jedoch einzelne Pixel-Werte werändern. Dies geht laut Dokumentation über die Property &quot;TPNGObject-&gt;Pixels[x,j]=TColor&quot;.</p>
<p>Nun weiß ich nicht, wie man auf &quot;Pixels[]&quot; zugreifen kann, wenn mein TPNGObject in diesem TImage &quot;steckt&quot;. Da es abgeleitet davon ist, muss man ja irgendwie an die Eigenschaft &quot;Pixels&quot; kommen.</p>
<pre><code class="language-cpp">TImage-&gt;Picture-&gt;Pixels[1,1]
</code></pre>
<p>und</p>
<pre><code class="language-cpp">TImage-&gt;Picture-&gt;Graphic-&gt;Pixels[1,1]
</code></pre>
<p>haben bei mir nicht zum erfolg geführt.</p>
<p>Zusatz:<br />
Ich habe noch dies ausprobiert, aber irgendwie will der Compiler noch zustäzliche Argumente haben, aber eigentlich habe ich alles angegeben:</p>
<pre><code class="language-cpp">((TPNGObject *)Image2-&gt;Picture-&gt;Graphic)-&gt;Pixels[1,1]=clRed;
</code></pre>
<p>Kann mir jemand helfen?</p>
<p>Zitat aus der Doku zu TPNGObject:</p>
<blockquote>
<p>This is the main object for the component. By default it's derived from TGraphic in order to integrates with Delphi and to be able to be used with TPicture, TImage and many others. To gain access to when using TImage or TPicture, typecast the TImage.Picture.Graphic or TPicture.Graphic to TPNGObject. The object provides access to some interesting and important features.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/662102</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/662102</guid><dc:creator><![CDATA[Genscher]]></dc:creator><pubDate>Mon, 29 Nov 2004 17:36:52 GMT</pubDate></item><item><title><![CDATA[Reply to TPNGObject mit TImage - TypeCast - Problem on Mon, 29 Nov 2004 17:48:33 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>versuch mal den Cast und Arrayzugriff :</p>
<pre><code>TPNGObject *PNGObject = [b]dynamic_cast[/b]&lt;TPNGObject *&gt; (Image2-&gt;Picture-&gt;Graphic);
if (PNGObject != NULL) PNGObject-&gt;Pixels[b][1][1][/b] = clRed;
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/662128</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/662128</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Mon, 29 Nov 2004 17:48:33 GMT</pubDate></item><item><title><![CDATA[Reply to TPNGObject mit TImage - TypeCast - Problem on Mon, 29 Nov 2004 18:20:19 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Hey, funktioniert super! Ich kann alle einzelnen Pixel-Werte abrufen.<br />
Auch das rot-färben klappt jetzt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /><br />
Viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/662146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/662146</guid><dc:creator><![CDATA[Genscher]]></dc:creator><pubDate>Mon, 29 Nov 2004 18:20:19 GMT</pubDate></item></channel></rss>