diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-04-05 10:08:52 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2013-04-05 10:08:52 +0100 |
commit | 135c1deac21d749c6c1093e1740d3883d00d99ec (patch) | |
tree | 108b6e00a9adaccccda8b937544de7c1cdc9cc8b /docview/src | |
parent | 4c625c152b36b259435db5feffec7598f99f37ea (diff) | |
download | fpGUI-135c1deac21d749c6c1093e1740d3883d00d99ec.tar.xz |
docview: debug code to help debug reading images from INF files.
Diffstat (limited to 'docview/src')
-rw-r--r-- | docview/src/HelpBitmap.pas | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/docview/src/HelpBitmap.pas b/docview/src/HelpBitmap.pas index eb2d9190..ecce808f 100644 --- a/docview/src/HelpBitmap.pas +++ b/docview/src/HelpBitmap.pas @@ -1,11 +1,29 @@ +{ + fpGUI - Free Pascal GUI Toolkit + + Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + distribution, for details of the copyright. + + See the file COPYING.modifiedLGPL, included in this distribution, + for details about redistributing fpGUI. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + Description: + Encapsulates a bitmap as stored in a IPF file. Once created from + file data they can be used as a normal bitmap. +} + unit HelpBitmap; {$mode objfpc}{$H+} -interface +// Debug purposes only +{.$define LZW_DEBUG} -// Encapsulates a bitmap as stored in a IPF file. -// Once created from file data they can be used as a normal bitmap. +interface uses Classes, SysUtils, fpg_main, ctypes, @@ -564,6 +582,24 @@ begin AllocateImage(32, _Header.cx, _Header.cy); + + {$IFDEF LZW_DEBUG} + writeln('Width = ', Width); + writeln('Height = ', Height); + writeln('ImageDataSize = ', ImageDataSize); + writeln('------------- START -------------'); + for i := 1 to ImageDataSize do + begin + write(HexStr(BitmapOutputPointer[i-1],2)+' '); + if (i mod 16 = 0) then + writeln('') + else if (i mod 4 = 0) then + write (' | '); + end; + Writeln(''); + writeln('------------- END -------------'); + {$ENDIF} + if TotalSize <> ImageDataSize then writeln('Warning: INF Bitmap size and allocated bitmap size are different. ', TotalSize, ' vs ', ImageDataSize); Move(BitmapData^, ImageData^, TotalSize); |