473,386 Members | 1,720 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,386 software developers and data experts.

[urgent] how to output image in place

in asp or php, we can use inner output command to print out text or other
thing inside out web page.
I want to know how to do this in asp.net.
I know user control with placesholder can do, but if I want to generate a
image and output to client directly, then I cann't set the imageurl. I want
to know if there is anyway that I can display this image to user in some
place of my web page.

thanks
Nov 19 '05 #1
4 2374
Vko
Use the HTTP header to define the content type.

The following sample returns a picture :

Response.ContentType = "image/jpeg";

Bitmap bmp;

// Create your image here

MemoryStream memStream = new MemoryStream();
bmp.Save(memStream, ImageFormat.Jpeg);
memStream.WriteTo(Response.OutputStream);
"pei_world" wrote:
in asp or php, we can use inner output command to print out text or other
thing inside out web page.
I want to know how to do this in asp.net.
I know user control with placesholder can do, but if I want to generate a
image and output to client directly, then I cann't set the imageurl. I want
to know if there is anyway that I can display this image to user in some
place of my web page.

thanks

Nov 19 '05 #2
yes, I can display it. but I have a table with other content as well, I just
want this image to be display in one of the cell in that table, not only
display the image.

"pei_world" <pe*******@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
in asp or php, we can use inner output command to print out text or other
thing inside out web page.
I want to know how to do this in asp.net.
I know user control with placesholder can do, but if I want to generate a
image and output to client directly, then I cann't set the imageurl. I
want to know if there is anyway that I can display this image to user in
some place of my web page.

thanks

Nov 19 '05 #3
you can't do that...this isn't a limitation of ASP.Net, it's a limitation of
HTTP. Images must be served in a separate HTTP response - you can't package
normal html/text with binary data - it just don't work that way. What you
need to do is:

<table>
<tr>
<td>Some Text</td>
<td><asp:SomeASPNet.../></td>
<td><img src="dynamicImage.aspx"></td>
</tr>
</table>

When the browser sees an <img tag it does a new request for the resource
(dynamicImage.aspx). If dynamicImage.aspx returns binary data with the
right content-type (as was suggested, everything works).

Please refrain from posting the same question 3 times while at the same time
baiting people into helping you by saying if it can't be done than ASP.net
sucks....especially when it's your own lack of understanding which is the
bottleneck.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"pei_world" <pe*******@hotmail.com> wrote in message
news:ue**************@tk2msftngp13.phx.gbl...
yes, I can display it. but I have a table with other content as well, I just want this image to be display in one of the cell in that table, not only
display the image.

"pei_world" <pe*******@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
in asp or php, we can use inner output command to print out text or other thing inside out web page.
I want to know how to do this in asp.net.
I know user control with placesholder can do, but if I want to generate a image and output to client directly, then I cann't set the imageurl. I
want to know if there is anyway that I can display this image to user in
some place of my web page.

thanks


Nov 19 '05 #4
Actually, you can assign Server Control Image's ImageUrl
not only in degign time but also in run time.

Elton Wang
el********@hotmail.com
-----Original Message-----
in asp or php, we can use inner output command to print out text or otherthing inside out web page.
I want to know how to do this in asp.net.
I know user control with placesholder can do, but if I want to generate aimage and output to client directly, then I cann't set the imageurl. I wantto know if there is anyway that I can display this image to user in someplace of my web page.

thanks
.

Nov 19 '05 #5

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

Similar topics

1
by: Manish Songar via .NET 247 | last post by:
I am using asp.net. I am not storing image in sql server.I store all the image in one folder. I want to access image from that folder to my client machine. Images folder (\Orchid_Image) store in...
5
by: SeanT | last post by:
Greetings and salutations! I am having a real issue with the VB.NET TreeView control. I need to display an image (a.k.a. logo, picture, etc) from a file as the treenode object. I can not seem to...
2
by: sgMuser | last post by:
Hi, I am not a good developer of Javascript codes. Needs this help to make some modification to this famous free javascript from Anarchos. i am using this in one of my webpage. What it does is,...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
13
by: robert10 | last post by:
Hi, I have recently added some code to my form in regards to resizing an image on Print. I have an image that does print correctly after its been resized, howver i'm needing to use it as a...
1
by: raghavshastri | last post by:
You are to write a C++ program to perform a statistical analysis of the blobs in an image. The image will be a grayscale image in PGM format for simplicity. Here is a sample PGM image with 10...
77
by: Hans Schneider | last post by:
1. in the prg bellow what vars are stored on stack, heap, data segment? int i; void main() { int j; int *k = (void *)malloc(1); }
4
by: AK | last post by:
Hi everyone, Please check out this query that I have in : http://groups.google.com/group/progav/browse_thread/thread/29057ec587dd46b3 (its a bit long, thats why I am not typing it again;...
1
by: SM | last post by:
Hello, I have a couple of XML files that represent articles. Each XML file is unique. Meaning that overall the structure is the same but some tags in the xml file are not in the same place or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.