| FlexGrid for WinForms Task-Based Help > Scaling an Image |
To scale an image in a single column when the rows of the grid are resized, set the ImageAlign property to Scale.
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1FlexGrid1.Rows(1).Height = 2 * Me.C1FlexGrid1.Rows.DefaultSize Me.C1FlexGrid1.Rows(2).Height = 2 * Me.C1FlexGrid1.Rows.DefaultSize |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1FlexGrid1.Rows[1].Height = 2 * this.c1FlexGrid1.Rows.DefaultSize; this.c1FlexGrid1.Rows[2].Height = 2 * this.c1FlexGrid1.Rows.DefaultSize; |
|
In Code
Add the following code after the code in step 1:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1FlexGrid1.Cols(3).ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.Scale |
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1FlexGrid1.Cols[3].ImageAlign = C1.Win.C1FlexGrid.ImageAlignEnum.Scale; |
|
By using the ImageAlign property, the image will be scaled to fit the maximum area within the cell while preserving the picture's original aspect ratio.