Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SPPictureLibrary class

Represents a document library that contains pictures.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[SubsetCallableTypeAttribute]
public class SPPictureLibrary : SPDocumentLibrary

To obtain an SPPictureLibrary object, cast the given list as a picture library, as shown in the following example.

SPPictureLibrary oPictureLibrary = (SPPictureLibrary)list;
Caution noteCaution

Changing the values of any of the properties of SPPictureLibrary may lead to adverse effects in the user interface and is not supported.

The following code example displays property settings for the size of images used in a picture library on the specified site.

using(SPWeb oWebsite = SPContext.Current.Site.AllWebs["Website_Name"])
{
SPPictureLibrary oPictureLibrary = 
    (SPPictureLibrary)oWebsite.Lists["List_Title"];

Response.Write(oPictureLibrary.ThumbnailSize.ToString() + " :: " +
    oPictureLibrary.WebImageHeight.ToString() + " :: " +
    oPictureLibrary.WebImageWidth.ToString());
}
NoteNote

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.