473,795 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Graphics, but keeping size down

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

Oct 26 '06 #1
4 1074
In article <11************ *********@e3g20 00cwe.googlegro ups.com>,
Ha***********@g mail.com says...
>
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?

--
Patrick Steele
http://weblogs.asp.net/psteele
Oct 26 '06 #2
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. :-)
--
Anil Gupte
www.keeninc.net
www.icinema.com

"Jarry" <Ha***********@ gmail.comwrote in message
news:11******** *************@e 3g2000cwe.googl egroups.com...
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

Oct 26 '06 #3

Patrick Steele wrote:
>
Final size of what?
the exe file.. and thanks for the info...

Oct 26 '06 #4
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

"Jarry" <Ha***********@ gmail.comwrote in message
news:11******** *************@e 3g2000cwe.googl egroups.com...
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

Oct 26 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
12282
by: Mark Johnson | last post by:
Using: VS 2003 NET C# for Framework and Framework Compact Trying : Moving a Card (Bitmap) as in Solitare (PC + WinCe) Version on OnMouseMove Problem : The affected drawing Area by Invalidate (or Invalidate(Rectangle)) flickers in a nasty way when repainting. This does not happen in the Solitare (PC + WinCe) Versions a well as in a Card game where I have the C++ Source. The use of an empty OnPaintBackground brings no visable results.
0
1401
by: twostepted | last post by:
Hello, This is a bit of a long post (sorry) but here is the jist of it: I've developed a Windows forms User Control marquee (auto-scrolling text like a readerboard). I'm trying to optimize it so that it'll display very large strings with out comsuming so many resources. That is, as the size of the display string increases, the marquee uses additional CPU cycles. I've considered two possible solutions.
6
8168
by: johannblake | last post by:
I am wondering whether it is easy to setup a coordinate system for drawing (using GDI+) that uses meters (or any custom scaling for that matter). Currently, I need to convert from pixels to meters for scaling. This can sometimes get rather complex when you need to take scaling into account or other things like window resizing, scrolling, etc. There is a property called PageUnit which can be set to World. I could not find any examples...
10
1212
by: eggbert | last post by:
Jeff Garcia deserves to play!!! Anyway, why has Microsoft eliminated the "Point" and "Pset" functions in VB.NET from what was already a limited selection of graphical functions in earlier versions of VB? Any chance of doing reasonably sophisticated graphical work in a picturebox control or any other control that supports graphics has been crippled. The "Point" function returns the pixel color at the given coordinates. The "Pset" function...
4
3104
by: billsahiker | last post by:
There is a code example in the MS Training Kit for the Framework 2.0 test that does not seem to work. The example has just three lines of code, but does not indicate where to put the code, so I put it in the form.load event and it generates a blank screen, but is supposed to display "Hello World" on the form. Then I put it in the paint event as shown below and still I get a blank form when it runs. Any ideas what is wrong? I previously...
7
1613
by: rayreeves | last post by:
If I look for guidance on this topic I find simple examples like this: public class Form2:Form { public Form2() { this.Text = "FORM2"; this.Size = new Size(450,400); this.Paint += new PaintEventHandler(Draw_Graphics); } public void Draw_Graphics(object sender,PaintEventArgs e)
9
4273
by: she_prog | last post by:
Dear All, I need to save the content of a panel to a bitmap. The panel can have many child controls which also need to be saved. The problem would be solved if I could have the panel saved to a Graphics object, which is the same as if I'd need to print it. It'd be easy using Control.DrawToBitmap, but I also need the invisible part of the panel (which is hidden because of scrolling) and DrawToBitmap just takes a screenshot.
5
6978
by: Gina_Marano | last post by:
Hey All, Is it possible to draw an image upside down? I am using Microsofts example of "Printing a local report without preview". The only trick is that I want to flip the image upside down. Reason: I need to guarantee that I print a barcode in the exact same
9
5067
by: koschwitz | last post by:
Hi, I hope you guys can help me make this simple application work. I'm trying to create a form displaying 3 circles, which independently change colors 3 times after a random time period has passed. I'm struggling with making the delegate/invoke thing work, as I know GUI objects aren't thread-safe. I don't quite understand the concept I'm supposed to use to modify the GUI thread-safe. Below is my form and my Circle class. Currently,...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.