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.
Unfortunately, activation email could not send to your email. Please try again.

Image Properties

Thread ID:

Created:

Updated:

Platform:

Replies:

56108 Feb 9,2007 07:14 AM Mar 9,2007 04:34 AM ASP.NET Web Forms (Classic) 9
loading
Tags: XlsIO
Nipun Tamrakar
Asked On February 9, 2007 07:14 AM

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

Melba Winshia [Syncfusion]
Replied On February 12, 2007 07:08 AM

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


Nipun Tamrakar
Replied On February 12, 2007 10:42 AM

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

Melba Winshia [Syncfusion]
Replied On February 13, 2007 01:09 AM

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

Nipun Tamrakar
Replied On February 13, 2007 04:13 AM

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

Melba Winshia [Syncfusion]
Replied On February 13, 2007 04:26 AM

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

Nipun Tamrakar
Replied On February 14, 2007 05:03 AM

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

Melba Winshia [Syncfusion]
Replied On February 14, 2007 06:44 AM

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

Prabodh Bansal
Replied On March 8, 2007 03:08 PM

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

Melba Winshia [Syncfusion]
Replied On March 9, 2007 04:34 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;