473,946 Members | 15,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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 2397
Vko
Use the HTTP header to define the content type.

The following sample returns a picture :

Response.Conten tType = "image/jpeg";

Bitmap bmp;

// Create your image here

MemoryStream memStream = new MemoryStream();
bmp.Save(memStr eam, ImageFormat.Jpe g);
memStream.Write To(Response.Out putStream);
"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*******@hotm ail.com> wrote in message
news:OJ******** ******@TK2MSFTN GP09.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:SomeAS PNet.../></td>
<td><img src="dynamicIma ge.aspx"></td>
</tr>
</table>

When the browser sees an <img tag it does a new request for the resource
(dynamicImage.a spx). If dynamicImage.as px 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....especi ally when it's your own lack of understanding which is the
bottleneck.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"pei_world" <pe*******@hotm ail.com> wrote in message
news:ue******** ******@tk2msftn gp13.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*******@hotm ail.com> wrote in message
news:OJ******** ******@TK2MSFTN GP09.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********@hotm ail.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
1957
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 the same place into the application root (server machine) like c:\inetpub\wwwroot\OrchidDB\Orchid_Image. I am using repeter control for show images. I already use server.Mappath but still when I run my application in client machine it still look...
5
2526
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 find a way to do this in .NET. I have tried the DrawImageUnscaled and thought that was the way to go, but I was wrong. If anyone has any suggestions, please help! The code I have currently follows: Public Sub mTreeViewLoad(ByVal m_xmld As...
2
2830
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, rotates banners with hyperlink specific to each image. it works just perfect but i need a simple modification. now I want to stop rotating the images when I mouseover on the image, and then continue once I move the cursor out of the banner image....
3
6494
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 the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. I'm reading the data using the blocking read call of the network stream class. The .NET...
13
1830
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 backgound image which will have variable text written in front of it. I am having trouble geting labels and text boxes to print, along with the inlarged image that is printing. The labels and text boxes need to appear infront of the image. And where do I...
1
1982
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 columns and 4 rows: P2 # Comment lines # They follow the P2 line. # There could be 0, 1 or more 10 4 255
77
3958
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
1706
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; please do check that link) and please do respond... I know there are quite a number of members of progav in here... This is one query I need resolved asap... So, please
1
3005
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 doesn't exist. i.e. <DOC> <title>Book title</title> <p>This is a paragrap</p> <header>Header</header>
0
10150
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11552
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11141
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10679
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7403
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3525
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.