Size of an Iframe displaying image

M

maciu

Hello all,
I have following scenario:
I have a WebPage "main.aspx", which is responsible for displaying
multiple user data, also an avatar of user.
All images are stored in MS SQL SERVER 2005 database, in a column of
type "image" ( which implies, that images aren't located anywhere on
server as logical files).
I've googled around, and found that probably only way to display such
image is to dynamically add an Iframe element, which displays page,
which code-behind is following (for the PageLoad event)


/// ID of image to display
string valueID = Request.QueryString["valueID"];

/// Get Data from DataBase
Trees tree = new Trees((Users)Session["User"]);
byte[] data = tree.GetImage(valueID);
Response.Clear();

if (data != null)
{
/// Write binaries of image directly to the page
Response.ContentType = "image/gif";
Response.BinaryWrite(data);
}
else
{
Response.Write("No image!");
}
Response.End();



And it works just fine, although I have fixed size of an Iframe in my
styleSheet file.
It causes, that images larger than this size are too large for Iframe,
and srollbars start to appear and that looks really ugly =/.

So my question is:
Is there a way to resize Iframe AFTER placing it on a page?. Or is
there a way to compute height and width of image having only binaries
of that image?

Oh - one last thing, I am using Internet Explorer (firefox
automatically scales images, so there is no problem there)

Thank you all in advance, for replying to my post,
maciu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top