Last post Jun 04, 2009 04:38 PM by pauldavidson
May 15, 2009 08:43 AM|pauldavidson|LINK
I have an image file, which I load into my application, and create a bitmap object with it, but changing teh width/height. Is there anyway I can find out how much the filesize would be for this when it gets saved, without actually saving it at this point?
Basically, with resizing, I want to show the new width/height which is easy enough, but also what the filesize would be for saving teh image. Then if the user decides to save they can do so.
May 15, 2009 10:47 AM|Kulrom|LINK
Can't you read the bytes of the new bitmap?
May 15, 2009 11:12 AM|pauldavidson|LINK
whats the gbest way to do that?
When creating the file, I will be doing
where ifEXT is the imageformat (i.e. .jpg or .gif etc etc), so any size I get to would need to mirror what that would save as.
Jun 04, 2009 08:43 AM|BennySutton|LINK
2 ways to do it
1) call a component like Leadtools
Dim _leadctrl As New LEADLib.LEAD
_leadctrl.GetFileInfo(LocalPath, 0, 0)
PicHeight = _leadctrl.InfoHeight
PicWidth = _leadctrl.InfoWidth
_leadctrl = Nothing
'Dim fullSizeImg As System.Drawing.Image
'fullSizeImg = System.Drawing.Image.FromFile(LocalPath)
'PicHeight = fullSizeImg.Height
'PicWidth = fullSizeImg.Width
Jun 04, 2009 04:38 PM|pauldavidson|LINK
that code still only gets me the height and width which I already know. It doesnt get me the size. I need a way to get the size without saving. The reason for this is the user can resize the image using a scroll bar type button..which will constantly change
the size as it goes.