function GetGraphicClass( cClass: String ): TGraphicClass; begin if UpperCase(cClass) = 'TJPEGIMAGE' then Result := TJPEGImage else if UpperCase(cClass) = 'TGIFIMAGE' then Result := TGIFImage else if UpperCase(cClass) = 'TBITMAP' then Result := TBitmap else if UpperCase(cClass) = 'TICON' then Result := TIcon else if UpperCase(cClass) = 'TMETAFILE' then Result := TMetaFile else Result := TBitMap; end;
Comments
Be sure to add ppGif to your uses clause.
Try toggling the image component's DirectDraw property to true.
Make sure you have the latest printer driver installed.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
but...
it's appears error....
i thinks thats the problem is to saving GIF in blob file to be loaded
correctly to TGifImage component....
How is correct form...
To saving GIF in a blob, im using.....
// Image1: TImage; -- > it's a form image component
procedure SAVE;
var
ofs: TStream;
begin
TABLE.Append;
ofs := TMemoryStream.Create;
FotoPrd.Picture.Graphic.SaveToStream(ofs);
ofs.position := 0;
TABLEFieldImage.LoadFromStream(ofs);
TABLEFieldImageType.AsString :=
Image1.Picture.Graphic.ClassName;
TABLE.Post;
end;
I'm use this form...
procedure TForm1.LoadImage;
var
ofs: TStream;
Grclass: TGraphicClass;
Newgr, NewGrIcon: TGraphic;
begin
ofs := TMemoryStream.Create;
TABLEFieldImage.SaveToStream( ofs );
Grclass := GetGraphicClass( TABLEFieldImageType.AsString );
// it's result TGifImage class
NewGr := Grclass.Create;
ofs.Position := 0;
NewGr.LoadFromStream( ofs );
Image1.Picture.Graphic := Newgr;
end;
function GetGraphicClass( cClass: String ): TGraphicClass;
begin
if UpperCase(cClass) = 'TJPEGIMAGE' then
Result := TJPEGImage
else
if UpperCase(cClass) = 'TGIFIMAGE' then
Result := TGIFImage
else
if UpperCase(cClass) = 'TBITMAP' then
Result := TBitmap
else
if UpperCase(cClass) = 'TICON' then
Result := TIcon
else
if UpperCase(cClass) = 'TMETAFILE' then
Result := TMetaFile
else
Result := TBitMap;
end;