@paweld, thank you for the idea!
Though I didn't succeeded with it yet:
1. I replaced TPicture with TBitmap, because DBGridUsers.Canvas.Draw expects TGraphic, not TPicture:
procedure TMainForm.DBGridUsersDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
bmp: TBitmap;
foto : TMemoryStream;
begin
if Column.FieldName='avatar' then
begin
foto:=TMemoryStream.Create;
bmp:=TBitmap.Create;
try
foto.CopyFrom(SQLQuery.CreateBlobStream(SQLQuery.FieldByName('avatar'), bmRead), 0);
bmp.LoadFromStream(foto);
DBGridUsers.Canvas.Draw(Rect.left, Rect.Top, bmp);
finally
bmp.Free;
foto.Free;
end;
end;
end;
2. This function call raises exception class 'External: SIGSEGV':
foto.CopyFrom(SQLQuery.CreateBlobStream(SQLQuery.FieldByName('avatar'), bmRead), 0);
What may be the reason for that?