473,795 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="CompanyPict ure" runat="server"/>&nbsp;&nbsp;&n bsp;&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 OpenLogoPreview Window()
{
window.open('lo goDisplay.htm', 'myWindow','men ubar=no,toolbar =no,directories =no,resizable=n o,scrollbars=no ,location=no,st atus=no');}func tion OpenPicturePrev iewWindow(){ window.open('Co mpanyPictureDis play.htm','myWi ndow','menubar= no,toolbar=no,d irectories=no,r esizable=no,scr ollbars=no,loca tion=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.LogoDi splay.src = "..\\..\\upload s\\" +opener.documen t.getElementByI d('Logo').inner HTML; id = document.getEle mentById("LogoD isplay"); w = id.width+10; h = id.height+50;// alert ("w = " + w + " h = " + h); window.resizeTo (w,h); if (screen) { x = (screen.availHe ight - h)/2; y = (screen.availWi dth - w)/2; } window.moveTo(y ,x); window.focus(); }</script></head><body onLoad="entry() "><img name="LogoDispl ay"></body></html>********** *************** *************** *************** *************** **For ComapnyPictureD isplay.htm***** *************** *************** *************** *************** ******function entry(){ document.Pictur eDisplay.src = "..\\..\\upload s\\" +opener.documen t.getElementByI d('CompanyPictu re').innerHTML; id = document.getEle mentById("Pictu reDisplay"); w = id.width+10; h = id.height+50;// alert ("w = " + w + " h = " + h); window.resizeTo (w,h); if (screen) { x = (screen.availHe ight - h)/2; y = (screen.availWi dth - w)/2; } window.moveTo(y ,x); window.focus(); }</script></head><body onLoad="entry() "><img name="PictureDi splay"></body></html>********** *************** *************** *************** *************** ******

Feb 12 '07 #1
0 942

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

Similar topics

3
6750
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 application is based on mysql and php on a remote server, and is accessed by the user via a web browser, primarilly IE. The image file names are built up by the server side php scripts, and so a URL for the image file is created, but the file itself is...
5
1689
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 get alot of people trying to re-size their own images and unfortunatley they don't have photo skills and the images never get uploaded because they are usually off a few pixels when trying to upload the headshot. So the headshot's usually don't...
1
1238
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) using the img tag as pure HTML and adding the image to an ImageButton control. In both cases, I have supplied the appropriate width and height information for the .gif file. In neither case, does the image seem to appear correctly --- the output...
1
1448
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: Response.OutputStream.Write(fileData, 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?
13
2359
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 reached yet (I have gone all the way to page 50 on Google's results!!). Here are my requirements: • I have a DataGrid. Everything will be done from here. Everything. No exceptions. Everything will also be done in VB, without any code-behind to...
0
1072
by: sekhar_ps | last post by:
what artifacts arises in image down sizing using mpeg-2 standard
6
2147
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 images stay over to the right rather than being in the middle over even in the same spacing as the wider images. The two images at the bottom are the examples Is there a way of having some information in the stylesheet to accomodate if is a...
6
4807
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 when the user changes the font size in the browser. But what of the disadvantages? In (X)HTML, the img-element will have a pixel-value for the width and height-attributes.
2
1595
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 I don't know is how to get the image file. The only way that I've got it working was to Impersonate a user login at the other server.
0
9672
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
10438
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
10001
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
9042
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...
1
7540
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
6780
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
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
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.