Changeset 20 for branches/gbitmap/UFormMain.pas
- Timestamp:
- Dec 21, 2016, 3:49:27 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gbitmap/UFormMain.pas
r19 r20 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,9 ExtCtrls, StdCtrls, GPixmap, UPixmapSpecialized , GImage;8 GImage, Classes, SysUtils, FileUtil, Forms, Graphics, Controls, Dialogs, Menus, 9 ExtCtrls, StdCtrls, GPixmap, UPixmapSpecialized; 10 10 11 11 type … … 28 28 function RGB8Random(Position: TPoint): TColorRGB8; 29 29 function RGB16Random(Position: TPoint): TColorRGB16; 30 function ColorRandom(Position: TPoint; ColorFormat: TColorFormat): GImage.TColor; 30 31 public 31 32 procedure TestGray1; … … 96 97 end; 97 98 99 function TForm1.ColorRandom(Position: TPoint; ColorFormat: TColorFormat): GImage.TColor; 100 begin 101 Result := GImage.TColor.Create; 102 Result.ColorFormat := ColorFormat; 103 Result.SetRandom; 104 end; 105 98 106 procedure TForm1.TestGray1; 99 107 var … … 262 270 procedure TForm1.TestImage; 263 271 var 264 Image: TGImage; 265 Color: TBColorGray1; 266 begin 267 Image := TGImage.Create; 272 Image: GImage.TPixmap; 273 begin 274 Image := GImage.TPixmap.Create; 268 275 with Image do begin 269 276 Size := Point(100, 100); 270 ColorFormat := cfGray1; 271 Color := TBColorGray1.Create; 272 Color.Value := 1; 273 Fill(Color); 274 Random; 277 ColorFormat := cfGray2; 278 Fill(GImage.TColor.Create(ColorFormat, cnWhite)); 279 Pixels[0, 0] := GImage.TColor.Create(ColorFormat, cnBlack); 280 Fill(ColorRandom); 275 281 PaintToCanvas(Image1.Picture.Bitmap.Canvas); 282 Label1.Caption := IntToStr(GetDataSize); 276 283 Free; 277 284 end;
Note:
See TracChangeset
for help on using the changeset viewer.