Open a new project and play around with the code below. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e _Īs System.EventArgs) Handles Button2.Click Then mImage = CType(Bitmap.FromFile(OpenFileDialog1.FileName), Bitmap) PictureBox1.Invalidate() Private Sub Button1Click(ByVal sender As System.Object, ByVal e _Īs System.EventArgs) Handles Button1.Click Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As _ Use the "new" keyword to create an object instance. Object reference not set to an instance of an object. But this is where I click Button2 and receive an error message for this line of code: My goal is to click Button1, then open an image in PictureBox1 (So far, so good.) Then click Button2 and save the image as a jpg. I have read on the forum that the easist way to save a picturebox image is to use: Microsoft help says in order to save the image in a picturebox, you must assign a button to the image, so I don't know if this is correct, but I am using:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |