473,746 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem displaying image from database..

Hi Guys,

I am having problems displaying an image from the database, that alreday has
been uoploaded successfully.

The image loads in correctly, but by default it is displayed on the whole
page. I want it to bde displayed on some part of the page. I was able to do
that if I used img.ImageUrl, for images stored on my hard drive, but I want
to view it from anywhere my site is sccessed, hence I decided to get it
loaded directly from database.

How can I load the image on a section of the page e.g. in a div, rather than
on the whole page

<DIV style="OVERFLOW : scroll; WIDTH: 872px; HEIGHT: 299px"><img id="imgPage"
runat="server"> </DIV>

Please help...

Thanks,

I..A
Nov 19 '05 #1
3 1353
The standard solution is to a have a special web page, called, for example,
GetImage.aspx. Your image url will point to the page:

ImageUrl="GetIm age.aspx?id=myI mageId"

The page will find the image in the database according to id and stream it
down to the client in the response stream.

Eliyahu

"Irfan Akram" <Ir********@dis cussions.micros oft.com> wrote in message
news:96******** *************** ***********@mic rosoft.com...
Hi Guys,

I am having problems displaying an image from the database, that alreday has been uoploaded successfully.

The image loads in correctly, but by default it is displayed on the whole
page. I want it to bde displayed on some part of the page. I was able to do that if I used img.ImageUrl, for images stored on my hard drive, but I want to view it from anywhere my site is sccessed, hence I decided to get it
loaded directly from database.

How can I load the image on a section of the page e.g. in a div, rather than on the whole page

<DIV style="OVERFLOW : scroll; WIDTH: 872px; HEIGHT: 299px"><img id="imgPage" runat="server"> </DIV>

Please help...

Thanks,

I..A

Nov 19 '05 #2
Search the MSDN for their DynamicImage control. It can render images based
on URL, file or a byte[] array.

"Irfan Akram" <Ir********@dis cussions.micros oft.com> wrote in message
news:96******** *************** ***********@mic rosoft.com...
Hi Guys,

I am having problems displaying an image from the database, that alreday
has
been uoploaded successfully.

The image loads in correctly, but by default it is displayed on the whole
page. I want it to bde displayed on some part of the page. I was able to
do
that if I used img.ImageUrl, for images stored on my hard drive, but I
want
to view it from anywhere my site is sccessed, hence I decided to get it
loaded directly from database.

How can I load the image on a section of the page e.g. in a div, rather
than
on the whole page

<DIV style="OVERFLOW : scroll; WIDTH: 872px; HEIGHT: 299px"><img
id="imgPage"
runat="server"> </DIV>

Please help...

Thanks,

I..A

Nov 19 '05 #3
You need a separate page to display the image.
Here's an example:
http://SteveOrr.net/articles/ImproveYourImages.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Irfan Akram" <Ir********@dis cussions.micros oft.com> wrote in message
news:96******** *************** ***********@mic rosoft.com...
Hi Guys,

I am having problems displaying an image from the database, that alreday
has
been uoploaded successfully.

The image loads in correctly, but by default it is displayed on the whole
page. I want it to bde displayed on some part of the page. I was able to
do
that if I used img.ImageUrl, for images stored on my hard drive, but I
want
to view it from anywhere my site is sccessed, hence I decided to get it
loaded directly from database.

How can I load the image on a section of the page e.g. in a div, rather
than
on the whole page

<DIV style="OVERFLOW : scroll; WIDTH: 872px; HEIGHT: 299px"><img
id="imgPage"
runat="server"> </DIV>

Please help...

Thanks,

I..A

Nov 19 '05 #4

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

Similar topics

6
2388
by: GazK | last post by:
I have an image viewing page which resizes an image to a sensible sizebefore displaying. The user should then be able to choose "25% larger" or smaller and the resized image display. The problem I am getting with the code below is that whatever the POST variable value (and I have tested the value changes correctly), the line marked with *** executes, ie the image gets smaller. Am I missing some obvious subtlety with IF statements? Also,...
1
1427
by: Rob Parker | last post by:
I posted this (with a different subjetc line) in the ms.public.access.forms newsgroup a few days ago, but haven't had a single response there. I'm hoping maybe someone here can help. Using Access 2002: I have downloaded a tutorial database, which has a form containing a bound object frame to display a picture. The picture field in the underlying table has an OLE Object datatype, and when a picture is inserted (either directly into the...
1
1764
by: Rob Parker | last post by:
I posted this with a different subject line (in two posts - I added additional info in the second) in this newsgroup a few days ago, but haven't had a single response. Hopefully, that was because I posted at the weekend, and the experts were all having a well-earned rest and missed it first time around. I'm hoping someone here can help - I've had no joy in other avenues. Now to the problem: Using Access 2002: I have downloaded a...
2
2586
by: Jeronimo Bertran | last post by:
Hello, I am using a rendering aspx page to display a database image on an Image control. When the database record is retrieved, I am saving the bitmap to a session variable for the rendering aspx to load. Here is the code on the rendering page: CODE FOR ImageForm.aspx private void Page_Load(object sender, System.EventArgs e)
4
2182
by: comp.lang.php | last post by:
'll try to explain this as clearly as possible, sorry if it's unclear. You have in your directory /foo 42 images You have in your database metadata for 30 out of those 42 images You have to display all 42 images in the /foo directory whether they have database metadata or not. If any of the 42 images have metadata, you must display the metadata,
2
1622
by: keerthisreenu | last post by:
hai to all...!! iam working with Ms Access 2000. iam saving an image in the database. After that i want to retrive the same image from database and displaying it in the picture box. but its not working. why it is happening? please help me. iam sending the code. when button1 clicks it store in database. when button2 clicks it should display in picturebox.
14
2116
by: ashraf02 | last post by:
i used a code from a website that allows you to display images. however everything works fine from storing the image to the database but it does not display the image. the following code is the one i have used. Storing the images: <HTML> <HEAD><TITLE>Store binary data into SQL Database</TITLE></HEAD> <BODY>
4
1687
by: shahidrasul | last post by:
i display a pic on picture box and then i want to display another pic after some seconds but problem is that first image is not displaying only display 2nd image 1... display first picture from database such as pbThumbImage.Image = new Bitmap(new MemoryStream(objEmployee.Picture)); 2... and then get the reference of current main thread Thread main = Thread.CurrentThread; Thread.Sleep(5000);
6
1993
by: vikidigi | last post by:
PLz Help i have some Images in DataBase in Blob field but images are displayed with a Cross (X) not the actual image MainPage.php//code # <?php # $con = mysql_connect("localhost","root",""); # if (!$con)
0
8974
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
8800
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
9508
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
9350
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...
0
9218
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...
1
6772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6060
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();...
1
3292
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
2
2765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.