共用方式為


SPPictureLibrary class

表示包含圖片的文件庫。

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

'宣告
Public Class SPPictureLibrary _
    Inherits SPDocumentLibrary
'用途
Dim instance As SPPictureLibrary
public class SPPictureLibrary : SPDocumentLibrary

備註

若要取得SPPictureLibrary物件,轉換為圖片庫中,指定的清單,如下列範例所示。

Dim pictureLibrary As SPPictureLibrary = CType(list, SPPictureLibrary)  
SPPictureLibrary oPictureLibrary = (SPPictureLibrary)list;

注意

變更任何的SPPictureLibrary屬性的值可能會導致使用者介面中的不良影響,並不支援。

Examples

下列程式碼範例會顯示在指定的站台上的圖片庫中的影像大小] 屬性設定值。

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());
}
注意事項注意事項

某些物件實作IDisposable介面,並且您必須避免之後不再需要保留這些物件在記憶體中。良好的程式碼撰寫方式的相關資訊,請參閱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.

請參閱

參照

SPPictureLibrary members

Microsoft.SharePoint namespace