Solved

About picture files...

Posted on 1998-07-01
9
185 Views
Last Modified: 2010-05-03
I am writting up a program in VB 4.0 (32-Bit) that shows a lot of pictures.  I have a command box so that when you click on it, it will display the next picture.  My question is...  how can I put all these pictures into 1 file (.dat, etc.) so that no one can steal my pictures?  And, what would be the easyest way of doing this?

P.S.: I will give you an A if you include a sample

Thanks to you of you that help!!

Paul
drago97@hotmail.com
0
Comment
Question by:drago97
  • 4
  • 3
  • 2
9 Comments
 
LVL 2

Expert Comment

by:marti
ID: 1464757
How about storing all the files in a table?
0
 

Author Comment

by:drago97
ID: 1464758
How do I do that?  Can you please whip up a sample of this?

Thanks,

Paul
drago97@hotmail.com
0
 
LVL 2

Expert Comment

by:marti
ID: 1464759
Do you have MS Access?
0
 

Author Comment

by:drago97
ID: 1464760
Yes, but how do I use it and how do I import it.

P.S.: I haven't used it before ;)

Paul
drago97@hotmail.com
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:marti
ID: 1464761
It's easy to use and you don't have to import it.

1. Create a new DB.
2. Create a table and create two fields for that table: PictureName(text) and Picture(Ole).
3. Enter your data
a. Entrer picture name
b. Double click on Ole field to add a picture

We will continue after this.
My address is konst@sprint.ca if you would like to speed up the process.
0
 
LVL 1

Accepted Solution

by:
jforbes earned 60 total points
ID: 1464762
I have be creating a picture base, and the easy thing I have found to do is to create a Resource File with all of the pictures that you want to use.  WARNING: This only works for Bitmaps.  You can also use resource files for wavs.  The resource files are brokendown into hex so the are rather hard to crack.  Search VB Books Online and use the keywords "Resource Files"  These have helped me immensely.  If you need some examples other than the books online I will give you some.
0
 
LVL 1

Expert Comment

by:jforbes
ID: 1464763
Here is a Sample.
You create a file in notepad, or any other wordprocessor.  You us the Extension .rc

Here is what goes in the file.

//////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//

16                      BITMAP    "c:\USA.BMP"
17                      BITMAP    "c:\windows\FRAN.BMP"

You can only start pictures at number 16 and higher.

lower numbers reserved for cursors/phrases
The // are just comments and the numbers are sort of an index to how the file will be read.

BITMAP describes that the item is a picture.
in quotes is the name of the picture.

then once you have saved this as an .rc file then you use the

rc.exe program supplied with vb.

the program is found in
"C:\Program Files\DevStudio\VB\Wizards\Rc.exe"

the command then is run in the Run in Start in windows.

"C:\Program Files\DevStudio\VB\Wizards\Rc.exe" /r /fo c:\Data.res c:\Client.rc

the /r means run
the /fo means forward only
then the "c:\Data.res" is the file you are creating
the "c:\Client.rc" is the name of the file being read.

("C:\Client.rc", and "c:\Data.res" are just names, you can name them whatever)

the newly created file with the extension .res is a Resource file and is added to the project as a "Add File"

in the code you use the keyword:

LoadResPicture()

Say you have a Pic1.Picuture and you want your USA.BMP in it you can say

pic1.Picture = LoadResPicture(16)

16 is the number you assigned the USA.bmp in the .rc file.

And that is all there is to it.

Hope this helps.

-John


0
 

Author Comment

by:drago97
ID: 1464764
To  jforbes:

I don't have the file "rc.exe" in my VB directory.  Could you please send it to me at 928298@ican.net and I will give you an extra 20 points for it?

Thanks,

:-) Paul (-:
0
 

Author Comment

by:drago97
ID: 1464765
jforbes:

When I try to open my rc file I get an error message saying can't open file.  Are you sure that command line is right?  Do you have any suggestions to why I'm getting an error message?

-==[x] Paul [x]==-
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 56
Windows Script Host failed (Access is denied.) error 6 105
message box in access 4 41
TT Auto Dashboard 13 82
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now