Picture resizing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Geoff Turner

    Picture resizing

    Hi all,
    I have an application that requires me to load an image into
    a picture or image or picclip control.Picture will be JPG format
    and of size 800 X 600 pixels. It will be displayed as say, 200 X 100
    pixels. Question: Is it possible to save the image as a 200 X 100 image,
    or can I only save it as 800 X 600?
    I have tried, using a picture control, 'SavePicture Picture1.Pictur e,
    "qaz.jpg"'
    which does not save the resize the image.
    Any pointers or help would be gratefull.

    Cheers,
    GST


  • Randy Birch

    #2
    Re: Picture resizing

    The image will be saved at its original size. The scale property of the
    image control is visual only. You'll need to load the image at the original
    size, then call the stretchblt API with the size of the new image. This will
    reduce the physical size. The problem is that while VB will allow you to
    save an image in its original format (eg bitmap, gif, jpg), I believe that
    VB will only save the new image as a bitmap ... pretty sure you'll need some
    other 3rd party library to save the resized image in a format other than
    bitmap. You might want to post to msnews.microsof t.com
    public.vb.winap i.graphics for detailed advice and tips. And check the past
    posts there --- lots of GDI-related info of value.

    --

    Randy Birch
    MS MVP Visual Basic

    ----------------------------------------------------------------------------
    Read. Decide. Sign the petition to Microsoft.

    ----------------------------------------------------------------------------



    "Geoff Turner" <g.s.turner@rl. ac.uk> wrote in message
    news:dnk6sf$sls $1@blackmamba.i td.rl.ac.uk...
    : Hi all,
    : I have an application that requires me to load an image into
    : a picture or image or picclip control.Picture will be JPG format
    : and of size 800 X 600 pixels. It will be displayed as say, 200 X 100
    : pixels. Question: Is it possible to save the image as a 200 X 100 image,
    : or can I only save it as 800 X 600?
    : I have tried, using a picture control, 'SavePicture Picture1.Pictur e,
    : "qaz.jpg"'
    : which does not save the resize the image.
    : Any pointers or help would be gratefull.
    :
    : Cheers,
    : GST
    :
    :

    Comment

    • Dean Earley

      #3
      Re: Picture resizing

      Geoff Turner wrote:[color=blue]
      > Hi all,
      > I have an application that requires me to load an image into
      > a picture or image or picclip control.Picture will be JPG format
      > and of size 800 X 600 pixels. It will be displayed as say, 200 X 100
      > pixels. Question: Is it possible to save the image as a 200 X 100 image,
      > or can I only save it as 800 X 600?
      > I have tried, using a picture control, 'SavePicture Picture1.Pictur e,
      > "qaz.jpg"'
      > which does not save the resize the image.
      > Any pointers or help would be gratefull.[/color]

      set picturebox.pict ure = picturebox.imag e
      then try SavePicture again.
      ps, VB can't natively save as JPG, you will need to use IJL or some
      other 3rd party library.

      --
      Dean Earley (dean.earley@ic ode.co.uk)
      i-Catcher Development Team

      iCode Systems

      Comment

      Working...