아래 소스는 GraphicEx를 이용하여 각종 포맷의 이미지를 표시하는 Delphi용 코드입니다.
이를 Cbuilder용 코드로 변환하려고 합니다.
Graphic과 GraphicClass간의 연결을 어떻게 하는지 도저히 모르겟네요...
Delphi-> Graphic := GraphicClass.Create;
Cbuilder-> ????
도와주세요...
uses
GraphicEx
...
procedure TForm1.DoLoad(const FileName: String);
var
: 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; |