I am setting the cell Class type in an FNCGrid to TTMSFNCBitmapGridCell;
I am then traversing the grid after population and then depending on contents of a cell using fncGrid.AddBitmap to set the sell bitmap.
It is appearing in the cell but it is expanding to fill the grid (its an SVG in the FNCBitmapContainer) which event/how do I set size limits on the SVG populating a cell?
Can you send us a sample, because each SVG is different, some of them have no size limit. The event to control the size is OnGetCellProperties. Where you can use ControlStretched, ControlWidth & ControlHeight to control the size.
The SVG does indeed stretch massive – I know if I open it in GIMP, GIMP prompts me to select the size so this is probably whats going on.
If I can control the limits through OnGetCellProperties though that makes me a happy bunny, I will give it a test.
Attached the SVG.
(Attachment mail-bulk-solid.svg is missing)
I cannot see the SVG, but if GIMP is prompting, then the OnGetCellProperties is not going to solve the issue. It is only specifing the Width & Height in which the SVG should be drawn, if there are no built-in limits, then unfortunately the SVG will need to be manually preset to a fixed size. Can you re-attach? If an attachment is not working, please send us the SVG separately via firstname.lastname@example.org
Resending as zip as SVG was rejected.
mail-bulk-solid.zip (633 Bytes)
OK, I will set the limits on the SVG – thanks Pieter.
I tested this here with the SVG, the code with ControlStretched should work, so no need to change the SVG:
procedure TForm1.TMSFNCGrid1GetCellProperties(Sender: TObject; ACol,
ARow: Integer; Cell: TTMSFNCGridCell);
if Cell is TTMSFNCBitmapGridCell then
(Cell as TTMSFNCBitmapGridCell).ControlStretched := True;