Open and save a bmp file in Microsoft Paint

G

Guest

Using vba, I need to open a 256 color bmp file in Microsoft paint, then save
it as a 24-bit image. I have a large number of files and have already
developed a way to programatically loop through the files.

Thanks very much for your help!
 
S

Steve

Look at the Shell function in the Help file to see if that is what you are
looking for.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
G

Guest

Thanks, Steve. It looks like I could open Paint that way but, in order to
complete my task on each file with code, i.e. saving it in a 24-bit image
(which is a 'Paint' capability), I think I might need to use automation -
like in opening a Word.Application (see KB article 154569).
If I can get that far, I'll need to figure out a method for the save and
I'll be ok.
So far, I haven't been able to figure out how to work with Microsoft Paint
with code in Access VBA.
Thanks for any help!
 
S

Steve

You can open Paint with the Shell function in the click event of a button on
your form. At that poit you will be working in Paint. After you complete
whatever you are doing, you can save your work in a 24-bit image from Paint.
At that point you are still in Paint. Now close Paint and you will return to
your form in Access. You don't need automation.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
G

Guest

I guess I didn't make myself clear, Steve.
I have about 50,000 256-color images I need to open with Paint and save as
24-bit images. I couldn't possibly take the time to manually open and save
that many.

I already developed a way to loop through all of the files, using a table of
all the bmp file names.

I must need automation to open each file in the 256-color format and save in
thee 24-bit format, don't you think?
 
S

Stephen Lebans

You owuld be better off using a third party tool that can perform mass
conversion of Image files. The older freeware Paint Shop Pro could do what
you want(if you can find an older version on the net). Alternatively you can
use the free Image tools here:
http://www.irfanview.com/

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
G

Guest

Thanks so much for replying to me here, Stephen. I've really admired your
work in the past and how you share your ideas and time in the community.

I'm not sure I will go for the alternative approach, because I only have
this one-time need. I will take a look at finding an old 'Paint Shop Pro'.

This opening of each file, in my looping through all the files, gets me into
each 256 color Paint image:

Dim sPaint As String
Dim sPicture As String

sPaint = Environ("SYSTEMROOT") & "\System32\mspaint.exe"
sPicture = "C:\OentCard\Bitmap\Test256.bmp"

Shell """" & sPaint & """ """ & sPicture & """", vbNormalFocus

I just have the one problem - how to 'Save As' the image in 24-bit from
within Paint with vba code while moving through the files.

Thank you again.
 
S

Stephen Lebans

You cannot Automate Paint in the manner you are attemtpting. Follow one of
my suggestions to use an external Third party application to convert the
Image files on mass.

Good luck.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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