Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The key portion of the code you linked to is below, where <code>IList</code> is a <code>TStrings</code> with the names of all the files to include in the animation.</p> <pre><code>for i := 0 to IList.Count - 1 do begin AssignFile(BFile, IList[i]); Reset(BFile, 1); Seek(BFile, m_bfh.bfOffBits); BlockRead(BFile, m_MemBits[0], m_Bih.biSizeImage); Seek(BFile, SizeOf(m_Bfh)); BlockRead(BFile, m_MemBitMapInfo[0], length(m_MemBitMapInfo)); CloseFile(BFile); if AVIStreamWrite(psCompressed, i, 1, @m_MemBits[0], m_Bih.biSizeImage, AVIIF_KEYFRAME, 0, 0) &lt;&gt; 0 then begin ShowMessage('Error during Write AVI File'); break; end; end; </code></pre> <p>It reads portions of the file from disk and writes them to the AVI stream. The important part is that it reads from the <em>files</em>. The in-memory representation of a <code>TBitmap</code> doesn't necessarily match with the representation of a file. However, it's easy to adapt the given code to temporarily store the bitmaps in a memory stream; the stream will match what the layout of the file would be. Suppose <code>IList</code> is now an array of <code>TBitmap</code>, as you suggested. Then we could use this:</p> <pre><code>var ms: TMemoryStream; ms := TMemoryStream.Create; try for i := 0 to Length(IList) - 1 do begin IList[i].SaveToStream(ms); ms.Position := m_bfh.bfOffBits; ms.ReadBuffer(m_MemBits[0], m_Bih.biSizeImage); ms.Position := SizeOf(m_Bfh); ms.ReadBuffer(m_MemBitMapInfo[0], Length(m_MemBitMapInfo)); ms.Clear; if AVIStreamWrite(psCompressed, i, 1, @m_MemBits[0], m_Bih.biSizeImage, AVIIF_KEYFRAME, 0, 0) &lt;&gt; 0 then begin ShowMessage('Error during Write AVI File'); break; end; end; finally ms.Free; end; </code></pre> <p>There's code earlier in your cited example that reads the first file in the list to populate the various records and size the arrays used here, but you should be able to make the same changes there as I have done to the code shown here.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload