- Timestamp:
- Apr 9, 2015, 9:58:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/Packages/bgrabitmap/bgracompressablebitmap.pas
r452 r472 44 44 procedure Decompress; 45 45 procedure FreeData; 46 procedure Init; 46 47 public 47 48 CompressionLevel: Tcompressionlevel; … … 62 63 property Width : Integer read FWidth; 63 64 property Height: Integer read FHeight; 64 property Caption : string read FCaption ;65 property Caption : string read FCaption write FCaption; 65 66 66 67 end; … … 77 78 constructor TBGRACompressableBitmap.Create; 78 79 begin 79 FUncompressedData := nil; 80 FCompressedDataArray := nil; 81 FWidth := 0; 82 FHeight := 0; 83 FCaption := ''; 84 FCompressionProgress := 0; 85 CompressionLevel := clfastest; 80 Init; 86 81 end; 87 82 88 83 constructor TBGRACompressableBitmap.Create(Source: TBGRABitmap); 89 84 begin 90 FUncompressedData := nil; 91 FCompressedDataArray := nil; 92 FWidth := 0; 93 FHeight := 0; 94 FCaption := ''; 95 FCompressionProgress := 0; 85 Init; 96 86 Assign(Source); 97 87 end; … … 219 209 setlength(FCaption,WinReadLongint(AStream)); 220 210 AStream.Read(FCaption[1],length(FCaption)); 221 if (FWidth=0) or (FHeight = 0) then exit; 211 if (FWidth=0) or (FHeight = 0) then 212 begin 213 FUncompressedData := TMemoryStream.Create; 214 exit; 215 end; 222 216 223 217 FBounds.Left := WinReadLongint(AStream); … … 234 228 FCompressedDataArray[i].CopyFrom(AStream,size); 235 229 end; 230 231 if FCompressedDataArray = nil then 232 FUncompressedData := TMemoryStream.Create; 236 233 end; 237 234 … … 270 267 end; 271 268 269 procedure TBGRACompressableBitmap.Init; 270 begin 271 FUncompressedData := nil; 272 FCompressedDataArray := nil; 273 FWidth := 0; 274 FHeight := 0; 275 FCaption := ''; 276 FCompressionProgress := 0; 277 CompressionLevel := clfastest; 278 end; 279 272 280 { Copy a bitmap into this object. As it is copied, you need not 273 281 keep a copy of the source }
Note:
See TracChangeset
for help on using the changeset viewer.