An FYI, and also wondering who has run into the same problems with possibly
a better resolution/fix:
Some changes were made in the Delphi 5 graphics.pas files relating to RLE
bitmaps that now cause Delphi 5 (and our app) to choke on RLEs. The two
sources of contention that we’ve found are in the TBitmap.ReadDIB and
TBitmap.WriteStream Procedures. The ReadDIB has a simple bug that reads
forward on a seek instead of backward, causing a stream read error (this
error is reproducable simply by dropping a TImage object onto a form and
loading an RLE bitmap into it). The following code change is the fix:
old code –
RLEStream.Seek( ImageSize, soFromEnd);
new code –
RLEStream.Seek(-1 * ImageSize, soFromEnd);
The second problem is that the TBitmapInfoHeader is being stripped off of
the stream somewhere in the code, and so when you try to reference the
header information of your bitmap, you get all kinds of fun runtime errors.
Commenting out the following code in the TBitmap.WriteStream procedure takes
care of the problem:
[code lang=”delphi”]
(*
if FImage.FSaveStream <> nil then
begin
>> insert BMF code here
Size := FImage.FSaveStream.Size;
if WriteSize then
Stream.WriteBuffer(Size, sizeof(Size));
Stream.Write(FImage.FSaveStream.Memory^, Size);
Exit;
end;
*)
[/code]
Any help with this – more info? Very much appreciated!!
Gretchen
0 Kommentare zu “Graphic: RLE Bitmaps”