473,597 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Image after reading Streamed Data

Hi,

I am using an Access database (OLE Object) and storing Image as a bytes
after streaming. I am able to read it back as a stream and display it on the
browser using the following code:
Response.Output Stream.Write(fi leData, 0, fileData.Length )

it displays on the browser as an image, but I want to display it in an Image
(web control image) so that I can manipulate its size.
How can I do this?

Please advice,
Stephen.
Nov 18 '05 #1
1 1441
My guess is that you are passing the imageID as a querystring parameter thats
how you would know what image to pull from your database. So, if this is the
case you can do this
<asp:image runat="server" id="myimage" ImageUrl="[filename].aspx?id=1" />

where filename = the aspx page that you are streaming the image file to
using the Response.output .stream. This worked for me. To play around with
the sizing you have to look at the image Thumbnail class from the
system.drawing. imaging (I think this is the namespace) and modify the image
width and height like that. What I did was to also include the width and
height as a querystring parameter so my sorce code looked something like this:
<asp:image runat="server" id="myimage"
ImageUrl="[filename].aspx?id=1&widt h=200&height=20 0" />

I suggest you create a single aspx page that handles all of the image
processing and resizing and streaming out to the browser. This single page
will be the [filename].aspx that you are setting the ImageUrl to point to.

Hope this helps.
"Stephen" wrote:
Hi,

I am using an Access database (OLE Object) and storing Image as a bytes
after streaming. I am able to read it back as a stream and display it on the
browser using the following code:
Response.Output Stream.Write(fi leData, 0, fileData.Length )

it displays on the browser as an image, but I want to display it in an Image
(web control image) so that I can manipulate its size.
How can I do this?

Please advice,
Stephen.

Nov 18 '05 #2

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

Similar topics

13
3720
by: PS | last post by:
I want to display the image from database to picture box through ado.net and vb.net I have some images present in a sql server 2000 table stored under 'image' datatype. I want to extract and display them in a picture box present in a vb.net form I appreciate any help on this Thanks PS
5
3219
by: Magnus | last post by:
Hi, I'm programatically posting an image using multipart/form-data. It sends to the server OK, but when I try to view it in the browser, it is still in the base64 string I sent it as: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUG etc.... I've been through the form I built over and over: string PostData = ""; PostData += "-----------------------------7d41fb3081216"; PostData += "\r"; PostData += "\n";
0
1092
by: Bill | last post by:
I a C# developer getting involved in an image processing application. I am receiving a stream of bytes from a SQL Server database that contains image data. The data can be streamed in one of the following three options: -band interleaved by pixel -band interleaved by line -band sequential Using GDI+ in .NET is there any way to convert between any
2
5222
by: marvin | last post by:
Hi, I am trying to display images in a repeater from a SQL database and do some transformations on the image prior to displaying them (such as thumbnail with a shadow). The problem is I can't seem to get the data passed to the handler. The following is the code that I have so far. In the ViewPics.aspx file I have...
3
5860
by: T. Davis | last post by:
In C#, I am able to successfully stream a TIFF image that comes from a BLOB field in a database, save it to file, then convert the pages within TIFF file into jpegs (using GDI+) and display on the web (using ASP.NET). However, when I generate the Image object using FromStream (passing in the MemoryStream containing image bytes), an exception of "A generic error occurred in GDI+" is thrown when performing the conversion/save for display....
4
1951
by: Marc Pelletier | last post by:
Hello, I have a class (TideClass) which creates a bitmap image as one of its functions. I want to create a page which has this image embedded amongst some text. I know that I have to stream the image back from a separate aspx page. I have therefore created a page Day1.aspx which gets the instance of tide from the context handler, calls the DrawChart function and streams it back.
13
2182
by: gooze | last post by:
Hello I am working on an applicaion that shows several pictures on a webpage. These pictures are saved in a MySQL DB as BLOB. I noticed, that the web server suffers in its performance by printing the pictures. Let's say there are 20 pictures to show, there also are 20 queries to do. This is the way I am doing it up to now: index.php <?php
3
2353
by: CLEAR-RCIC | last post by:
I have several images i want to display in an ASP.Net application. The images are being passed to me in binary format from another application. Is there a good way to write them directly to an HMTL page without having to save them to the server and create a URL to the virtual directory? FYI: I currently am doing this with just single images. I do a Response.BinaryWrite(byte) to display the one image. The advantage is that I never...
3
689
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
Note: My apologies for repeating this post from last week, but my nospam alias and profile account were incorrect. I think I have fixed this, so hopefully this post will trigger MS into a response per their MSDN policy. -------------------- I have a web site under .NET 2.0 that renders videos using the Silverlight media player. The web page looks like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="video2.aspx.cs"
0
7884
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8380
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
8024
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
6681
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
5423
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
3921
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2394
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1229
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.