<?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[LoadFromStream Lesefehler (Bitmap)]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich möchte aus einen Array ein Image (Graustufenbild) erzeugen. Leider bekomme ich immer die Fehlermeldung &quot;LoadFromStream Lesefehler&quot;. Ich bin mir nicht sicher wie ich die Header für eine Bitmap definieren soll. Vielleicht kann mir da jemand Helfen.</p>
<pre><code class="language-cpp">TBitmapFileHeader *BitmapFileHeader = new TBitmapFileHeader;
        TBitmapInfo *BitmapInfo = new TBitmapInfo;

        BitmapFileHeader-&gt;bfType=19778;    // ASCII CODE &quot;BM&quot;
        BitmapFileHeader-&gt;bfSize=sizeof(TBitmapFileHeader) + sizeof(TBitmapInfo) + 300*300;
        BitmapFileHeader-&gt;bfReserved1=0;
        BitmapFileHeader-&gt;bfReserved2=0;
        BitmapFileHeader-&gt;bfOffBits=sizeof(TBitmapFileHeader) + sizeof(TBitmapInfo);

        BitmapInfo-&gt;bmiHeader.biSize=sizeof(TBitmapInfoHeader);
        BitmapInfo-&gt;bmiHeader.biWidth=300;
        BitmapInfo-&gt;bmiHeader.biHeight=300;
        BitmapInfo-&gt;bmiHeader.biPlanes=1;
        BitmapInfo-&gt;bmiHeader.biBitCount=8;
        BitmapInfo-&gt;bmiHeader.biCompression=BI_RLE8; //BI_RGB;
        BitmapInfo-&gt;bmiHeader.biSizeImage=300*300;
        BitmapInfo-&gt;bmiHeader.biXPelsPerMeter=3780; // 96dpi
        BitmapInfo-&gt;bmiHeader.biYPelsPerMeter=3780;
        BitmapInfo-&gt;bmiHeader.biClrUsed=0;
        BitmapInfo-&gt;bmiHeader.biClrImportant=0;
        for (int i=0; i&lt;256; i++)
        {
                BitmapInfo-&gt;bmiColors[i].rgbBlue=i;
                BitmapInfo-&gt;bmiColors[i].rgbGreen=i;
                BitmapInfo-&gt;bmiColors[i].rgbRed=i;
                BitmapInfo-&gt;bmiColors[i].rgbReserved=0;
        }

        TMemoryStream* pMemStream = new TMemoryStream;
        pMemStream-&gt;Write(BitmapFileHeader, sizeof(TBitmapFileHeader));
        pMemStream-&gt;Write(BitmapInfo, sizeof(TBitmapInfo));
        pMemStream-&gt;Write(data8bit.pixeldata, 300*300);

        pMemStream-&gt;Write(data, 300*300);
        pMemStream-&gt;Position = 0;

        Graphics::TBitmap *pBmp = new Graphics::TBitmap();
        pBmp-&gt;LoadFromStream(pMemStream);

        SnapImage-&gt;Picture-&gt;Bitmap=pBmp;
