Loading an array of images from an a file into a Picture Box in VB

M

MikeG0930

I want to be able to load images from a file located in a folder. I don't
want to use ImageList. These images will appear in a picture box one at a
time in succession. I am also using the BitBlt Function. The line of code I
am having trouble with is:

PicAnimDC = CreateDC(Application.StartupPath & picF(i), picH(i))

picAnimDC - Stores the device context
picF(i) - Stores filename constants
picH(i) - Stores handles of loaded pictures
 
F

Family Tree Mike

MikeG0930 said:
I want to be able to load images from a file located in a folder. I don't
want to use ImageList. These images will appear in a picture box one at a
time in succession. I am also using the BitBlt Function. The line of code I
am having trouble with is:

PicAnimDC = CreateDC(Application.StartupPath & picF(i), picH(i))

picAnimDC - Stores the device context
picF(i) - Stores filename constants
picH(i) - Stores handles of loaded pictures

When you say you are having trouble on this line, what is the trouble?

As a guess, I would try the following to build the filename properly:

PicAnimDC = CreateDC(Path.Combine(Application.StartupPath, picF(i)), picH(i))

Mike
 
M

MikeG0930

"Path" is showing up as not declared. The problem I am having is that the
images are not being located.
 
F

Family Tree Mike

MikeG0930 said:
"Path" is showing up as not declared. The problem I am having is that the
images are not being located.

Try using System.IO.Path.Combine(...

Mike
 

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