Required : GraphicEx
GraphicEx 컴퍼넌트를 이용하여 다양한 포맷의 이미지 파일을 로드한후 이를 다시 TImage에 할당하는 방법을 이용.
uses
GraphicEx
...
procedure TForm1.DoLoad(const FileName: String); var GraphicClass: TGraphicExGraphicClass; Graphic: TGraphic; begin Screen.Cursor := crHourGlass; try try GraphicClass := FileFormatList.GraphicFromContent(FileName); if GraphicClass = nil then Image1.Picture.LoadFromFile(FileName) else begin Graphic := GraphicClass.Create; Graphic.LoadFromFile(FileName); Image1.Picture.Graphic := Graphic; end; except end; finally Screen.Cursor := crDefault; end; end;