I am trying to put a picture in a cell but it is too big and resizing the grid to accomodate the size of the picture is not an option.. What I want to do is resize the picture to fit inside the cell, how can I do that?
thanks!
- Quack!
Last edited by Ogmius; Dec 8th, 2006 at 11:45 AM.
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."
I wouldn't agree with the highlighted - cell could be as wide as the entire form so can height.
Image size needs to be calculated proportionally (basically scaled down) but based on "highlighted properties" vs original image size.
That code will fit the picture in the cell keeping ratio, but it won't make the picture bigger than its original size when its original size is smaller than the cell. Anyway, if you want to always resize (also in that cases) then this code can be easily modified to do that.
I wouldn't agree with the highlighted - cell could be as wide as the entire form so can height.
Image size needs to be calculated proportionally (basically scaled down) but based on "highlighted properties" vs original image size.
true - i just assumed Ogmius wanted to resize it to fill the cell, not resize it proportionally.
well the cells arent that large, but the pictures are pulled from an imagelist control, so I dont think that would work anyway
Well, if you allow column rsizing then you cannot possibly know what it might be. That one thing. Another one is that you wouldn't want your users to see extremly distorted image or out of reasonable proportions, would you?
That code looks great, im gonna have to use it next chance I get and let you know.. The cells are going to be a fixed size that cannot be changed, so as long as I can get one th work the rest will be great
Thanks!
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."
Ok, I did what you said, and the picture control works fine, but when it sets the cellpicture into the flexgrid I end up with no picture in the flexgrid...
Below is the code, and I aslo attached a bmp of what it looks like
Attached is the application, I changed the names of the people that im generating this for and removed the parts that add registry entries so that it doesnt put a bunch of crap on your PC...
The modules are from other projects that I found on PlanetSourceCode and even here on VB Forums, I just havent had the chance to reference them in my project yet so if you wrote one of these, I Promise you will be acknowledged!
If you click on the button that says "Agent View Test" it will do what its supposed to do, but it still has the bricks instead of the pictures... suggestions would be appreciated!
Thanks in advance!
Last edited by Ogmius; Dec 8th, 2006 at 10:30 AM.
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."
Re: FlexGrid Pictures and Sizing [Resolved (Kinda)]
I got it kinda... I decided to embed the proper size images into the application with an image list control instead of resizing them... its not the way I wanted to do it but it works and thats whats important
"I dont even see the code anymore... I just see Blonde, Brunette, Redhead..."