| 588 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 589 | 
   | 
   size: Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 590 | 
   | 
   x, y: Word; | 
 
 
 
 
 
 
 
 
 
 
 
 | 591 | 
 < | 
   bpp:  Byte; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 592 | 
 < | 
   minside: Byte; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 593 | 
 < | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 594 | 
 < | 
   minside := 1; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 595 | 
 < | 
   case Self.FStoreType of | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 596 | 
 < | 
     9: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 597 | 
 < | 
     begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 598 | 
 < | 
       bpp := 4; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 599 | 
 < | 
       minside := 4; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 600 | 
 < | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 601 | 
 < | 
     0, 1, 2: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 602 | 
 < | 
       bpp := 16; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 603 | 
 < | 
     8: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 604 | 
 < | 
       bpp := 32; | 
 
 
 
 
 
 
 
 
 
 | 591 | 
 > | 
  | 
 
 
 
 
 
 | 592 | 
 > | 
   function GetImgSize(w,h, storetype: Integer): Integer; | 
 
 
 
 
 
 | 593 | 
 > | 
   begin | 
 
 
 
 
 
 | 594 | 
 > | 
     case storetype of | 
 
 
 
 
 
 | 595 | 
 > | 
       0, 1, 2: | 
 
 
 
 
 
 | 596 | 
 > | 
         Result := w*h*2; | 
 
 
 
 
 
 | 597 | 
 > | 
       8: | 
 
 
 
 
 
 | 598 | 
 > | 
         Result := w*h*4; | 
 
 
 
 
 
 | 599 | 
 > | 
       9: | 
 
 
 
 
 
 | 600 | 
 > | 
         Result :=  Max(1, w div 4) * Max(1, h div 4) * 8; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 601 | 
   | 
     else | 
 
 
 
 
 
 
 
 
 
 
 
 | 602 | 
 < | 
       Result := 0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 603 | 
 < | 
       Exit; | 
 
 
 
 
 
 
 
 
 
 | 602 | 
 > | 
       Result := -1; | 
 
 
 
 
 
 | 603 | 
 > | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 | 604 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 605 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 606 | 
 + | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 607 | 
   | 
   x    := Self.FWidth; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 608 | 
   | 
   y    := Self.FHeight; | 
 
 
 
 
 
 
 
 
 
 
 
 | 609 | 
 < | 
   size := (x * y * bpp) div 8; | 
 
 
 
 
 
 
 
 
 
 | 609 | 
 > | 
   size := GetImgSize(x, y, FStoreType); | 
 
 
 
 
 
 
 
 
 
 
 
 | 610 | 
   | 
   if fading then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 611 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 612 | 
   | 
     repeat | 
 
 
 
 
 
 
 
 
 
 
 
 | 613 | 
 < | 
       x    := x div 2; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 614 | 
 < | 
       y    := y div 2; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 615 | 
 < | 
       size := size + (x * y * bpp) div 8; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 616 | 
 < | 
     until (x = minside) or (y = minside); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 620 | 
 < | 
     if FStoreType = 9 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 621 | 
 < | 
     begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 622 | 
 < | 
       repeat | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 623 | 
 < | 
         x    := x div 2; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 624 | 
 < | 
         y    := y div 2; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 625 | 
 < | 
         size := size + (x * y * 16) div 8; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 626 | 
 < | 
       until (x = 1) or (y = 1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 627 | 
 < | 
     end; | 
 
 
 
 
 
 
 
 
 
 | 613 | 
 > | 
       x    := Max(x div 2, 1); | 
 
 
 
 
 
 | 614 | 
 > | 
       y    := Max(y div 2, 1); | 
 
 
 
 
 
 | 615 | 
 > | 
       size := size + GetImgSize(x, y, FStoreType); | 
 
 
 
 
 
 | 616 | 
 > | 
     until (x = 1) and (y = 1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 617 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 618 | 
   | 
   Result := size; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 619 | 
   | 
 end; |