SPPictureLibrary class
Represents a document library that contains pictures.
Inheritance hierarchy
System.Object
Microsoft.SharePoint.SPSecurableObject
Microsoft.SharePoint.SPList
Microsoft.SharePoint.SPDocumentLibrary
Microsoft.SharePoint.SPPictureLibrary
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Class SPPictureLibrary _
Inherits SPDocumentLibrary
'Usage
Dim instance As SPPictureLibrary
public class SPPictureLibrary : SPDocumentLibrary
Remarks
To obtain an SPPictureLibrary object, cast the given list as a picture library, as shown in the following example.
Dim pictureLibrary As SPPictureLibrary = CType(list, SPPictureLibrary)
SPPictureLibrary oPictureLibrary = (SPPictureLibrary)list;
Warning
Changing the values of any of the properties of SPPictureLibrary may lead to adverse effects in the user interface and is not supported.
Examples
The following code example displays property settings for the size of images used in a picture library on the specified site.
Dim site As SPWeb =
SPControl.GetContextSite(Context).AllWebs("Site_Name")
Dim pictureLibrary As SPPictureLibrary =
CType(site.Lists("List_Title"), SPPictureLibrary)
Response.Write(pictureLibrary.ThumbnailSize.ToString() & " :: " & _
pictureLibrary.WebImageHeight.ToString() & " :: " & _
pictureLibrary.WebImageWidth.ToString())
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());
}
Note
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.
Thread safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.