Hi Friends,
In my project I am trying to save image in my picturebox onto hard disk in different formats (say jpeg, bmp etc). The code i used is as below:
This is saving the images from picturebox to hard disk in selected format i.e. either in Jpeg or BMP formats.HTML Code:Private Sub sfdSave_Image_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) ' If the file name is not an empty string open it for saving. If sfdSave_Current_frame.FileName <> "" Then ' Saves the Image in the appropriate ImageFormat based upon the ' file type selected in the dialog box. ' NOTE that the FilterIndex property is one-based. Select Case sfdSave_Current_frame.FilterIndex Case 1 PBImage.Image.Save(sfdSave_Current_frame.FileName, System.Drawing.Imaging.ImageFormat.Jpeg) Case 2 PBImage.Image.Save(sfdSave_Current_frame.FileName, System.Drawing.Imaging.ImageFormat.Bmp) End Select End If End Sub
But the problem is that;
Theoretically speaking images in Bmp format should occupy more space on hard disk than jpeg as no compressions will be involved. But the size of images saved onto disk is same in both formats. Also when i open the saved images in Gimp 2 and looked for image properties all images, whether stored in jpeg or bmp or tiff or anything from VB.net, are stored in Png format. Can anybody clearly explain whats actually happening here?
Regards,
Ajay




Reply With Quote