Changeset 8 for trunk/Forms


Ignore:
Timestamp:
Sep 19, 2014, 9:47:22 AM (10 years ago)
Author:
chronos
Message:
  • Modified: To support generic custom user defined runtime color formats TGColor have to reference directly TGColorFormat class. Also it is faster as we don't need to create instance of TGColorFormat from TGColorFormatClass.

But used color formats can't be freed or their parameters modified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormNew.pas

    r2 r8  
    4747  ColorFormat: TGColorFormat;
    4848begin
    49   ColorFormat := ColorManager.Formats[ComboBoxColorFormat.ItemIndex].Create;
    50   LabelMemRequire.Caption := IntToStr(SpinEditWidth.Value * SpinEditHeight.Value * ColorFormat.GetBitDepth div 8) + ' bytes';
    51   ColorFormat.Free;
     49  ColorFormat := ColorManager.Formats[ComboBoxColorFormat.ItemIndex];
     50  LabelMemRequire.Caption := IntToStr(SpinEditWidth.Value * SpinEditHeight.Value *
     51    ColorFormat.GetBitDepth div 8) + ' bytes';
    5252end;
    5353
     
    5959  ComboBoxColorFormat.Clear;
    6060  for I := 0 to ColorManager.FormatCount - 1 do begin
    61     ColorFormat := ColorManager.Formats[I].Create;
     61    ColorFormat := ColorManager.Formats[I];
    6262    ComboBoxColorFormat.AddItem(ColorFormat.GetName, nil);
    63     ColorFormat.Free;
    6463  end;
    6564  if ComboBoxColorFormat.Items.Count > 0 then
Note: See TracChangeset for help on using the changeset viewer.