Question How to get only the visible image on Picturebox

tresehulyo

Member
Joined
Sep 1, 2009
Messages
16
Programming Experience
Beginner
How to get only the visible image on Picturebox

the picture size is 320 x 240 and the picturebox is 240 x 240

i want to save the image in 240 x 240 pixels how?
 
Her is a very basic example code.
VB.NET:
        'Get the picturebox image.
        Dim inImage As System.Drawing.Image = PictureBox1.Image
        'Set the new images size.
        Dim outImage As New Bitmap(inImage, PictureBox1.Width, PictureBox1.Height)
        'Format the new image i.e. bmp jpeg....
        Dim formatImage = Imaging.ImageFormat.Bmp
        'Save the new image.
        outImage.Save("Path to save the new image\1.bmp", formatImage)
 
Back
Top