</code></pre>
<p>Ich Hoffe das mir jemand Helfen kann.</p>
<p>Ich benötige dies für das arbeiten mit einer Framegrabberkarte. Vielleich hat ja jemand es geschaft die Digitalisierten Bilddaten auf den Bildschirm darzustellen mit z.B. 25 Bilder pro Sec.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/11735/loadfromstream-lesefehler-bitmap</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 23:39:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/11735.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 May 2003 08:36:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 08:36:00 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich möchte aus einen Array ein Image (Graustufenbild) erzeugen. Leider bekomme ich immer die Fehlermeldung &quot;LoadFromStream Lesefehler&quot;. Ich bin mir nicht sicher wie ich die Header für eine Bitmap definieren soll. Vielleicht kann mir da jemand Helfen.</p>
<pre><code class="language-cpp">TBitmapFileHeader *BitmapFileHeader = new TBitmapFileHeader;
        TBitmapInfo *BitmapInfo = new TBitmapInfo;

        BitmapFileHeader-&gt;bfType=19778;    // ASCII CODE &quot;BM&quot;
        BitmapFileHeader-&gt;bfSize=sizeof(TBitmapFileHeader) + sizeof(TBitmapInfo) + 300*300;
        BitmapFileHeader-&gt;bfReserved1=0;
        BitmapFileHeader-&gt;bfReserved2=0;
        BitmapFileHeader-&gt;bfOffBits=sizeof(TBitmapFileHeader) + sizeof(TBitmapInfo);

        BitmapInfo-&gt;bmiHeader.biSize=sizeof(TBitmapInfoHeader);
        BitmapInfo-&gt;bmiHeader.biWidth=300;
        BitmapInfo-&gt;bmiHeader.biHeight=300;
        BitmapInfo-&gt;bmiHeader.biPlanes=1;
        BitmapInfo-&gt;bmiHeader.biBitCount=8;
        BitmapInfo-&gt;bmiHeader.biCompression=BI_RLE8; //BI_RGB;
        BitmapInfo-&gt;bmiHeader.biSizeImage=300*300;
        BitmapInfo-&gt;bmiHeader.biXPelsPerMeter=3780; // 96dpi
        BitmapInfo-&gt;bmiHeader.biYPelsPerMeter=3780;
        BitmapInfo-&gt;bmiHeader.biClrUsed=0;
        BitmapInfo-&gt;bmiHeader.biClrImportant=0;
        for (int i=0; i&lt;256; i++)
        {
                BitmapInfo-&gt;bmiColors[i].rgbBlue=i;
                BitmapInfo-&gt;bmiColors[i].rgbGreen=i;
                BitmapInfo-&gt;bmiColors[i].rgbRed=i;
                BitmapInfo-&gt;bmiColors[i].rgbReserved=0;
        }

        TMemoryStream* pMemStream = new TMemoryStream;
        pMemStream-&gt;Write(BitmapFileHeader, sizeof(TBitmapFileHeader));
        pMemStream-&gt;Write(BitmapInfo, sizeof(TBitmapInfo));
        pMemStream-&gt;Write(data8bit.pixeldata, 300*300);

        pMemStream-&gt;Write(data, 300*300);
        pMemStream-&gt;Position = 0;

        Graphics::TBitmap *pBmp = new Graphics::TBitmap();
        pBmp-&gt;LoadFromStream(pMemStream);

        SnapImage-&gt;Picture-&gt;Bitmap=pBmp;
