Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / April 2008

Tip: Looking for answers? Try searching our database.

determing file size of Bitmap object without saving it...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
buu - 27 Apr 2008 20:30 GMT
how could I find file size of an bitmap object downloaded from an web site
without saving it to the disk (and using system.io.FileInfo)?

is there any way to create some kind of an byte array and read it's size?
Peter Duniho - 28 Apr 2008 00:50 GMT
> how could I find file size of an bitmap object downloaded from an web  
> site
> without saving it to the disk (and using system.io.FileInfo)?

How are you downloading it?  The best way would be to be involved enough  
in the download process itself so that you already know how large the data  
is.

> is there any way to create some kind of an byte array and read it's size?

Sure.  You could save the Bitmap object to a MemoryStream instance instead  
of to a file.  Then you could look at how large the MemoryStream was.

I still think it would be better to just get the size as you're  
downloading the data.

Pete
JS - 28 Apr 2008 12:20 GMT
I'm not sure I understand your question.  You can look at the width,
height, and pixel format of a bitmap object to figure out the
approximate size that the bitmap would have when saved (assuming that
the bitmap is saved without compression).  If you need to get the size
as it's being received, you can see how a bitmap is stored by googling
these words: bitmap storage msdn.  The headers will tell you the size
of the bitmap.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.