
20.05.2011, 02:32
|
 |
.
|
|
Регистрация: 18.05.2011
Адрес: Омск
Сообщения: 3,970
Версия Delphi: 3,5,7,10,12,XE2
Репутация: выкл
|
|
Вот, на вскидку:
Код:
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ImgList, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Image1: TImage;
RadioGroup1: TRadioGroup;
ComboBox1: TComboBox;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
ImageList1: TImageList;
procedure RadioButton1Click(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Group : Integer;
Bmp : TBitmap;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Bmp := TBitmap.Create;
Bmp.Height := ImageList1.Height;
Bmp.Width := ImageList1.Width;
end;
procedure TForm1.RadioButton1Click(Sender: TObject);
var
I : Integer;
begin
Group := (Sender as TRadioButton).Tag * 3;
ComboBox1.Items.Clear;
for I := 0 to 2 do
ComboBox1.Items.Add(Format('Item - %d', [i]));
ComboBox1.ItemIndex := 0;
ComboBox1Change(NIL);
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
if ComboBox1.Items.Count > 0 then
begin
ImageList1.Draw(Bmp.Canvas, 0, 0, Group + ComboBox1.ItemIndex);
Image1.Picture.Assign(Bmp);
end;
end;
end.
|