</code></pre>
<p>Ich Hoffe das mir jemand Helfen kann.</p>
<p>Ich benötige dies für das arbeiten mit einer Framegrabberkarte. Vielleich hat ja jemand es geschaft die Digitalisierten Bilddaten auf den Bildschirm darzustellen mit z.B. 25 Bilder pro Sec.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/62181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62181</guid><dc:creator><![CDATA[sadza]]></dc:creator><pubDate>Thu, 08 May 2003 08:36:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 08:59:00 GMT]]></title><description><![CDATA[<p>Warum schreibst du die Bilddaten nicht einfach per <em>ScanLine</em> direkt in das Bitmap?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/62182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62182</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Thu, 08 May 2003 08:59:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 09:07:00 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>mit ScanLine habe ich das schon Versucht und es Funktioniert wunderbar. Aber ich möchte ein Livebild erzeugen. Nur das bekomme ich nicht hin. Zwar gibt es funktionen wie z.B. capCreateCaptureWindow() mit den ich ein Fenster dazu erzeugen kann. Leider bekomme ich das Livebild nicht hin. Ich weiss nicht wie ich das Anstellen soll <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/62183</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62183</guid><dc:creator><![CDATA[sadza]]></dc:creator><pubDate>Thu, 08 May 2003 09:07:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 09:47:00 GMT]]></title><description><![CDATA[<p>Was spricht dagegen, das fertig gezeichnete Bitmap zB. einem TImage zuzuweisen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/62184</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62184</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Thu, 08 May 2003 09:47:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 10:22:00 GMT]]></title><description><![CDATA[<p>und wie wir so etwas gemacht, habe noch nicht viel mit den Builder gearbeitet.<br />
Also ich habe auf der Form ein Image erstellt und dort möchte ich das Livebild darstellen. So eine Framegrabberfunktion liefert mir immer den Pointer mit den Bildinformationen. Wenn ich jetzt mit ScanLine arbeite, wir mir immer nur das letzte aufgenommene Bild gezeigt. Arbeite ich aber im Debug-Modus, werden mir alle Bilder gezeigt. Woran kann das Liegen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/62185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62185</guid><dc:creator><![CDATA[sadza]]></dc:creator><pubDate>Thu, 08 May 2003 10:22:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 13:26:00 GMT]]></title><description><![CDATA[<p>Die Optimierung faßt Teilvorgänge zusammen und zeigt nur das Ergevnis an. Solche Probs hab ich öfter. Du mußt etwas einbauen, daß den Prozess dazu zwingt, eine Anzeige durchzuführen.</p>
<p>Geht es, wenn du myImage-&gt;Visible = false; setzt? Die Zuweisung des Bildes unsichtbar, dann wieder Visible schalten.</p>
<p>Hab aber auch mit sowas nicht immer Glück. myImage-&gt;Refresh(), ProzessMessages()... klappen manchmal, können aber auch als müde Fehlversuche enden. Bin also auch gespannt, was die Profis empfehlen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/62186</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62186</guid><dc:creator><![CDATA[Omega-X]]></dc:creator><pubDate>Thu, 08 May 2003 13:26:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 15:08:00 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>super Omega-X das mit Image-&gt;Refresh() funktioniert super. Danke für den Tip. Nur Flackert das Bild ein wenig. Kann man das unterbinden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/62187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62187</guid><dc:creator><![CDATA[sadza]]></dc:creator><pubDate>Thu, 08 May 2003 15:08:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 15:21:00 GMT]]></title><description><![CDATA[<p>Super, wenn's geklappt hat. In Schleifen ist es besonders schwer realisierbar.</p>
<p>Das mit dem Flickern hängt mit der Widerholrate zusammen. Noch geht es nicht so schnell, daß das Auge es nicht wahrnimmt. - Da du immer ganze Bilder einfügst, ist es mit einem Film vergleichbar.</p>
<p>Hast du eine neuere BCB-Version. Kannst mal mit DoubleBuffering probieren.</p>
<p>Oder:<br />
Mach das Image unsichtbar<br />
weis das Bild einer Speicherbitmap zu<br />
übernimm das Bild von der Speicherbitmap ins Image<br />
mach Image wieder sichtbar.</p>
<p>Warum nicht? Einen versuch könnte es wert sein. Auf die Art funktioniert ja DoubleBuffering (wenngleich es hier nicht so hilfreich sein dürfte).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/62188</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62188</guid><dc:creator><![CDATA[Omega-X]]></dc:creator><pubDate>Thu, 08 May 2003 15:21:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 16:20:00 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Danke für den nächsten Tip. Habe BCB 6.0 und das DoubleBuffering habe ich für<br />
die Form aktiviert. Also das hat nicht geholfen. Habe gelesen das die Funktion keinen einfluss auf das Image hat (habe in der Suchfunktion nachgesehen). Der zweite Vorschlag war schon etwas besser es Flackert immer noch aber ich glaube weniger. Hast mich aber schon sehr weit gebracht, deshalb nochmals Danke <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/62189</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62189</guid><dc:creator><![CDATA[sadza]]></dc:creator><pubDate>Thu, 08 May 2003 16:20:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 16:31:00 GMT]]></title><description><![CDATA[<p>Nichts zu danken. Du beziehst dich doch auf meinen Vorschlag, &quot;das fertig gezeichnete Bitmap zB. einem TImage zuzuweisen&quot;, oder? <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/62190</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62190</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Thu, 08 May 2003 16:31:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Thu, 08 May 2003 21:14:00 GMT]]></title><description><![CDATA[<p>War auch über den Dank ganz kleinlaut, <a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/52">@Jansen</a>. <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="🙂"
    /> Was ich gesagt hab, waren ja wirklich nur Zusatzinformationen.</p>
<p>Jetzt könnte ich zB. sagen, daß es jetzt besser zu sein scheint, rührt ggf. von der größeren Ordnung her. Das noch teilweise im Laden begriffene Bild wurde auf's bereits sichtbare Image übertragen, das bringt dann so einen Wischeffekt. Das vollständige Bild direkt aus dem Speicher mit Assign() kann die volle systemperformance nutzen. Aber ich sag es nicht. Das sind die kleinen Lerneffekte, die mit der Übung sowieso kommen. <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/62191</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/62191</guid><dc:creator><![CDATA[Omega-X]]></dc:creator><pubDate>Thu, 08 May 2003 21:14:00 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Mon, 04 Jun 2007 14:18:21 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>hab ein ähnliches Problem.<br />
Ich will den Inhalt eines Arrays in einen Stream schreiben, und aus diesem Stream dann ein TBitmap erzeugen.<br />
Das Array habe ich vorher schon so bearbeitet, daß dort sämtliche Informationen enthalten sind(FileHeader, InfoHeader...)</p>
<p>Der Buffer (m_RcvBuf) ist wie folgt deklariert:</p>
<p>//Breite * Hoehe * Byte/Pixel(24 bit)<br />
MAX_IMAGE_LEN_ = 640*280*3<br />
char m_RcvBuf[MAX_IMAGE_LEN_];</p>
<pre><code class="language-cpp">TMemoryStream *pms = new TMemoryStream;
  Graphics::TBitmap *bmp = new Graphics::TBitmap();

  if(m_RcvBuf[0] == 0) return false;
  pms-&gt;WriteBuffer(m_RcvBuf, sizeof(m_RcvBuf)));
  pms-&gt;Position = 0;

  int test = pms-&gt;Size;

  bmp-&gt;LoadFromStream(pms);

  Image2-&gt;Picture-&gt;Bitmap   = bmp;
</code></pre>
<p>Beim LoadFromStream bekomme ich immer den Fehler: Stream Read Error.</p>
<p>Kann bitte jemand helfen, ich verzweifel gleich;)</p>
<p>Vielen Dank.</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1298583</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1298583</guid><dc:creator><![CDATA[Gast123]]></dc:creator><pubDate>Mon, 04 Jun 2007 14:18:21 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Mon, 04 Jun 2007 14:30:21 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Evtl. liegt es an der Anzahl der Bytes beim Rausschreiben. Du schreibst ja hier den gesamten verfügbaren Puffer raus. Ist der aber auch vollständig belegt?<br />
Wie beschreibst du denn m_RcvBuf?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1298596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1298596</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Mon, 04 Jun 2007 14:30:21 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Mon, 04 Jun 2007 14:53:09 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>der Buffer ist vollständig beschrieben.<br />
Er liegt entsprechend dem HBITMAP Format vor.</p>
<p>Im Prinzip:</p>
<p>BitmapFileHeader + BitmapInfoHeader + 640*240 Pixel * 3(wegen 24 Bit-Codierung)</p>
<p>Mit den entsprechenden Windows-Api-Funktionen kann ich mir das Bitmap als DIB mit vorher gesetztem DeviceContext auch wunderbar anzeigen lassen.<br />
Nur brauch ich es eben als TBitmap.</p>
<p>mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1298627</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1298627</guid><dc:creator><![CDATA[Gast123]]></dc:creator><pubDate>Mon, 04 Jun 2007 14:53:09 GMT</pubDate></item><item><title><![CDATA[Reply to LoadFromStream Lesefehler (Bitmap) on Tue, 05 Jun 2007 15:53:47 GMT]]></title><description><![CDATA[<p>Wenn du den MemoryStream als Datei rausschreibst, lässt sich die Datei dann als BMP öffnen/wird sie korrekt angezeigt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1299426</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1299426</guid><dc:creator><![CDATA[Jansen]]></dc:creator><pubDate>Tue, 05 Jun 2007 15:53:47 GMT</pubDate></item></channel></rss>