still having an issue of resizing my image.
Using c sharp.net 4.0 winforms and MS Visual Studio 2010.
heres the code I currently have:
private void ShowArrow()
{
foreach (DataGridViewRow paretoRow in ParetoGrid.Rows)
{
if ((paretoRow.Cells["Pareto6"].Value != null) && (Convert.ToInt32(paretoRow.Cells["CurrentPareto"].Value) < (Convert.ToInt32(paretoRow.Cells["NewPareto"].Value))))
{
downArrow.Width = 2;
downArrow.Height = 2;
paretoRow.Cells["p1"].Value = downArrow;
}
else if ((paretoRow.Cells["Pareto6"].Value != null) && (Convert.ToInt32(paretoRow.Cells["CurrentPareto"].Value) > (Convert.ToInt32(paretoRow.Cells["NewPareto"].Value))))
{
//ParetoGrid.Rows[paretoRow.Index].DefaultCellStyle.BackColor = Color.LightGreen;
paretoRow.Cells["p1"].Value = upArrow;
}
}
}
but when I try to edit the image size it says that the image is read only?
Is this a nice one liner to resize an image? or is there a better way?
many thanks
You can check the ‘read-only’ property of your image object and proceed with it.
Suppose your variable is BitmapImage myImage.
There is another method called SetValue. Hope this helps.
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapimage.aspx