Results 1 to 2 of 2

Thread: Jpeg resize upon saving ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Location
    Uk, Lancashire
    Posts
    21

    Question Jpeg resize upon saving ?

    Hi

    I have a form in which a image(a jpeg) is loaded into a picturebox using opendialog, this loads the picture into the picturebox fine i have set the picturebox property to stretch the image to fit which is fine also.

    The problem is when i save the image in that picturebox it saves the image to the same dimensions of what it was loaded in at. But when the user presses a button on the form i want the image to be saved as 185x105.

    How can i do this? the code i am using at the moment is simple :-

    Code:
    Try
    
                If pic1 = True Then
                    PictureBox1.Image.Save(FilePic1)
                Else
                    PictureBox1.Refresh()
                End If
            Catch ex As NullReferenceException
            Catch ex As Exception
            End Try
    how can i mod it so it save's to a certain size? any help would be greatly apreciated

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Jpeg resize upon saving ?

    Put your image in a bitmap object. Using the bitmap object you can alter the picture in many ways, and even save it in different formats.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

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