????? ???????????????????

???????


??? ????????? ? ????????? ??? ??????????? ?? TImageList ? ???? ????

PDF Печать
??????

??????? WriteComponentResFile ????? ???? ???????????? ??? ?????????? ?? ??????? ??????????? Delphi ? ????? ????? ????????.

?????????? ??????????? TImageList ? ???? ????

????????, ? ??? ???? ????????? TImageList, ??????????? ?????????????, ?????? ?? ???? ??????????? ????? ???????? ? ??????? ???????? ImageIndex. ??? ??????????? ???????????? ??? ????????? ???????????, ?????, ??? ????, ?????? TreeView, ListView ? ?.?.

???? ?? ?????? ???????????? ??????????? ?? TImageList, ?? ?????? ????????? TImageList ?????????????, ????????? ??? ??????????? ? ????? ????? ????????, ? ????? ??????????? ????????? ??? ??????????? ?? ????????? ????? ? ??????????? ????????? TImageList.

WriteComponentResFile

????? ????????? ???????? ?????????? (? ????? ??????, ??? ImageList1) ? ????, ??????????? ????? WriteComponentResFile:


WriteComponentResFile('ImageList.dat', ImageList1);

ImageList1 - ??? ??? ?????????? TImageList, ??????? ????????? ? ??? ?? ????? ? ???????? ?????????????.

ReadComponentResFile

????? ????????? ???????? ?????????? ?? ?????, ??????????? ??????? ReadComponentResFile.

????????, ? ??? ???? ?????? ??????????? ? ImageList1 ? ?? ????????? ?? ? ????. ????? ???????????? ??? ??????????? ??????????, ? ????? ?????????? ?? ? ?????? TImage, ????? ???????????? ????????? ???:


procedure TForm1.Button1Click(Sender: TObject);
var
  imageList: TImageList;
begin
  imageList:= TImageList.Create(nil);
  try
    ReadComponentResFile('ImageList.dat', imageList);
    with imageList do
    begin
      GetBitmap(0, Image1.Picture.Bitmap);
      GetBitmap(1, Image2.Picture.Bitmap);
      GetBitmap(2, Image3.Picture.Bitmap);
      GetBitmap(3, Image4.Picture.Bitmap);
    end;
  finally
    FreeAndNil(imageList);
  end;
end;

??? ????????? ????? ???????? ?????, ??? ??? ??????????? ?? ??????????? ?????? ? ??????, ? ????? ????????? ?? ???? ?????????????. ? ????? ???????? ???????, ??? ??? ????? ???????????? TImageList ????? ??? ?? ?????????.


 

Добавить комментарий


Защитный код
Обновить