Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Saving image by Handle?

  1. #1

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Resolved [RESOLVED] [2005] Saving image by Handle?

    Hello everyone,

    I have an image which I need to resize and save in the new size.

    I show the image on my form in the 'new' size by displaying it as a PictureBox's BackgroundImage in Zoom-mode. This is resolution I want the picture to be saved in.

    Now, is there a way to save the image that way? All my attempts seem to save the image in it's original size.

    I now use this code, which really only creates a copy of the image.
    VB Code:
    1. Dim imgInput As Drawing.Image = Drawing.Image.FromFile("C:\InputImage.jpg")
    2. picContainer.BackColor = Color.Black
    3. picContainer.Width = 160
    4. picContainer.Height = 120
    5. picContainer.BackgroundImage = imgInput
    6. picContainer.BackgroundImageLayout = ImageLayout.Zoom
    7. picContainer.BackgroundImage.Save("C:\OutputImage.jpg")

    Thanks,
    arsmakman.
    Last edited by arsmakman; Aug 12th, 2006 at 05:47 PM.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  2. #2

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Re: [2005] Saving image as it is shown?

    I think there must be a way to capture the image by using the PictureBox's handle. There are screen-capture programs available that can take like a
    'PrintScreen' from one window or control. This is what I need, I just can't seem to find any way of doing it.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

  3. #3

    Thread Starter
    Fanatic Member arsmakman's Avatar
    Join Date
    Dec 2001
    Location
    Leiden, Netherlands.
    Posts
    719

    Re: [2005] Saving image as it is shown? / Saving image by Handle?

    Yay! I found a solution, right here on the forum: http://www.vbforums.com/showthread.php?t=385497

    Silly me.
    No matter how fool-proof your program is, there will always be a better fool.

    Was a post helpful to you? Rate it!

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