Ignore:
Timestamp:
Dec 22, 2016, 1:01:41 PM (8 years ago)
Author:
chronos
Message:
  • Added: Color format manager.
  • Modified: Color formats moved to separate files.
Location:
branches/gbitmap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gbitmap

    • Property svn:ignore
      •  

        old new  
        44project1.res
        55project1.exe
         6heaptrclog.trc
  • branches/gbitmap/UFormMain.pas

    r20 r21  
    77uses
    88  GImage, Classes, SysUtils, FileUtil, Forms, Graphics, Controls, Dialogs, Menus,
    9   ExtCtrls, StdCtrls, GPixmap, UPixmapSpecialized;
     9  ExtCtrls, StdCtrls, GPixmap, UPixmapSpecialized, UColorGray1, UColorGray2,
     10  UColorGray4, UColorGray8, UColorRGB8, UColorRGBA8, UColorRGB565;
    1011
    1112type
     
    275276  with Image do begin
    276277    Size := Point(100, 100);
    277     ColorFormat := cfGray2;
     278    ColorFormat := ColorFormatManager.Formats[1];
    278279    Fill(GImage.TColor.Create(ColorFormat, cnWhite));
    279280    Pixels[0, 0] := GImage.TColor.Create(ColorFormat, cnBlack);
     
    287288procedure TForm1.FormShow(Sender: TObject);
    288289begin
     290  with ColorFormatManager do begin
     291    RegisterFormat(TColorFormatGray1);
     292    RegisterFormat(TColorFormatGray2);
     293    RegisterFormat(TColorFormatGray4);
     294    RegisterFormat(TColorFormatGray8);
     295    RegisterFormat(TColorFormatRGB8);
     296    RegisterFormat(TColorFormatRGBA8);
     297    RegisterFormat(TColorFormatRGB565);
     298  end;
    289299  ListBox1.ItemIndex := 0;
    290300end;
Note: See TracChangeset for help on using the changeset viewer.