在普通浏览器上显示位图图像 [英] To show bitmap image on normal browser

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

问题描述

大家好,
在我的asp.net应用程序中,我在.aspx页上的

标记中,该
标记具有一个< img>.标签如下:

Hello all,
In my asp.net application I am having in

tag on .aspx page in that
tag am having one <img> tag as follows:

<table><tbody><tr><td align="right" style="Width:50px;Height:50px;">
<img  src="Guge.aspx" style="padding-right:0px;"/>
</td></tr></tbody></table>



因此,我在其中绘制了位图图像的"Guge.aspx".我像
一样开发了该量规 从头开始.下面的代码行用于将映像存储在本地驱动器上
或Web应用的根目录:



So am having "Guge.aspx" in which i draw the bitmap image.I develop that guge like
thing from scratch.Following line of code i use to store that image on local drive
or root directory of web apllication:

oBitmap.Save(Response.OutputStream, ImageFormat.Jpeg)
oBitmap.Save("D:\Yogesh Experiment\proSES_Solution_28_Jan_2011\image\Sparkline\G1.Jpeg")
oGraphics.Dispose()
oBitmap.Dispose()



但是现在我遇到了一个问题,例如是否通过.Net开发环境(即通过Visual Studio .NET Framework 3.5运行应用程序)运行所有内容
根据我的说法,即图像存储在我给定的路径中,并显示在解决方案中.

但是,当我创建Webset-up并将其安装在客户端计算机上,并且使用任何浏览器运行网站时,所有事情都运行良好,唯一的问题是未显示仪表的位图图像,而是显示了红色十字标记" ,即该

标签中的部分以及图像未存储在以下路径中,即i
在根目录中为客户端计算机设置如下:



But now i came across one problem like if run the application through .Net development enviroment i.e. through visual studio .NET framework 3.5 all things run
according to me, i.e image are got stored in the path which i had given and it displays in solution.

But when i create webset-up and installed it on client machine,and i run the website with any browser all things are working good the only problem is that bitmap image for guge is not get displayed instead of that i got "red colored cross mark" i.e the part in that

tag and also image is not get stored in following path which i
set for client computer in the root directory as follows:

oBitmap.Save(Response.OutputStream, ImageFormat.Jpeg)
oBitmap.Save("C:\Inetpub\wwwroot\proSES\image\Sparkline\G1.Jpeg")
oGraphics.Dispose()
oBitmap.Dispose()




我尝试了几乎所有可以尝试的替代方法...

有人可以帮助我解决这个问题或帮助我解决哪个错误吗?
在此先感谢

Yogesh

:-)




I tried almost every alternative which i can try......

can somebody help me tackle that or help me to which error is there????

Thanks in advance

Yogesh

:-)

推荐答案

对于初学者来说,使用硬编码的路径是个坏主意.服务器上的此路径正确吗?为什么每次都将文件保存到相同位置?有什么可能的用途来继续覆盖此文件?我怀疑您的代码炸毁了b/c,它无法访问此路径.删除此(无用的)行,看看会发生什么.
For starters, having a hard coded path is a bad idea. Is this path correct on the server ? Why would you save a file to the same location every time it''s requested ? What possible use is there to keep overwriting this file ? I suspect your code blows up b/c it does not have access to this path. Remove this (useless) line and see what happens.


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

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