在页面上显示位图图像 [英] Display Bitmap image on a page

查看:70
本文介绍了在页面上显示位图图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个从后端值中提取的Bitmap图像。

我创建了一个用户控件来获取位图图像。但是当我将用户控件放在我的Aspx页面中时,所有其他控件都消失了。只有Bitmap图像显示出来。如何管理这个问题???我想通过Aspx页面将绘制图像的标志传递到后端,所以控件应该在那里(可见)....



在此先感谢.. ..

Hi there,

I've a Bitmap image which is drawn from the Back end values.
I've created a User control to get the bitmap image.But when I place the user control inside my Aspx page, all other controls get vanished.Only the Bitmap image get displayed.How can I manage this issue??? I want to pass the flags for drawing image to back end via Aspx page, So the controls should be there (Visible)....

Thanks in advance....

推荐答案

在页面上放置 PlaceHolder 控件,并将图像放入其中。除非你需要某种特殊的处理,否则 UserControl 是不合适的。
Put PlaceHolder control on your page, and put the image in that. Unless you need some sort of special profcessing, a UserControl isn't appropriate.


有一次,我编写代码来绘制验证码图像,这就是我在页面上得到它的方式:



Once, I wrote code to draw a captcha image, and this is how I got it on the page:

int imgHeight = 60;
int imgWidth = 160;
Bitmap objBMP = new System.Drawing.Bitmap(imgWidth, imgHeight);
Graphics objGraphics = System.Drawing.Graphics.FromImage(objBMP);

// Set the content type and return the image
Response.ContentType = "image/GIF";
objBMP.Save(Response.OutputStream, ImageFormat.Gif);
objFont.Dispose();
objGraphics.Dispose();
objBMP.Dispose();


这篇关于在页面上显示位图图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