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

Not doing image sizing correctly

I have 2 labels that hold the name of different images.

<asp:Label ID="Logo" runat="server"/>
<asp:Label ID="CompanyPicture" runat="server"/>&nbsp;&nbsp;&nbsp;&nbsp;

I have 2 links that open the windows to preview these images. The previewed
images are done on separate html pages that do nothing but display the
image.

function OpenLogoPreviewWindow()
{
window.open('logoDisplay.htm','myWindow','menubar= no,toolbar=no,directories=no,resizable=no,scrollba rs=no,location=no,status=no');}function OpenPicturePreviewWindow(){ window.open('CompanyPictureDisplay.htm','myWindow' ,'menubar=no,toolbar=no,directories=no,resizable=n o,scrollbars=no,location=no,status=no');}This works most of the time. But the first time you do it, it has the wrongdimensions. For example, for the CompanyPicture - the size is 502 by 400.The very first time a machine loads this picture, it will be incorrect. Itwill be something like 38 by 87. From that point on it will be correct.Even if I change the picture - it will size it correctly. It will also workif I reboot the machine. To test it I need to go to another machine thathas never run it.The code for each page is:logoDisplay.htm******************************** ******************************************function entry(){//alert("In LogoDisplay"); document.LogoDisplay.src = "..\\..\\uploads\\" +opener.document.getElementById('Logo').innerHTML; id = document.getElementById("LogoDisplay"); w = id.width+10; h = id.height+50;// alert ("w = " + w + " h = " + h); window.resizeTo(w,h); if (screen) { x = (screen.availHeight - h)/2; y = (screen.availWidth - w)/2; } window.moveTo(y,x); window.focus();}</script></head><body onLoad="entry()"><img name="LogoDisplay"></body></html>********************************************* ***************************For ComapnyPictureDisplay.htm************************* **********************************************func tion entry(){ document.PictureDisplay.src = "..\\..\\uploads\\" +opener.document.getElementById('CompanyPicture'). innerHTML; id = document.getElementById("PictureDisplay"); w = id.width+10; h = id.height+50;// alert ("w = " + w + " h = " + h); window.resizeTo(w,h); if (screen) { x = (screen.availHeight - h)/2; y = (screen.availWidth - w)/2; } window.moveTo(y,x); window.focus();}</script></head><body onLoad="entry()"><img name="PictureDisplay"></body></html>********************************************* *******************************

Feb 12 '07 #1
0 929

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

Similar topics

3
by: coolsti | last post by:
I need some help here. I am making an application which allows a user to look at a series of picture files one at a time, and enter the outcome of various visual tests to a database. The...
5
by: BWIN | last post by:
I am the owner of a very large scale member-base website and the members are having trouble re-sizing there pics to create headshots. The headshots are supposed to be 175 x 175 pixels exactly. We...
1
by: Tim Burda | last post by:
I am having some problems with getting an .gif file to display properly on an ASPX page. The image appears grainy and distorted. I have tried implementing the image (stored in several formats)...
1
by: Stephen | last post by:
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:...
13
by: Neo Geshel | last post by:
I have examined about 80+ different upload scripts on the 'net, both in VB and C#, and none seem to do what I need them to do. Perhaps someone here can point me somewhere that Google hasn't...
0
by: sekhar_ps | last post by:
what artifacts arises in image down sizing using mpeg-2 standard
6
by: RoseW | last post by:
This is a collection of images with its own style sheet to create the hover over the thumbnail and the larger image appears. http://www4.webng.com/chesleyhs/images/planting/Planting.html Narrow...
6
by: Stephan Bourdon | last post by:
Hi, Your opinion please on the following subject: Is it acceptable to set the width and height of an image in ems or percents in CSS? The advantage for me is that images will scale up or down...
2
by: =?Utf-8?B?SmVmZlAtPg==?= | last post by:
I want to retrieve an image file (TIF) convert it to a bmp file and enable sizing. I know how to do the converting & sizing part, and store any atributes to file location in the webconfig, what...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.