Click to See Complete Forum and Search --> : Scaling picture box


comart
October 9th, 2001, 09:05 AM
I want the picture in the cell of the MSFlexgrid to resize to a smaller size than the original picture (picture box). For example, if the picture is 5000x5000 twips.....I would like just a thumbnail to show in the grid at 500x500.

I cannot seem to find a way to scale/stretch a picture inside the cell of a MSFlexgrid.

Iouri
October 9th, 2001, 10:19 AM
You have a few choices, you can either increase the size of the cell to the size of the icon or use
an intermediate picture box to draw the icon onto and then into the cell:

With MSFlexGrid1
.Col = 1
.Row = 4
Picture1.Width = .RowHeight(.Row)
Picture1.Height = .RowHeight(.Row)
Picture1.AutoRedraw = True
Picture1.PaintPicture LoadPicture("MyIcon.ico"), 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
Set .CellPicture = Picture1.Image
End With

This paints the icon onto the picture box with the correct dimensions for the cell then loads this image
into the cellpicture property.

Iouri Boutchkine
iouri@hotsheet.com