Delphi 已保存的Sqlite图像在上载的服务器数据库上显示为全黑色

Delphi 已保存的Sqlite图像在上载的服务器数据库上显示为全黑色,delphi,sqlite,firemonkey,Delphi,Sqlite,Firemonkey,我有一个有趣的问题。我必须拍摄保存在Sqlite3数据库中的签名图像 在Sqlite3数据库上查看保存的签名时,它是一个签名。数据库将上载到具有MSSQL server的服务器,然后MSSQL server将读取签名图像。不幸的是,此图像在服务器上显示为完全黑色,并且返回的图像是相同的。数据库管理员说数据似乎是垃圾,包括unicode字符 Example of the image data is: Sent Data: Tried to include but unfortunately it

我有一个有趣的问题。我必须拍摄保存在Sqlite3数据库中的签名图像

在Sqlite3数据库上查看保存的签名时,它是一个签名。数据库将上载到具有MSSQL server的服务器,然后MSSQL server将读取签名图像。不幸的是,此图像在服务器上显示为完全黑色,并且返回的图像是相同的。数据库管理员说数据似乎是垃圾,包括unicode字符

Example of the image data is:
Sent Data:  Tried to include but unfortunately it will not show unicode.  It is thousands of bytes long.
Returned Data:  *System.Byte[]*   <<and that is it - 26 bytes long.

您试图在MS Sql Server上保存映像的列的数据类型是什么?请把这个加到你的q里。我这样问是因为DBA能看到它似乎很奇怪。MSQSQL它被保存为图像。SQLITE它是一个斑点。我还发现,当试图将其发送到Crystal Reports时,它是一个黑色图像。我之前查询您的数据集类型的评论是基于这样一个事实,即TSqlQery过去没有CommandText属性,而我忽略了一个事实,即它后来被添加了,对不起。如果您还没有,我建议您暂时将DBGrid、DBNavigator和TDBImage组件添加到表单中我会使用VCL表单,并检查您是否可以成功地将Bmp文件加载到Sql Server表的Sig列中,然后将其保存到磁盘,然后看看Explorer是否正确显示。问题是Sqlite将图像保存为unicode png。因此,您的代码没有将图像保存到Sqlite数据库中,对吗?如果是这样的话,我无法立即看到我们能提供什么帮助,除非您能以某种方式(例如通过pastebin)提供一个示例数据库(其中只有一行或两行)。有可能吗?
function SaveSig: boolean;
var
  fStream: TMemoryStream;
begin
  Result := False;
  fStream := TMemoryStream.Create;
  try
    try
      fStream.Seek(0, soFromBeginning);
      fStream.Position := 0;
      if Assigned(imgSig) then
      begin
        imgSig.Bitmap.SaveToStream(fStream);
        Result := SqlInsertSig(fStream);
      end;
    except
      on e: Exception do
        ShowMessage(ERROR_BITMAP + e.Message);
    end;
  finally
    if Assigned(fStream) then
      FreeAndNil(fStream);
  end;
end;

function SqlInsertSig(const ms: TMemoryStream): boolean;
begin
  Result := False;
  try
    try
      sq.Active := False;
      sq.CommandText := 'Insert Into Signatures (Id, Sig) Values (' +
        QuotedStr(IntToStr(Id)) + ', :sig)';
      sq.Params.ParamByName('sig').LoadFromStream(ms, ftBlob);
      Result := (sq.ExecSQL > 0);
    except
      on e: Exception do
        MessageDlg(e.Message, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0);
    end;
  finally
    sq.Active := False;
  end;
end;