V
venden
Unregistered / Unconfirmed
GUEST, unregistred user!
扂蚚D5笢腔ADO蟀諉MSSQL7奻※控瑞§ㄛ砑珆尨种忮埜芞砉ㄛ砑蚚霜堤ㄛ筍婓堍俴奀佽※INVALID CLASS TYPECAST§
var
bs:TBlobStream;
begin
bs := TBlobStream.Create(
DBNav.DataSource.DataSet.FieldByName('Photo') as TBlobField, bmRead); //<--森揭拸楊籵徹
try
if bs.Size > 0 then
begin
if assigned(dbimgPortrait.Picture.Graphic) then
dbimgPortrait.Picture.Graphic.Free;
dbimgPortrait.Picture.Graphic := TBitMap.Create;//TGifImage.Create//TJpegImage.Create
bs.Position := 0;
try
// StartWait;
dbimgPortrait.Picture.Graphic.LoadFromStream(bs);
finally
// StopWait;
end
end
finally
bs.Free;
END;
END;
var
bs:TBlobStream;
begin
bs := TBlobStream.Create(
DBNav.DataSource.DataSet.FieldByName('Photo') as TBlobField, bmRead); //<--森揭拸楊籵徹
try
if bs.Size > 0 then
begin
if assigned(dbimgPortrait.Picture.Graphic) then
dbimgPortrait.Picture.Graphic.Free;
dbimgPortrait.Picture.Graphic := TBitMap.Create;//TGifImage.Create//TJpegImage.Create
bs.Position := 0;
try
// StartWait;
dbimgPortrait.Picture.Graphic.LoadFromStream(bs);
finally
// StopWait;
end
end
finally
bs.Free;
END;
END;