|
-
Feb 15th, 2007, 07:42 AM
#1
Thread Starter
Addicted Member
Merge many picture file
Hi,
In my application i use many picture file (jpg and not icon file). I want all this picture merge into one file and then from vb i will access this file and extract right picture as parameter i passed. How to do this with VB?
Thanks
-
Feb 15th, 2007, 11:04 AM
#2
Re: Merge many picture file
May I recommend the Microsoft PictureClip Control 6.0 (add it from the Project\Components menu). I think it will help you.
Here is the extract from MSDN:
########################################
The PictureClip control allows you to select an area of a source bitmap and then display the image of that area in a form or picture box. PictureClip controls are invisible at run time.
File Name
PICCLP32.OCX
Class Name
PictureClip
Remarks
The PictureClip control provides an efficient mechanism for storing multiple picture resources. Instead of using multiple bitmaps or icons, create a source bitmap that contains all the icon images required by your application. When you need to display an individual icon, use the PictureClip control to select the region in the source bitmap that contains that icon.
For example, you could use this control to store all the images needed to display a toolbox for your application. It is more efficient to store all of the toolbox images in a single PictureClip control than it is to store each image in a separate picture box. To do this, first create a source bitmap that contains all of the toolbar icons. The picture at the top of this topic is an example of such a bitmap.
Note For international localized applications, resource files are sometimes a more useful way to store bitmaps. For more information, refer to Chapter 16, "International Issues," in the Visual Basic Programmer's Guide.
You can specify the clipping region in the source bitmap in one of two ways:
Select any portion of the source bitmap as the clipping region. Specify the upper-left corner of the clipping region using the ClipX and ClipY properties. Specify the area of the clipping region using the ClipHeight and ClipWidth properties. This method is useful when you want to view a random portion of a bitmap.
Divide the source bitmap into a specified number of rows and columns. The result is a uniform matrix of picture cells numbered 0, 1, 2, and so on. You can display individual cells using the GraphicCell property. This method is useful when the source bitmap contains a palette of icons that you want to display individually, such as in a toolbar bitmap.
Load the source bitmap into the PictureClip control using the Picture property. You can load only bitmap (.bmp) files into the PictureClip control.
Distribution Note When you create and distribute applications that use the PictureClip control, you should install PicClp32.ocx in the customer's Microsoft Windows System or System32 subdirectory. The Setup Kit included with Visual Basic provides tools to help you write setup programs that install your applications correctly.
This world is not my home. I'm just passing through.
-
Feb 15th, 2007, 08:59 PM
#3
Thread Starter
Addicted Member
Re: Merge many picture file
will try that, but will it take much memory?
Because i want to load only picture i need, mostly one at the time. After use it i will destroy it or replace it with another picture but i don't want picture to store as many single file on client computer, since if that so picture can be erased or changed by client.
Thanks
Last edited by barianto; Feb 15th, 2007 at 09:04 PM.
-
Feb 16th, 2007, 04:00 AM
#4
Re: Merge many picture file
I'm not sure how much memory it would take. Obviously it depends on how many pictures you're storing.
Maybe you'd be better off storing your pictures in a database? I think this would be quite easy - the only challenge is working out how to make the database store a picture, but I imagine there are plenty of examples in this forum of how to do that.
This world is not my home. I'm just passing through.
-
Feb 16th, 2007, 10:27 AM
#5
Re: Merge many picture file
If you're storing all the pictures as a single file you'll need enough memory to load all the pictures into memory every time you need to access one of them, unless you know where in the file each picture is, and you access the file in binary mode, just getting those bytes that make up that picture (which can be exceedingly slow).
It's a trade-off between speed, memory size and number of files. As the number of files gets smaller, the speed gets slower and the needed memory gets larger. You can't make it smaller faster and fewer files all at the same time.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|