resizing an picture... 
Author Message
 resizing an picture...

Hi, I was wondering how I could get and picture (*.bmp,*.gif,*.jpg) to
load into a picture box that has a set size and if the picture is bigger
then the picture box, it will be resized to fit in it without stretching
or distorting the picture.. The stretch command for an imagebox distorts
the picture... So if the picture box was 320 x 240 and I imported a 640 x
480 picture into it, It would resize it to 320 x 240.. and I I imported a
320 x 200 picture into it, it would either center it in the picture box
or resize it to 320 x 240.. I have searched the help files and couldn't
find anything there.. Is there any controls out there that will allow me
to do this?? I am using VB5..

Thanx...
Dan



Thu, 25 Jan 2001 03:00:00 GMT  
 resizing an picture...
Dan, The way that I do this is to have a hidden picture box with the autosize
property set to true, load the picture into that one, get the size of the box
then set the scalemode of the visible picturebox to the physical size of the
hidden box, doing this will scale whatever picture you have to fit the entire
picture box, this may not be desirable at all times but it's a start.

Mark


Quote:

>Hi, I was wondering how I could get and picture (*.bmp,*.gif,*.jpg) to
>load into a picture box that has a set size and if the picture is bigger
>then the picture box, it will be resized to fit in it without stretching
>or distorting the picture.. The stretch command for an imagebox distorts
>the picture... So if the picture box was 320 x 240 and I imported a 640 x
>480 picture into it, It would resize it to 320 x 240.. and I I imported a
>320 x 200 picture into it, it would either center it in the picture box
>or resize it to 320 x 240.. I have searched the help files and couldn't
>find anything there.. Is there any controls out there that will allow me
>to do this?? I am using VB5..

>Thanx...
>Dan



Thu, 25 Jan 2001 03:00:00 GMT  
 resizing an picture...
Ok.. I'm not sure i totally understand.. What should the scalemode be set
to?? I dont know the physical size of the picture that I want to load and
never will because the user will be selecting an image from their HD..

this is what i have anyway.. Is this what you mean??

picHpic1.Picture = LoadPicture(CommonDialog1.filename)
picPic1.ScaleMode = ??
picPic1.Picture = picHpic1.Picture
picPic1.ScaleHeight = picHpic1.Height
picPic1.ScaleWidth = picHpic1.Width

picHpic1 is the hidden picturebox and picPic1 is the visible picturebox..

dan..

Quote:
> Dan, The way that I do this is to have a hidden picture box with the autosize
> property set to true, load the picture into that one, get the size of the box
> then set the scalemode of the visible picturebox to the physical size of the
> hidden box, doing this will scale whatever picture you have to fit the entire
> picture box, this may not be desirable at all times but it's a start.

> Mark



Thu, 25 Jan 2001 03:00:00 GMT  
 resizing an picture...
Hi,
Most commercial imaging tools will do this.  If you want to scale for
view and print, try the ImagN' Active X; or for scale, view, edit, save
try the PhotoPRO Active X.  Nice, hi-quality zoom too.  
Info and trial versions here:   http://www.pegasustools.com/
Good luck,
jack
--
  |   Check out "BETTER JPEG" live: http://www.jpegwizard.com/   |
  |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
  | Jack Berlin - Pegasus Imaging Corp - the BETTER JPEG people! |

  |--------------------------------------------------------------|
Quote:

> Hi, I was wondering how I could get and picture (*.bmp,*.gif,*.jpg) to
> load into a picture box that has a set size and if the picture is bigger
> then the picture box, it will be resized to fit in it without stretching
> or distorting the picture.. The stretch command for an imagebox distorts
> the picture... So if the picture box was 320 x 240 and I imported a 640 x
> 480 picture into it, It would resize it to 320 x 240.. and I I imported a
> 320 x 200 picture into it, it would either center it in the picture box
> or resize it to 320 x 240.. I have searched the help files and couldn't
> find anything there.. Is there any controls out there that will allow me
> to do this?? I am using VB5..

> Thanx...
> Dan



Thu, 25 Jan 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. resizing a picture in a picture box

2. Q: Resizing a picture in picture-box?

3. resizing a picture in powerpoint

4. resize a picture

5. how resize a picture in ai MDI Form

6. How to resize the picture in MDIForm ?

7. Weird behaviour when resizing WMF pictures (GDI)

8. Resize JPG Picture

9. how resize a picture in a MDI Form

10. resizing an picture...

11. How to resize a picture

12. resizing a picture

 

 
Powered by phpBB® Forum Software