ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/Tools/Preview.pas
(Generate patch)

Comparing oup/current/Tools/Preview.pas (file contents):
Revision 111 by alloc, Wed Feb 21 03:28:48 2007 UTC vs.
Revision 192 by alloc, Thu May 24 17:48:18 2007 UTC

# Line 29 | Line 29 | type
29      procedure SetBitmapCount(Count: Integer);
30      procedure LoadImage(fileid, index: Integer);
31    private
32 <    bitmaps:   array of TBitmap;
32 >    bitmaps:   array of TOniImage;
33      actualimg: Byte;
34      _fileid:   Integer;
35    public
# Line 40 | Line 40 | var
40  
41   implementation
42   {$R *.dfm}
43 + uses Imaging, ImagingComponents, ImagingTypes;
44  
45  
46   procedure TForm_Preview.FormCreate(Sender: TObject);
# Line 82 | Line 83 | end;
83  
84  
85   procedure TForm_Preview.LoadImage(fileid, index: Integer);
85 var
86  memstream: TMemoryStream;
87  OniImage:  TOniImage;
86   begin
87 <  OniImage := TOniImage.Create;
90 <  OniImage.Load(ConnectionID, fileid);
91 <  memstream := TMemoryStream.Create;
92 <  OniImage.GetAsBMP(TStream(memstream));
93 <  OniImage.Free;
94 <  bitmaps[index].LoadFromStream(memstream);
95 <  memstream.Free;
87 >  bitmaps[index].Load(ConnectionID, fileid);
88   end;
89  
90  
91   procedure TForm_Preview.DrawImage(index: Integer);
92   begin
93 <  BitBlt(img.Canvas.Handle, 0, 0, img.Width, img.Height,
102 <    bitmaps[index].Canvas.Handle, 0, 0, WHITENESS);
103 <  BitBlt(img.Canvas.Handle, 0, 0, bitmaps[index].Width, bitmaps[index].Height,
104 <    bitmaps[index].Canvas.Handle, 0, 0, SRCCOPY);
105 <  img.Invalidate;
93 >  bitmaps[index].DrawOnCanvas(img.Canvas, 0);
94   end;
95  
96  
# Line 121 | Line 109 | begin
109      i := Length(bitmaps);
110      SetLength(bitmaps, Count);
111      for i := i to High(bitmaps) do
112 <      bitmaps[i] := TBitmap.Create;
112 >      bitmaps[i] := TOniImage.Create;
113    end;
114   end;
115  

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)