把pdf以及图像存入数据库,然后根据需要显示出来。
在处理的过程中,不同类型的图像格式有其不同的类,如果这个概念不清楚,就会绕一个很大的圈子。

  MyJPEG : TJPEGImage ;
  mypng : TPngImage;
              img1.Properties.GraphicClassName :=  'TJPEGImage';
              MyStream := Tmemorystream.Create;
              MyStream.Clear;
              MyJPEG := TJPEGImage.Create;
              TBlobField(cds_editProject.fieldbyname('PM_IMAGE')).SaveToStream(MyStream);
              MyStream.Position :=0;
              MyJPEG.LoadFromStream(MyStream);
              img1.Picture.Assign(MyJPEG);
              gtpdfvwr1.Active := False;
              gtpdfvwr1.Visible := False;
              img1.Visible := True;
              MyStream.Free;
              MyJPEG.Free;

不同的图像因格式不同,需要相应的处理转换,否则就会格式报错。如ejpeg error #53
这是因为格式不对,解码出错。

真是晕透了。书到用时方恨少。折腾很多时间,反而欲速而不达。

相关文章:

  • 2021-10-11
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2021-06-05
  • 2022-12-23
猜你喜欢
  • 2021-06-14
  • 2021-05-31
  • 2022-12-23
  • 2021-09-07
  • 2021-11-29
  • 2021-10-13
  • 2021-08-13
相关资源
相似解决方案