Board index » delphi » TBipmap won't load .bmp saved with photoshop
Hertwig
Delphi Developer |
Hertwig
Delphi Developer |
TBipmap won't load .bmp saved with photoshop2004-06-17 04:25:16 AM delphi175 Hi, I have a problem with the TBitmap. It appears it won't load .bmp files that are created using Photoshop (notmap RGB photo). PaintShop will read it as will Windows Paint. Still I get a Stream Read Error when trying to load the bmp in a TBitmap. Does anyone recognize this? Btw. I use Delphi 7 Thank s in advance Hert |
Hertwig
Delphi Developer |
2004-06-17 04:29:08 AM
Re:TBipmap won't load .bmp saved with photoshop
ps bmp files created with other applications can be loaded without problems.
|
Samson Fu
Delphi Developer |
2004-06-17 08:47:32 AM
Re:TBipmap won't load .bmp saved with photoshop
Yes, this issue appears when your BMP file size is multiple of 16..
I don't know how to fix this in delphi. But you can load the bmp in windows paint and save again, then delphi is able to read the bmp.. -- Samson Fu "Hertwig" <XXXX@XXXXX.COM>writes news:40d0acfc$XXXX@XXXXX.COM... QuoteHi, |
Lord Crc
Delphi Developer |
2004-06-17 09:14:26 PM
Re:TBipmap won't load .bmp saved with photoshop
On Wed, 16 Jun 2004 22:25:16 +0200, "Hertwig" <XXXX@XXXXX.COM>
writes: QuoteI have a problem with the TBitmap. It appears it won't load .bmp files that previous post on this issue): In TBitmap.ReadDIB, find this line: // biSizeImage can be zero. If zero, compute the size. if biSizeImage = 0 then // top-down DIBs have negative height Replace the if statement with this: if (bmiHeader.biCompression = BI_RGB) then this will force it to calculate the correct value for all non-compressed RGB images, which should work always (as an RGB image is per definition uncompressed, it just a matter of arithmetics). - Asbjørn |
Hertwig
Delphi Developer |
2004-06-17 09:45:37 PM
Re:TBipmap won't load .bmp saved with photoshop
Thanks Lord Crc,
That did it! I can read the bitmap now. Hert ---------------------------------------------------- "Lord Crc" <XXXX@XXXXX.COM>writes QuoteOn Wed, 16 Jun 2004 22:25:16 +0200, "Hertwig" <XXXX@XXXXX.COM> |