473,378 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

bitmap onto a webpage

I have a need to display a bitmap (chart) that has been created in code. In
the Windows I just place it in a picturebox. But no luck with a Web page
and I would like to be able to do it without writing the bmp to a file and
then putting it back into the web page.

Does anyone have an idea around this.

Bob Brand
Nov 17 '05 #1
3 1684
You can look into system.drawing.image
save(Response.OutputStream, ImageFormat.Jpeg) method. You might want a bmp
format, but this "writes" the image out to a memory stream instead of disk.

"Microsoft" <bo*@N-VisionSoftware.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
I have a need to display a bitmap (chart) that has been created in code. In the Windows I just place it in a picturebox. But no luck with a Web page
and I would like to be able to do it without writing the bmp to a file and
then putting it back into the web page.

Does anyone have an idea around this.

Bob Brand

Nov 17 '05 #2
You need to create an ASP.Net page to write the image to the browser. The
page can take a Bitmap object, and invoke the Save method to write the
Bitmap to the Response.OutputStream. The example below writes the image in
Jpeg Format. Note that you must set the Response.ContentType to the
appropriate MIME Type for the ImageFormat you use. This informs the browser
what MIME type it's getting, as the file extension (.aspx) won't help:

Response.ContentType = "image/jpg";
ImageObject.Save(Response.OutputStream, ImageFormat.Jpeg);

You can then reference your ASP.Net page in an Image tag in any page;

<img src="ShowImage.aspx">

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"Microsoft" <bo*@N-VisionSoftware.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
I have a need to display a bitmap (chart) that has been created in code. In the Windows I just place it in a picturebox. But no luck with a Web page
and I would like to be able to do it without writing the bmp to a file and
then putting it back into the web page.

Does anyone have an idea around this.

Bob Brand

Nov 17 '05 #3
Jos

Thanks you did the trick.

Bob Brand
"Jos" <jo***************@fastmail.fm> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
Microsoft wrote:
I have a need to display a bitmap (chart) that has been created in
code. In the Windows I just place it in a picturebox. But no luck
with a Web page and I would like to be able to do it without writing
the bmp to a file and then putting it back into the web page.

Does anyone have an idea around this.

Bob Brand


Creating graphics on the fly, look here:
http://www.15seconds.com/issue/020924.htm

--

Jos Branders

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Nathan Sokalski | last post by:
I am trying to write code to rotate a graphic that I have. Here is the code I am currently using: Dim frogbitmap As New Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif"))) Dim...
4
by: Andrew | last post by:
Hi, I'm trying to blit small bitmaps onto a larger bitmap, and I've got a few issues wrt positioning and output size. I think my problems are due to DPI differences... My small images are...
4
by: Elton | last post by:
Dear All, I am new to vb , please help. I have a picture , and a picture_click( ) function. What I want to do is to have a simulate a click event onto the picture in a loop. However, when I...
15
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
12
by: Lee | last post by:
I have the following code using System; using System.Windows.Forms; using System.Drawing; using System.Collections; namespace FINN {
14
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
0
by: =?Utf-8?B?Sm9uIEphY29icw==?= | last post by:
I load a bitmap from a file and display it in a PictureBox: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim Fn As String =...
20
by: Joe Duchtel | last post by:
Hello - I have the following code to get a bitmap from the clipboard and to save it to a *.png file ... Dim lData As IDataObject = Clipboard.GetDataObject() If...
5
Sl1ver
by: Sl1ver | last post by:
How to display the result set in a webpage: 1. retrieve data from the database 2. i take it, i create a loop that creates tables with data in it for every record my question is, how on a java...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.