HighDots Forums  

Resizing Windows

alt.html alt.html


Discuss Resizing Windows in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
K
 
Posts: n/a

Default Resizing Windows - 02-05-2005 , 08:44 PM






I am trying to achieve the following - can anyone help?

Before you jump on me for wanting to interfere with the user's windows -
it's' for a corporate intranet where we can and will dictate what they see
and how they see it.

I have a popup which displays an image (not that it matters much I guess,
but entire site is in ASP).

I want the window to resize itself on opening to 'hug' the image. However,
some images will be bigger than the screen, so I want a maximum which it
will resize to if the image is bigger than the specified maximum.

Also, to confuse matters - some users have varying screen-resolutions, so an
added bonus would be to detect the users screen size and set the maximum
resize value according to this.

Any suggestions?

Thanks in advance



Reply With Quote
  #2  
Old   
Karl Core
 
Posts: n/a

Default Re: Resizing Windows - 02-05-2005 , 09:28 PM







"K" <@.> wrote

Quote:
I am trying to achieve the following - can anyone help?

Before you jump on me for wanting to interfere with the user's windows -
it's' for a corporate intranet where we can and will dictate what they see
and how they see it.

I have a popup which displays an image (not that it matters much I guess,
but entire site is in ASP).

I want the window to resize itself on opening to 'hug' the image.
However,
some images will be bigger than the screen, so I want a maximum which it
will resize to if the image is bigger than the specified maximum.

Also, to confuse matters - some users have varying screen-resolutions, so
an
added bonus would be to detect the users screen size and set the maximum
resize value according to this.

I'm totally ignorant of ASP, but I imagine there's some sort of equivalent
of the PHP example I'm gonna use.

// Begin Code
$image="/path/to/image.gif";
$max_width = "xxx"; // this is the max width of the window
$max_height = "xxx"; //this is the max height of the window
$size = getimagesize("$image"); //get the actual size of the picture in an
array
$width = $size[0]; // get width of picture
$height = $size[1]; // get height of picture
if ($width>$max_width){
$pop_width=$max_width; // Resize if over max width
}else {
$pop_width=$width; // Keep original size from array because
smaller than max

}
if ($height>$max_height){
$pop_height=$max_height; // Resize if over max width
}else {
$pop_height=$height; // Keep original size from array
because smaller than max

}

//print the popup link
print("<a href=\"$image\" onclick=\"window.open('$image', 'popup_name_here',
'toolbar=no, location=no, status=no, menubar=no, scrollbars=no,
resizable=yes, width=$pop_width, height=$pop_height'); return false\">View
Full Size</a>");

// End Code

Due to browser differences, you may actually want to open the window to be
as many as 20 pixels wider than the image. Or, if you want an actual HTML
popup, you can do that too, and just pass the variables in the query string


--
Karl Core
Hell To Pay, Baltimore Hardcore: http://www.eightninethree.com




Reply With Quote
  #3  
Old   
K
 
Posts: n/a

Default Re: Resizing Windows - 02-06-2005 , 09:16 AM



Thank you

However, is this possible ith javascript or client-side vbscript? I am not
familiar with PHP at all.

I would like to open the window which will contain an ASP page with the
image on. It has to be this way as there is other ASP code running when the
image opens.

Thanks



Reply With Quote
  #4  
Old   
Karl Core
 
Posts: n/a

Default Re: Resizing Windows - 02-06-2005 , 10:41 AM




"K" <@.> wrote

Quote:
Thank you

However, is this possible ith javascript or client-side vbscript? I am
not
familiar with PHP at all.

I would like to open the window which will contain an ASP page with the
image on. It has to be this way as there is other ASP code running when
the
image opens.
First, please quote when you reply on usenet. This will help others, who
stumble across this thread somewhere in the middle, understand that which
you and I are discussing.

I used PHP code only as an example. There *has* to be some sort of
equivalent capability within ASP.
I'm not sure if javascript or VBScript can do what I've shown. I don't know
those languages very well. Basically, what you have to do is detect the
size of the image and then dynamically resize the window to fit the image.

Just because you have other ASP code running, that doesn't mean you can't do
all this, too.


--
Karl Core
Hell To Pay, Baltimore Hardcore: http://www.eightninethree.com




Reply With Quote
  #5  
Old   
Mark Parnell
 
Posts: n/a

Default Re: Resizing Windows - 02-06-2005 , 07:39 PM



Previously in alt.html, Karl Core <karl (AT) NOSPAMkarlcore (DOT) com> said:

Quote:
I'm totally ignorant of ASP, but I imagine there's some sort of equivalent
of the PHP example I'm gonna use.
<snip>
Quote:
$size = getimagesize("$image"); //get the actual size of the picture in an
array
This is the only bit that I can see which doesn't have an ASP equivalent
- ASP doesn't have a built in function for getting the dimensions of an
image. There are a couple of add-on components that can do it though.

ASPImage
http://www.serverobjects.com/products.htm#aspimage

ImageSize
http://www.serverobjects.com/products.htm#free

--
Mark Parnell
http://www.clarkecomputers.com.au


Reply With Quote
  #6  
Old   
K
 
Posts: n/a

Default Re: Resizing Windows - 02-07-2005 , 03:39 AM



"Mark Parnell" <webmaster (AT) clarkecomputers (DOT) com.au> wrote

Quote:
Previously in alt.html, Karl Core <karl (AT) NOSPAMkarlcore (DOT) com> said:

I'm totally ignorant of ASP, but I imagine there's some sort of
equivalent
of the PHP example I'm gonna use.

snip
$size = getimagesize("$image"); //get the actual size of the picture in
an
array

This is the only bit that I can see which doesn't have an ASP equivalent
- ASP doesn't have a built in function for getting the dimensions of an
image. There are a couple of add-on components that can do it though.

ASPImage
http://www.serverobjects.com/products.htm#aspimage

ImageSize
Thanks

I don't have control over the web server to install custom components
however :-(

I need to achieve this entirely with client-side scripting - be it VB or
Javascript.

I will give PHP a try if all else fails, but I don't know it at all so I
really want to avoid it.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.