Ignore:
Timestamp:
Nov 26, 2012, 7:38:56 AM (12 years ago)
Author:
chronos
Message:
  • Added: Now PixelFormat for tests where TBitmap is used can be changed.
  • Fixed: Stopping of test of all methods.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/UDrawMethod.pas

    r453 r454  
    3333    function GetFPS: Real;
    3434    property FPS: Real read FFPS write FFPS;
    35     procedure Init(Parent: TWinControl; Size: TPoint); virtual;
     35    procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); virtual;
    3636    procedure Done; virtual;
    3737    constructor Create; virtual;
     
    4848  TDrawMethodImage = class(TDrawMethod)
    4949    Image: TImage;
    50     procedure Init(Parent: TWinControl; Size: TPoint); override;
     50    procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override;
    5151    procedure Done; override;
    5252  end;
     
    5757    PaintBox: TPaintBox;
    5858    procedure Paint(Sender: TObject); virtual;
    59     procedure Init(Parent: TWinControl; Size: TPoint); override;
     59    procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override;
    6060    procedure Done; override;
    6161  end;
     
    7171    procedure InitGL;
    7272    procedure OpenGLControlResize(Sender: TObject);
    73     procedure Init(AParent: TWinControl; Size: TPoint); override;
     73    procedure Init(AParent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override;
    7474    procedure Done; override;
    7575  end;
     
    8888end;
    8989
    90 procedure TDrawMethodPaintBox.Init(Parent: TWinControl; Size: TPoint);
    91 begin
    92   inherited Init(Parent, Size);
     90procedure TDrawMethodPaintBox.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat);
     91begin
     92  inherited;
    9393  PaintBox := TPaintBox.Create(Parent);
    9494  PaintBox.Parent := Parent;
     
    106106{ TDrawMethodImage }
    107107
    108 procedure TDrawMethodImage.Init(Parent: TWinControl; Size: TPoint);
    109 begin
    110   inherited Init(Parent, Size);
     108procedure TDrawMethodImage.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat);
     109begin
     110  inherited;
    111111  Image := TImage.Create(Parent);
    112112  Image.Parent := Parent;
    113113  Image.SetBounds(0, 0, Size.X, Size.Y);
    114114  Image.Picture.Bitmap.SetSize(Size.X, Size.Y);
    115   Image.Picture.Bitmap.PixelFormat := pf24bit;
     115  Image.Picture.Bitmap.PixelFormat := PixelFormat;
    116116  Image.Show;
    117117end;
     
    128128{ TDrawMethodOpenGL }
    129129
    130 procedure TDrawMethodOpenGL.Init(AParent: TWinControl; Size: TPoint);
    131 begin
    132   inherited Init(aParent, Size);
     130procedure TDrawMethodOpenGL.Init(AParent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat);
     131begin
     132  inherited;
    133133  OpenGLControl := TOpenGLControl.Create(AParent);
    134134  with OpenGLControl do begin
     
    193193end;
    194194
    195 procedure TDrawMethod.Init(Parent: TWinControl; Size: TPoint);
     195procedure TDrawMethod.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat);
    196196begin
    197197  if (TempBitmap.Width <> Size.X) or (TempBitmap.Height <> Size.Y) then
Note: See TracChangeset for help on using the changeset viewer.