Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am looking to create a web part that simply selects a random image from a picture library and displays it. What is the accepted method for accessing images in a picture library?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I've found the solution through the Microsoft.Sharepoint.SPPictureLibrary class. It is a layer on top of the SPList class, letting you access the pictures in a picture library by manipulating the SPListItems in the library.

share|improve this answer

There is an example on codeplex: SharePoint Ad Rotator

Introduction: SPAdRotator is a SharePoint Web Part that can randomly display images from a SharePoint library. Images can be displayed either one at a time (a new random image is selected every time the page is loaded), or all images can be displayed while the user is viewing the page (with a configurable transition effect).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.