### check picturebox image size in KB
### check picturebox image size in KB
### check picturebox image size in KB
### check picturebox image size in KB
### check picturebox image size in KB
### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB
### check picturebox image size in KB ### check picturebox image size in KB
### check picturebox image size in KB
Go Back  Xtreme Visual Basic Talk > > > ### check picturebox image size in KB


Reply
 
Thread Tools Display Modes
  #1  
Old 04-05-2007, 09:39 AM
fofput fofput is offline
Newcomer
 
Join Date: Nov 2006
Posts: 21
Default ### check picturebox image size in KB


hi, anyone know how to check an images size in kb or preferable bytes

in vb.net
Reply With Quote
  #2  
Old 04-05-2007, 10:26 AM
rufen101's Avatar
rufen101 rufen101 is offline
Contributor
 
Join Date: Nov 2002
Location: Montréal, Québec, Canada
Posts: 575
Default

Try something like this

Code:
Dim imgKbSize as String Dim ms as MemoryStream() img.Save(ms, Imaging.ImageFormat.Jpeg) imgKbSize = (ms.Lenght \ 1024).ToString() & "Kb" 'To get the total bytes, remove the \ 1024
__________________
Rufen
Reply With Quote
  #3  
Old 04-05-2007, 12:09 PM
fofput fofput is offline
Newcomer
 
Join Date: Nov 2006
Posts: 21
Default

doesn't work

error:
http://sixpop.com/images/images/12162095.jpg


remember that this is vb.net


any ideas?
Reply With Quote
  #4  
Old 04-05-2007, 05:12 PM
MKoslof's Avatar
MKoslof### check picturebox image size in KB MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Well, you never declared img . That has nothing to do with the language being used in the CLR, it's a null object.

Post your code and lets see where the issue is.
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
### check picturebox image size in KB
### check picturebox image size in KB
### check picturebox image size in KB ### check picturebox image size in KB
### check picturebox image size in KB
### check picturebox image size in KB
### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB ### check picturebox image size in KB
### check picturebox image size in KB
### check picturebox image size in KB
 
### check picturebox image size in KB
### check picturebox image size in KB
 
-->