Saving an image

After resizing saves original image and size

Page 1 of 1

2 Replies - 2342 Views - Last Post: 29 December 2008 - 10:28 AM Rate Topic: -----

#1 GerLeb93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-December 08

Saving an image

Posted 27 December 2008 - 03:13 PM

Code that opens image file this code works properly

Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FromFile.Click
PBDisplay.Visible = False

If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
PBDisplay.SizeMode = PictureBoxSizeMode.AutoSize
PBDisplay.Image = Image.FromFile(OpenFileDialog1.FileName)
PBDisplay.Visible = True

End If
End Sub

Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs)

End Sub

This code is what i am using to save image after it is re sized, It will not save the new image, it saves the old image and the old size. I am using a picture box to import the image into, then i am resizing the picture box and the image. but when it is saved it reverts to the original image. The rest of the program works fine, just the save code is the problem. Have worked months on this and cannot figure it out.

Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click


If SaveFileDialog1.ShowDialog = DialogResult.OK Then
PBDisplay.Image.Save(SaveFileDialog1.FileName)

End If
End Sub

Is This A Good Question/Topic? 0
  • +

Replies To: Saving an image

#2 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Re: Saving an image

Posted 27 December 2008 - 11:08 PM

When you resize a picture box, it is only resizing it's background image for viewing, it is not changing the actual size of the background image. To do what you want, after the user resizes the picture box, you would have to resize the actual image, and then save it. You could resize the image using the method in this snippet.
Was This Post Helpful? 0
  • +
  • -

#3 GerLeb93  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 27-December 08

Re: Saving an image

Posted 29 December 2008 - 10:28 AM

View Postjacobjordan, on 27 Dec, 2008 - 10:08 PM, said:

When you resize a picture box, it is only resizing it's background image for viewing, it is not changing the actual size of the background image. To do what you want, after the user resizes the picture box, you would have to resize the actual image, and then save it. You could resize the image using the method in this snippet.



View PostGerLeb93, on 29 Dec, 2008 - 09:26 AM, said:

View Postjacobjordan, on 27 Dec, 2008 - 10:08 PM, said:

When you resize a picture box, it is only resizing it's background image for viewing, it is not changing the actual size of the background image. To do what you want, after the user resizes the picture box, you would have to resize the actual image, and then save it. You could resize the image using the method in this snippet.

thanks that code worked with a few changes
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1