Changeset 454 for GraphicTest/UDrawMethod.pas
- Timestamp:
- Nov 26, 2012, 7:38:56 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/UDrawMethod.pas
r453 r454 33 33 function GetFPS: Real; 34 34 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; 36 36 procedure Done; virtual; 37 37 constructor Create; virtual; … … 48 48 TDrawMethodImage = class(TDrawMethod) 49 49 Image: TImage; 50 procedure Init(Parent: TWinControl; Size: TPoint ); override;50 procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override; 51 51 procedure Done; override; 52 52 end; … … 57 57 PaintBox: TPaintBox; 58 58 procedure Paint(Sender: TObject); virtual; 59 procedure Init(Parent: TWinControl; Size: TPoint ); override;59 procedure Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override; 60 60 procedure Done; override; 61 61 end; … … 71 71 procedure InitGL; 72 72 procedure OpenGLControlResize(Sender: TObject); 73 procedure Init(AParent: TWinControl; Size: TPoint ); override;73 procedure Init(AParent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); override; 74 74 procedure Done; override; 75 75 end; … … 88 88 end; 89 89 90 procedure TDrawMethodPaintBox.Init(Parent: TWinControl; Size: TPoint );91 begin 92 inherited Init(Parent, Size);90 procedure TDrawMethodPaintBox.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); 91 begin 92 inherited; 93 93 PaintBox := TPaintBox.Create(Parent); 94 94 PaintBox.Parent := Parent; … … 106 106 { TDrawMethodImage } 107 107 108 procedure TDrawMethodImage.Init(Parent: TWinControl; Size: TPoint );109 begin 110 inherited Init(Parent, Size);108 procedure TDrawMethodImage.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); 109 begin 110 inherited; 111 111 Image := TImage.Create(Parent); 112 112 Image.Parent := Parent; 113 113 Image.SetBounds(0, 0, Size.X, Size.Y); 114 114 Image.Picture.Bitmap.SetSize(Size.X, Size.Y); 115 Image.Picture.Bitmap.PixelFormat := pf24bit;115 Image.Picture.Bitmap.PixelFormat := PixelFormat; 116 116 Image.Show; 117 117 end; … … 128 128 { TDrawMethodOpenGL } 129 129 130 procedure TDrawMethodOpenGL.Init(AParent: TWinControl; Size: TPoint );131 begin 132 inherited Init(aParent, Size);130 procedure TDrawMethodOpenGL.Init(AParent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); 131 begin 132 inherited; 133 133 OpenGLControl := TOpenGLControl.Create(AParent); 134 134 with OpenGLControl do begin … … 193 193 end; 194 194 195 procedure TDrawMethod.Init(Parent: TWinControl; Size: TPoint );195 procedure TDrawMethod.Init(Parent: TWinControl; Size: TPoint; PixelFormat: TPixelFormat); 196 196 begin 197 197 if (TempBitmap.Width <> Size.X) or (TempBitmap.Height <> Size.Y) then
Note:
See TracChangeset
for help on using the changeset viewer.