How to re-size worksheet image in WinForms XlsIO?
Worksheet images can be resized in WinForms XlsIO using the properties Width and Height of IPictureShape interface. The following code snippets shows on how to resize an image in XlsIO.
C#
IWorksheet sheet = workbook.Worksheets[0]; System.Drawing.Image imgSrc = Image.FromFile("../../Data/image.jpg"); //Adding image in to worksheet IPictureShape resizedimage = sheet.Pictures.AddPicture(1, 10, imgSrc); //Resizing the image resizedimage.Width = 50; resizedimage.Height = 50;
VB
Dim sheet As IWorksheet = workbook.Worksheets(0) Dim imgSrc As Image = Image.FromFile("../../Data/image.jpg") //Adding image in to worksheet Dim resizedimage As IPictureShape = sheet.Pictures.AddPicture(1, 10, imgSrc) //Resizing the image resizedimage.Width = 50 resizedimage.Height = 50
The sample for resizing the image in XlsIO can be downloaded here
Conclusion
I hope you enjoyed learning on how to re-size worksheet image in WinForms XlsIO.
You can refer to our WinForms Excel feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WinForms Excel example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!