Problem Loading and sizing images

  • Thread starter Thread starter Nigel
  • Start date Start date
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 !!!
 
See whether

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

makes a difference.
 
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.
 
Back
Top