Resize picture for a MSFlexGrid cell
Posted on 2000-03-25
First of all... Thank You for taking the time to review this post.
I have been trying to find a way to resize a .GIF or .BMP image, and place the resized image in a cell location within a row of a MSFlexGrid - But No Luck!.
I have tried a LoadPicture event of a PictureBox with AutoSize=TRUE (this is to get the proper full size initially), then I PaintPicture in another PictureBox with the .Width & .Height amounts changed as needed. This looks great, but when I try to put the resized image of the second PictureBox using a "Set MSFlexGrid.CellPicture = PictureBox2.Picture" (the image does NOT appear in the cell!) I have tried doing "SET MSFlexGrid.CellPicture = PictureBox1.Picture" (and that displays ok - but it is the original image size), and finanly I discovered this is the same as doing a "Set MSFlexGrid.CellPicture = LoadPicture("C:\Images\filename.Gif")
I have tried many different variations of the above, including using a Image Control and the Stretch, but when it comes time for the ".CellPicture" It just doesnt want to work for me!
*** SAMPLE CODE I HAVE TRIED ***
Picture1.AutoSize = True
Picture1.Picture = LoadPicture("C:\Images\filename.Gif")
sngPctDiff = .75
Picture2.AutoSize = False
Picture2.Width = Picture1.Width * sngPctDiff
Picture2.Height = Picture1.Height * sngPctDiff
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture1.Width * sngPctDiff, Picture1.Height * sngPctDiff
.Row = 1
.Col = 0
Set .CellPicture = Picture2.Picture
Any suggestions would be much appreciated - Thanks again for taking the time to read this - maybe you have an idea I can try?.
John ("I feel my hair turning more grey by the minute") Mc.