Graphics, but keeping size down

J

Jarry

What are the rules on how VB.Net 2005 packages graphics? If I use the
same graphic in two different picture boxes, does both the images count
towards the final size? What if I start with image really small and
then stretch it to fit the picture box? Is it woth just using colours
if I want to keep file sizes down? Do the grahics make any difference
to the exe file size anyway?

So many questions, so little time. Any help whatsoever would be
appreciated...

Thanks
 
P

Patrick Steele

What are the rules on how VB.Net 2005 packages graphics? If I use the
same graphic in two different picture boxes, does both the images count
towards the final size?

Final size of what?
 
A

Anil Gupte

If your graphic is a property of an object you can reuse it as much as you
want, and it will not add to the size. However, showing a small image and
then stretching it will not make any difference to the size of anything
(except maybe adding a few lines of code).

I'm new to this stuff too, so whatever I say should be taken with a pinch of
salt. :)
 
T

Tom Leylan

If the graphic image is stored as a resource (or even as a separate image
file) there is only one copy regardless of how many places it is displayed.
Clearly if it is displayed simultaneously in a number of spots then RAM is
used to display each image, that RAM is released when the image is no longer
visible.

The key here is to consider what the presence of the graphic images adds to
your app. Meaning, if it is important, then you need them so what does the
size matter? If you don't care what they look like you can make them
smaller and stretch them and again if that "works for you" then fine. Are
you saving 50K and does anybody really care? Are you talking about a logo
or a splash screen image? If you want them displayed then it takes up some
RAM there is no way around it.

Try to stub out the graphic and see what your .EXE size is, then put it back
into place and see what it is then. Is the difference worth it to you? I'm
going to guess you'll prefer the images. I'll also suggest you don't start
optimizing until the app is finished. A couple of MB's more or less just
isn't an issue these days. This shouldn't be an excuse to "waste" space but
you shouldn't be too concerned about "using" space, that's what it's there
for.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top