1

简单问题:如何在winforms pictureBox 中显示检索到的ravendb 附件图像。

附件检索为

Raven.Abstractions.Data.Attachment attachment =
                        _store.DatabaseCommands.GetAttachment("upload/"+ 9999);

更新

像这样用放置附件保存图像

 _Store.DatabaseCommands.PutAttachment("upload/" + attachId, null, ms,
                                            new RavenJObject
                                                {
                                                   { "Content-Type", "image/jpeg" }

                                                });

ms 是内存流

4

1 回答 1

2

您需要从Attachment对象中检索附件内存流:

pictureBox1.Image = Image.FromStream(attachment.Data());

在文档中查看更多信息

于 2013-11-12T22:23:09.567 回答