We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Image Properties

Hello
I have few questions regarding displaying image from XLSIO.

1. How can I set border width = 0 ?
2. How do I align image vertically and horizontally ?
3. How can i give the exact position for an image ? Not just a cell index but may be top and left pixels OR lop-left padding.
4. Is there any way to define background image for some cell range?

Thank you
Nipun

9 Replies

MW Melba Winshia Syncfusion Team February 12, 2007 12:08 PM UTC

Hi Nipun,

1) How can I set border width = 0?

You can set width by using the following code snippets.

IPictureShape pic = mySheet.Pictures.AddPicture("Bluehills.jpg");

//Setting the height and width of the picture
pic.Height = 400;
pic.Width = 400

2) How do I align image vertically and horizontally?

You can rotate the picture by using the following code snippets.

//Rotate.
pic.Picture.RotateFlip(System.Drawing.RotateFlipType.Rotate270FlipY);


3) How can I give the exact position [top and left pixels] for an image?

You can give exact position of the picture by using the following code snippets.

//Position of the picture
pic.Left = 400;
pic.Top = 250;

4) Is there any way to define background image for some cell range?

You can define background image for some cell range by specifying the top row, left column, bottom row and right column.

IPictureShape pic = mySheet.Pictures.AddPicture(1,1,5,6,"Bluehills.jpg");

Here is the sample for your reference:

Picture_Scale.zip

Please take a look at the sample above and let me know if you have any other questions.

Thanks,
Melba



NT Nipun Tamrakar February 12, 2007 03:42 PM UTC

Hello Melba
Thank you for the reply

1) How can I set border width = 0?
I meant border-width not image width.

2) How do I align image vertically and horizontally?
I meant alignment not Rotate/Flip

3) How can I give the exact position [top and left pixels] for an image?
Thank you. This is exactly what i was looking for.

4) Is there any way to define background image for some cell range?
The solution does not give the background image, but i'm not sure if excel has this feature.

I would really appreciate if you could find the solutions for me.(especially Query No. 1)

Thank you
Nipun Tamrakar


MW Melba Winshia Syncfusion Team February 13, 2007 06:09 AM UTC

Hi Nipun,

1) Border width:
--------------

Please use the following code snippets to set border width as 0.

[C#]

IPictureShape pic = sheet.Pictures.AddPicture(@"../../Data/Winter.jpg");

// Line Weight.
pic.Line.Weight=0;

Here is the sample for your reference:

Picture_Scale.zip

2) Regarding aligning image vertically and horizontally and define background image for some cell range could you please provide more details on how this can be done in MS Excel. This would help me in investigating this issue further.

Kindly let me know if you have any other questions.

Thanks,
Melba


NT Nipun Tamrakar February 13, 2007 09:13 AM UTC

Hello Melba
Thank you for the solution.

// Line Weight.
pic.Line.Weight=0;

This line gives an error:
'Syncfusion.XlsIO.IPictureShape' does not contain a definition for 'Line'

I am using version 4.3.0.32 cause I have .NET 1.1. Am i using unsupporting version or is something wrong in my side ?

Thank you
Nipun


MW Melba Winshia Syncfusion Team February 13, 2007 09:26 AM UTC

Hi Nipun,

Thanks for the update.

We have added this feature only in our latest version 4.4. Could you please upgrade to our latest version 4.4.

Kindly let me know if you have any other questions.

Regards,
Melba


NT Nipun Tamrakar February 14, 2007 10:03 AM UTC

Hello Melba
Thank you for the information. But I cannot upgrade to 2.0 very soon.
I have not bought the license for XlsIo yet but I would like to know if I do buy the license, could Syncfusion provide me a new build for 1.1 that has some updated features like the feature discussed above ?

Thank you
Nipun


MW Melba Winshia Syncfusion Team February 14, 2007 11:44 AM UTC

Hi Nipun,

Essential XlsIO version 4.4.0.51 provide support for .NET 1.1-frame work also. Could you please download the syncfusionessentialbackofficestudiosetup.exe (Essential Studio BackOffice Edition), which supports .NET 1.1 also from the following link?

http://www.syncfusion.com/downloads/evaluation/default.aspx

This does not have only samples for 1.1 frame work (Asp.net). But there won’t be any problem in running application in VS2003. This feature [IPictureShape.Line.Weight] has not been included in 4.3.0.32. So please buy license for Essential Studio BackOffice Edition (version 4.4.0.51), which includes many features and also supports 1.1-frame work (ASP.NET).

Kindly let me know if you have any other questions.

Regards,
Melba


PB Prabodh Bansal March 8, 2007 08:08 PM UTC

dear sir
I am giving you the problem of picture as below.
I am having an excel sheet .I manually set the Backgroung image in it.
Now i have a project in vb.net .When i run the project , i want to check the existence of picture in excel sheet using vb.net
Thanks
Prabodh


MW Melba Winshia Syncfusion Team March 9, 2007 09:34 AM UTC

Hi Prabodh,

Thanks for your interest in Essential XlsIO.

You can check the existence of picture in excel sheet by using the following code snippet.

[VB.NET]

'Get picture count
Dim picturecount As Integer = sheet.Pictures.Count

'Check the existence of picture
If picturecount = 0 Then
MessageBox.Show("No picture in sheet")
Else
MessageBox.Show("Picture is present")
End If

Please refer the following sample which implements the above said feature:

http://websamples.syncfusion.com//samples/XlsIO.Windows/56108/main.htm

Kindly let me know if you have any other questions.

Regards,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon