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;


2008/07/17 14:27 2008/07/17 14:27
포스팅이 유익 하셨다면 RSS 구독을 신청하세요

Trackback Address >> http://dolba.net/tt/k2club/trackback/1895