我想使用的TImage我的組件裏面,但我收到上線一個編譯器錯誤" Image.Parent:=Self;" as 'incompatible type 'TWinControl' and 'TGasTurbine'
使用的TImage我的組件裏面
所以「TGasTurbine是我的組件名稱
這裏是我的畫圖程序。我該怎麼辦?
Procedure TGasTurbine.Paint;
var
Image: TImage;
begin
Inherited;
Image := TImage.Create(self);
Image.Parent:=Self;
Image.Height := 100;
Image.Width := 100;
Image.Stretch:=True;
Image.Picture.LoadFromFile('H:\Component\Automation\Pump.Bmp');
end;
我使用的基類是TGraphicControl和關於在繪製過程中創建TImage過程你是對的我只是現在糾正它並將代碼移動到Create Constructor但它已經引發錯誤 – Fayyaz 2015-03-25 06:26:00
看添加 – MBo 2015-03-25 06:54:30