-
My program has a lot of images. And what i have is by a timer control, a new image appears. My method to do this is i have bunch of images at same spot. All are set to invisible. And only one becomes visible at a time, and the rest are invisible. Then after couple of second another become visible and the rest are invisible.
It works and all, but my program takes a whole a lot of space. How can i do this so it doesn't take much space?
People have suggested to save all the images into a certain folder. And then call the images from the program. This method works, and it does make the program take less space, but if I distribute my program, people could edit the images and it will show up in my program. This method I don't like.
Another person suggested that I save the files into a differnt file format that only my program can recognize the file extension, and keep these images with different format in a certain folder and call them up from my program. This method sounds good, but I don't know how to save something in a differnt file format so only my program can recognize.
Does anyone have a solution to this problem? or know how to program the above solution? Please help. All help will be greatly appreciate. Thanks.
-
Have everything on in your Form as a JPEG or GIF. It will save a lot of memeory.
-
Compile your program to N-Code, with the option: Optimize for small code. This makes your program smaller.
Get your pictures to JPEG or GIF and rename the extensions.
-
If you have more than 40 images consider using a graphical method drawing you images on the form instead of overloading your resources and RAM with controls
-
Also, if you are using an PictureBox, you might want to consider using an ImageBox because they use hardly any resources.
-
Hello UstadBhai:
You must search the balance between speed and size. If you set you images in desing time, then you are saving them as a resource in the same .exe file. That makes exe file too long. If you load images at run time, it supposes a waste of time, that is bigger if you images are compressed (gif or jpg), and end user can modify your images.
I recommend you to load the images when program starts. Don't use an image control for every image, because it suposses a great waste in graphics resources. Use only an image control to show the selected picture, and a image list control (Microsoft common controls) to contain all pictures. To avoid user modifications, store all your pictures in a resource file (.res).
I think that's the best way.