
10.10.2011, 20:28
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Оставайтесь голодными... Оставайтесь безрассудными...
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TTexture = class(TObject)
public
Alpha: Integer;
Image: TImage;
constructor Create;
destructor Destroy; override;
end;
TMyObject = class(TObject)
public
Texture: TTexture;
constructor Create;
destructor Destroy; override;
end;
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{ TMyObject }
constructor TMyObject.Create;
begin
Texture:=TTexture.Create;
end;
destructor TMyObject.Destroy;
begin
Texture.Free;
inherited;
end;
{ TTexture }
constructor TTexture.Create;
begin
Image:=TImage.Create(nil);
end;
destructor TTexture.Destroy;
begin
Image.Free;
inherited;
end;
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
with TMyObject.Create do
begin
Texture.Alpha:=$ff;
Texture.Image.Picture.LoadFromFile('d:\Картинки\Разное\apple.bmp');
end;
end;
end.
__________________
Пишу программы за еду.
__________________
|