有一个图片通过base64编码后,如何将其复原在image中显示
我是用的
IdDecoderMIME1.DecodeToStream(str,fs);
fs.Position:=0;
image1.Picture.Bitmap.LoadFromStream(fs);
运行后报错显示Bitmap image is not valid
[解决办法]
原图是jpg的话,在该代码单元的uses里加上jpeg
[解决办法]
如果原图是JPG 那需要转一下
j:TJPEGImage;
j:=TJPEGImage.Create;
j.LoadFromStream(fs);
Image1.Picture.Assign(j);
j.Free;