Problem Loading and sizing images

N

Nigel

I want to load a series of images, resize them, and display them in a
MSFlexGrid.

I've got MSFlexGrid displaying images as follows:
With Me.flxGalleries 'the MSFlexGrid
.Redraw = False
.Clear
.Row = 1
.Col = 1
Set .CellPicture = LoadPicture("C:\Windows\Rhododendron.bmp")
.Row = 1
.Col = 2
Set .CellPicture = LoadPicture("C:\Windows\Roses.bmp")
... etc
.Redraw = True
End With

Trouble is, the .bmp files are too big for the cells. So I was going to
resize the images and try this:
Dim Pic1 as image
Pic1 = LoadPicture("C:\Windows\Roses.bmp")

Trouble is, I get the "Run-time error "91". Object variable or With block
variable not set.

Why?

Then, how do I resize the image before puting it into MSFlexGrid? I was
going to do something like this:

Pic1.width = .CellWidth
Pic1.height = . CellHeight

..CellPicture = Pic1.Picture

But none of that works either !!!
 
D

Douglas J. Steele

See whether

Set Pic1 = LoadPicture("C:\Windows\Roses.bmp")

makes a difference.
 
N

Nigel

Thanks Daniel,

I had tried that already and received a Type Mismatch error. My problem was
actually:

Dim Pic1 as Image

...... should have been .....

Dim Pic1 as Object

N.
 

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