本文介绍了需要在asp.net的图像控件中显示注释附件中的图像.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
ColumnSet cols1 = new ColumnSet();
cols1.Attributes = new string[] { "filename", "mimetype", "documentbody"};
annotation annotationAttachment = (annotation)myCRMService.Retrieve(EntityName.annotation.ToString(), annotationId, cols1);
String strfilecontent = annotationAttachment.documentbody.Replace(" ","+");
String strfilename = annotationAttachment.filename;
String strfiletype = annotationAttachment.mimetype
img1.Src = "Handler.ashx?id="+strfilecontent+"&filename="+strfilename+"&filetype="+strfiletype;
推荐答案
Bitmap objBmp = new Bitmap("[Valid File Path]");
MemoryStream ms = new MemoryStream();
objBmp.Save(ms, ImageFormat.Png);
byte[] bmpBytes = ms.GetBuffer();
context.Response.ContentType = "image/png";
context.Response.BinaryWrite(bmpBytes);
在您的Aspx页面中
In your Aspx Page
img1.ImageUrl = "~/Handler.ashx";
就这样...希望对您有帮助...
That''s It... Hope it is helpfull to you...
这篇关于需要在asp.net的图像控件中显示注释附件中的图像.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!