Setting form width/height = image width/height 
Author Message
 Setting form width/height = image width/height
Any tricks for setting the size of the client area (i.e. the "inside" width
and height) to a known value such as the size of an image?

The Height and Width properties include the various window elements (title
bar, borders, etc.) so that complicates things.

Do I have to use the GetSystemMetrics API or something to add up all the
sizes of the various window parts?

There's gotta be an easier way--similar to MS Access' InsideHeight and
InsideWidth properties.

Joel Moore



Sun, 01 Sep 2002 03:00:00 GMT  
 Setting form width/height = image width/height
It is simple.  You just have to calculate the size of the borders by
subtracting the ScaleWidth and ScaleHeight properties from the Width and
Height properties.  Thus, your code would look something like:

  Me.Move Me.Left, Me.Top, Image1.Width + _
    (Me.Width - Me.ScaleWidth), Image1.Height + _
    (Me.Height - Me.ScaleHeight)

Howard Henry Schlunder


Quote:
> Any tricks for setting the size of the client area (i.e. the "inside"
width
> and height) to a known value such as the size of an image?

> The Height and Width properties include the various window elements (title
> bar, borders, etc.) so that complicates things.

> Do I have to use the GetSystemMetrics API or something to add up all the
> sizes of the various window parts?

> There's gotta be an easier way--similar to MS Access' InsideHeight and
> InsideWidth properties.

> Joel Moore



Sun, 01 Sep 2002 03:00:00 GMT  
 Setting form width/height = image width/height

Quote:

>Any tricks for setting the size of the client area (i.e. the "inside" width
>and height) to a known value such as the size of an image?

>The Height and Width properties include the various window elements (title
>bar, borders, etc.) so that complicates things.

>Do I have to use the GetSystemMetrics API or something to add up all the
>sizes of the various window parts?

>There's gotta be an easier way--similar to MS Access' InsideHeight and
>InsideWidth properties.

What you're looking for are the ScaleWidth and ScaleHeight properties.

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner



Sun, 01 Sep 2002 03:00:00 GMT  
 Setting form width/height = image width/height

Quote:


> >Any tricks for setting the size of the client area (i.e. the "inside"
width
> >and height) to a known value such as the size of an image?

> >The Height and Width properties include the various window elements
(title
> >bar, borders, etc.) so that complicates things.

> >Do I have to use the GetSystemMetrics API or something to add up all the
> >sizes of the various window parts?

> >There's gotta be an easier way--similar to MS Access' InsideHeight and
> >InsideWidth properties.

> What you're looking for are the ScaleWidth and ScaleHeight properties.

> Lee Weiner
> weiner AT fuse DOT net
> http://home.fuse.net/lweiner

I wouldn't exactly say that.  While you can set the ScaleWidth and
ScaleHeight properties to whatever you want, it won't in fact modify the
actual dimentions of the object at all.  It simply changes the ScaleMode to
your user definition.


Sun, 01 Sep 2002 03:00:00 GMT  
 Setting form width/height = image width/height

Quote:

>What you're looking for are the ScaleWidth and ScaleHeight properties.

>Lee Weiner
>weiner AT fuse DOT net
>http://home.fuse.net/lweiner

Almost.  Setting ScaleWidth and ScaleHeight doesn't do any good as it
doesn't change the size of the form--just the scaled units.

However, (as stated in a previous post in this thread) I can use ScaleWidth
and ScaleHeight on the RHS of my equations.

Joel Moore



Sun, 01 Sep 2002 03:00:00 GMT  
 Setting form width/height = image width/height
Not true, Howard.  If you read the ScaleHeight & ScaleWidth, they return the
dimensions of the client area.  You can use them to set a new scale, but if
you read them without making any change, they work as I said.

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner


Quote:





>> >Any tricks for setting the size of the client area (i.e. the "inside"
>width
>> >and height) to a known value such as the size of an image?

>> >The Height and Width properties include the various window elements
>(title
>> >bar, borders, etc.) so that complicates things.

>> >Do I have to use the GetSystemMetrics API or something to add up all the
>> >sizes of the various window parts?

>> >There's gotta be an easier way--similar to MS Access' InsideHeight and
>> >InsideWidth properties.

>> What you're looking for are the ScaleWidth and ScaleHeight properties.

>> Lee Weiner
>> weiner AT fuse DOT net
>> http://home.fuse.net/lweiner

>I wouldn't exactly say that.  While you can set the ScaleWidth and
>ScaleHeight properties to whatever you want, it won't in fact modify the
>actual dimentions of the object at all.  It simply changes the ScaleMode to
>your user definition.



Mon, 02 Sep 2002 03:00:00 GMT  
 Setting form width/height = image width/height
You know, we are obviously not talking about the same thing.  I'm sure
somebody out there is getting a kick out of our disagreement over two
different subjects, so in my opinion, it would be best if we both stopped.

Howard Henry Schlunder


Quote:
> Not true, Howard.  If you read the ScaleHeight & ScaleWidth, they return
the
> dimensions of the client area.  You can use them to set a new scale, but
if
> you read them without making any change, they work as I said.

> Lee Weiner
> weiner AT fuse DOT net
> http://home.fuse.net/lweiner







> >> >Any tricks for setting the size of the client area (i.e. the "inside"
> >width
> >> >and height) to a known value such as the size of an image?

> >> >The Height and Width properties include the various window elements
> >(title
> >> >bar, borders, etc.) so that complicates things.

> >> >Do I have to use the GetSystemMetrics API or something to add up all
the
> >> >sizes of the various window parts?

> >> >There's gotta be an easier way--similar to MS Access' InsideHeight and
> >> >InsideWidth properties.

> >> What you're looking for are the ScaleWidth and ScaleHeight properties.

> >> Lee Weiner
> >> weiner AT fuse DOT net
> >> http://home.fuse.net/lweiner

> >I wouldn't exactly say that.  While you can set the ScaleWidth and
> >ScaleHeight properties to whatever you want, it won't in fact modify the
> >actual dimentions of the object at all.  It simply changes the ScaleMode
to
> >your user definition.



Mon, 02 Sep 2002 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Setting the Min/Max Width/Height of a form in VB6

2. Setting minimum width and height of form

3. Pixel Height and Width for Gif or JPG Image

4. Determining height/width of server-side image...

5. Image's width and height

6. how to get image properties: width, height pixels...

7. image height width

8. Gif. Jpg image height and width

9. Reading Image Height/Width with VB

10. read blob image header for type, width , height

11. images width and height

12. width and height of a image

 

 
Powered by phpBB® Forum Software