Results 1 to 8 of 8

Thread: Resizing an Image

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Austin, TX
    Posts
    77

    Resizing an Image

    I'd like to load an image (bmp or jpg) of unspecified size, resize it, and save it to a memory stream for display. I thought I could load it into a picture box and resize it that way but:

    a) there has to be a cleaner more direct way to do this (i.e. shouldn't I be able to do this w/o loading it into a pictureBox?)
    b) it looks like pictureBox holds an orginal copy of the image and gives you back that (via pictureBox.Image.Save), so this technique doesn't really seem to work anyway.

    Ideas?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Load it into an Image. Create another Image with your desired target size. Stretch Blit the source image to the target image. Save the target Image.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405
    .getthumbnail method is useful

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2001
    Location
    Austin, TX
    Posts
    77
    Thanks guys, those are some good ideas...

  5. #5
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    .getthumbnail does an awful job as it will blur the whole image
    \m/\m/

  6. #6
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405
    i've used getthumbnail and it hasn't blurred the images, any more than reducing the size in photoshop etc.

  7. #7
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Maybe you had small images and didn't notice..but I assure you if you try with 1024x800 pictures it will blur them up
    \m/\m/

  8. #8
    Fanatic Member Redth's Avatar
    Join Date
    May 2001
    Location
    Ontario, Canada
    Posts
    551
    http://www.vbforums.com/showthread.p...ghlight=resize


    I ran into this problem a long time ago... but there is a good way to resize and even compress into jpg images properly... check out that link... and good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width