Hello,
I have a bmp file which is 1728 X 1003 in size. I have some code that extracys only the protion of the bmp file I am interested in like this
Now when I look at the original image in Paint I see the coordinates I need which is where I got the size 680 X 1000 from.
The picturebox displays exactly the correct portion.
But when I open the saved file the extracted portion is reduced in size to 356 X 483 and the rest of the image is white for a total size of 680 X 1000.
Can anyone explain to me why the image gets reduced please?
This happens even if I do b.save(t)
I have a bmp file which is 1728 X 1003 in size. I have some code that extracys only the protion of the bmp file I am interested in like this
VB.NET:
Dim g As Graphics
b = New Bitmap(680, 1000)
g = Graphics.FromImage(b)
' fill the background with white
g.FillRectangle(Brushes.White, New Rectangle(0, 0, 680, 1000))
' rectangle to extract the portions required portion
Dim srcRect As New RectangleF(0, 0, 680, 1000)
' s is a string to the file
g.DrawImage(Image.FromFile(s), 30, 0, srcRect, GraphicsUnit.Pixel)
' display image
Me.PictureBox1.Image = b
'and save it to file in string t
Me.PictureBox1.Image.Save(t, System.Drawing.Imaging.ImageFormat.Bmp)
Now when I look at the original image in Paint I see the coordinates I need which is where I got the size 680 X 1000 from.
The picturebox displays exactly the correct portion.
But when I open the saved file the extracted portion is reduced in size to 356 X 483 and the rest of the image is white for a total size of 680 X 1000.
Can anyone explain to me why the image gets reduced please?
This happens even if I do b.save(t)