I'm having some difficulty cropping an image loaded from a jpg file.
The code I am using below is from another solution found here in Experts Exchange. Maybe I don't understand GDI+ enough...?
I'm able to save the cropped image, but when I open it, it's just a black image. Any ideas why? This one goes for 300.
Dim imgTmp As Image = Image.FromFile("C:\auction_photos\5M13370001\5M13370001O.jpg")
Dim bmpOrig As New Bitmap(imgTmp)
Dim rc As RectangleF = bmpOrig.GetBounds(GraphicsUnit.Pixel)
'TODO: adjust the rectangle to your needs
rc.Inflate(-100, 0) 'take 100 px off the right and left
'Create a new bitmap the size of the cropping rectangle
Dim bmpCrop As New System.Drawing.Bitmap(rc.Width, rc.Height, System.Drawing.Imaging.PixelFormat)