+ setting image attributes when loading images

* fixing copyright section in the file header
This commit is contained in:
mazen 2003-09-09 11:26:59 +00:00
parent 43840ab3ca
commit d76b345184

View File

@ -1,7 +1,8 @@
{*****************************************************************************}
{ {
$Id$ $Id$
This file is part of the Free Pascal run time library. This file is part of the Free Pascal's "Free Components Library".
Copyright (c) 2003 by the Free Pascal development team Copyright (c) 2003 by Mazen NEIFER of the Free Pascal development team
BMP writer implementation. BMP writer implementation.
@ -11,8 +12,8 @@
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
}
**********************************************************************} {*****************************************************************************}
{$mode objfpc}{$h+} {$mode objfpc}{$h+}
unit FPReadBMP; unit FPReadBMP;
@ -58,9 +59,6 @@ implementation
uses BMPcomn; uses BMPcomn;
const
WhiteSpace = ' '#8#10#13;
constructor TFPReaderBMP.create; constructor TFPReaderBMP.create;
begin begin
inherited create; inherited create;
@ -85,7 +83,12 @@ procedure TFPReaderBMP.InternalRead(Stream:TStream; Img:TFPCustomImage);
begin begin
Stream.Read(BFI,SizeOf(BFI)); Stream.Read(BFI,SizeOf(BFI));
with BFI do with BFI do
if(bitCount = 8) begin
Img.Width:=Width;
Img.Height:=Height;
BytesPerPixel:=BitCount SHR 3;
end;
if BytesPerPixel=1
then then
begin begin
// stream.read(Palet, bfh.bfOffset - 54); // stream.read(Palet, bfh.bfOffset - 54);
@ -140,7 +143,11 @@ initialization
end. end.
{ {
$Log$ $Log$
Revision 1.1 2003-09-08 14:10:10 mazen Revision 1.2 2003-09-09 11:26:59 mazen
+ setting image attributes when loading images
* fixing copyright section in the file header
Revision 1.1 2003/09/08 14:10:10 mazen
+ adding support for loading bmp images + adding support for loading bmp images
} }