summaryrefslogtreecommitdiff
path: root/src/corelib/gfx_imgfmt_bmp.pas
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-07-11 13:42:39 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-07-11 13:42:39 +0000
commit34abe19ad2877ca470c75cbad2e9189ba346d54f (patch)
treedc0a3a787ef1f1e6931026f93d918531dcca9868 /src/corelib/gfx_imgfmt_bmp.pas
parent3920a40d796da321010cc456fc864e552b97e398 (diff)
downloadfpGUI-34abe19ad2877ca470c75cbad2e9189ba346d54f.tar.xz
* Removed many compiler warnings from the gfx_imgfmt_bmp unit.
* Minor fix in the ImageList class. * Minor fixes in the Tree and TreeNode classes. * GUI Test Runner: Added image support in the test treeview. * Started a project for unit testing fpGUI components - starting with the treeview.
Diffstat (limited to 'src/corelib/gfx_imgfmt_bmp.pas')
-rw-r--r--src/corelib/gfx_imgfmt_bmp.pas17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/corelib/gfx_imgfmt_bmp.pas b/src/corelib/gfx_imgfmt_bmp.pas
index 54d4bfd3..46e5f0a8 100644
--- a/src/corelib/gfx_imgfmt_bmp.pas
+++ b/src/corelib/gfx_imgfmt_bmp.pas
@@ -15,7 +15,7 @@ uses
gfxbase{, fpcanvas};
procedure ReadImage_BMP(img: TfpgImage; bmp: Pointer; bmpsize: longword);
-function LoadImage_BMP(const AFileName: string): TfpgImage;
+function LoadImage_BMP(const AFileName: String): TfpgImage;
function CreateImage_BMP(bmp: Pointer; bmpsize: longword): TfpgImage;
implementation
@@ -26,11 +26,11 @@ begin
ReadImage_BMP(Result, bmp, bmpsize);
end;
-function LoadImage_BMP(const AFileName: string): TfpgImage;
+function LoadImage_BMP(const AFileName: String): TfpgImage;
var
AFile: file of char;
AImageData: Pointer;
- AImageDataSize: longint;
+ AImageDataSize: integer;
begin
Result := nil;
if not FileExists(AFileName) then
@@ -40,6 +40,7 @@ begin
FileMode := fmOpenRead; // read-only
Reset(AFile);
AImageDataSize := FileSize(AFile);
+ AImageData := nil;
GetMem(AImageData, AImageDataSize);
try
BlockRead(AFile, AImageData^, AImageDataSize);
@@ -92,10 +93,6 @@ type
// Every line padded to 32 bits
// The lines stored bottom-up
-type
- PByte = ^byte;
- Pword = ^word;
- Plongword = ^longword;
procedure ReadImage_BMP(img: TfpgImage; bmp: Pointer; bmpsize: longword);
var
@@ -109,8 +106,8 @@ var
b: byte;
bit: byte;
bcnt: byte;
- linecnt: longword;
- pixelcnt: longword;
+ linecnt: integer;
+ pixelcnt: integer;
pdest: Plongword;
depth: integer;
@@ -168,7 +165,7 @@ begin
pcol := ppal;
pixelcnt := 0;
- while integer(p) < integer(pdata) do
+ while (p) < (pdata) do
begin
pcol^ := Plongword(p)^;
//Writeln('color: ',HexStr(pcol^,8));