Advanced Flash Album Generator.NET for Visual Studio

5444 Users read it.
by Frank Beverdam (March 6, 2008)

Ever wanted to have a nifty flash gallery for all your photos? With Advanced Flash Album Generator.NET you can do that quickly and easy! This component will resize your photos, create thumbnails and put them in an amazing Flash Album. Retrieve images dynamically form your database, XML files or other data sources from Visual Studio. The album is generated from Visual Studio within a few clicks! All your photos will be displayed online instantly in a cool Flash Photo Viewer that is customizable to your site design.

For the entire list of customizable properties and available methods read the API reference.

User Rating (Not rated)
0 reviews available

Author(s):DNzone.com
Language:C#, VB.NET, Jscript.NET, J#
Platform:Web
Product(s):Visual Studio 2005, Visual Studio 2008, Visual Web Developer 2005, Visual Web Developer 2008 Express Edition


Dynamically Modifying the Flash Album Generator

Introduction

Besides statically customizing your album or defining a DataSource, you can also dynamically create a album, change the properties and manage the list of images in the album. Perform these two steps:

1.      Create a new ASP.NET Web Site
Create a new or open an existing ASP.NET Web Site (we use Visual C#).

2.      Add the control to the page
Switch to Design view and drag the  icon from the DNzone tab (in the Toolbox) into the div on your page.

3.      Set the DynamicData Property to true

Set the DynamicData property in the Data Category of the property inspector of Visual Studio to true.

Now you can dynamically  manage the Flash Album. For example, you can modify the properties of the Album. The following section gives an overview of the available properties.

Customizable properties

To modify the appearance of your gallery you can dynamically change the following properties:

GalleryTitle

Description

The title of the Flash Album

Type

String

Default value

Gallery

TitleSize

Description

The font size of the text used in the album

Type

int

Default value

12

ThumbsColumnsNo

Description

The number of columns to be used to display the album thumbnail

Type

int

Default value

5

ThumbsRowsNo

Description

The number of rows to be used to display the album thumbnail

Type

int

Default value

2

ThumbsPadding

Description

The amount of padding to used for the album thumbnails

Type

int

Default value

10

ThumbsWidth

Description

The maximum width of the thumbnails

Type

int

Default value

150

ThumbsHeight

Description

The maximum height of the thumbnails

Type

int

Default value

150

ThumbsRounding

Description

The amount of rounding to apply to the thumbnails in pixels

Type

int

Default value

5

ThumbsShadow

Description

The amount of shadowing to apply to the thumbnails in pixels

Type

int

Default value

0

ThumbsAlpha

Description

The opacity of the thumbnails

Type

int

Default value

30

ImageScale

Description

The size of the images as a percentage of the album size

Type

int

Default value

70

TextShadow

Description

Whether to apply shadowing to the text in the gallery in pixels

Type

bool

Default value

false

ImageFit

Description

If true, images will be stretched the maximum image width and height

Type

bool

Default value

false

NavPosition

Description

The location of the thumbnails relative to the images

Type

string

Default value

false

Allowed values

"Bottom", "Top", "Left" and "Right"

TextColor

Description

The color of the text in the album

Type

System.Drawing.Color

Default value

Color.Gray

AlbumBgColor

Description

The background color of the album

Type

System.Drawing.Color

Default value

Color.White

FrameColor

Description

The color of the image frame, viewed icon, load bars and thumbnail arrows

Type

System.Drawing.Color

Default value

Color.Gray

ActiveFrameColor

Description

The color of the currently selected image frame, viewed icon, load bars and thumbnail arrows

Type

System.Drawing.Color

Default value

Color.Silver

FrameWidth

Description

The width of the image frame in pixels

Type

int

Default value

1

ActiveFrameWidth

Description

The width of the currently selected image frame in pixels

Type

int

Default value

3

Duration

Description

The duration of the animation

Type

int

Default value

1

Transition

Description

The effect to apply for image transitions

Type

DNzone.FlashAlbumGenerator.TransitionEffect

Default value

Transition.Fade

Working with the images

Flash Album provides several methods that allow you to modify the collection of images in the gallery.

The following methods can be used to add or delete individual images.

AddImage(string relPath)

Description:

Adds an image from a path relative to the website's root

Parameter relPath

The path relative to the website's root

AddImage(string relPath, string desc)

Description:

Adds an image from a path relative to the website's root

Parameter relPath

The path relative to the website's root

Parameter desc

The description for the image

AddImage(string relPath, string desc, string link)

Description:

Adds an image from a path relative to the website's root

Parameter relPath

The path relative to the website's root

Parameter desc

The description for the image

AddImage(string relPath, string desc, string link, string targ)

Description:

Adds an image from a path relative to the website's root

Parameter relPath

The path relative to the website's root

Parameter desc

The description for the image

AddImagesFromFolder(string relPath)

Description:

Adds all images from the specified folder

Parameter relPath

The path of the folder relative to the website's root

You can also modify the collection of images directly through the following methods:

GetImages()

Description:

Returns a List<AlbumGeneratorImageInfo> representing the list of Images in the gallery

SetImages(List< AlbumGeneratorImageInfo> imgs)

Description:

Returns a List<AlbumGeneratorImageInfo> representing the list of Images in the gallery

Parameter Images

a List<AlbumGeneratorImageInfo> representing the list of Images in the gallery

These methods use the AlbumGeneratorImageInfo struct which has the following specification:

relativeImagePath

The path relative to the website's root

description

The description for the image

link

The link to which the user is forwarded when he or she clicks the image

linkTarget

The linktarget property of the link

width

The preferred width for the image

height

The preferred height for the image

The following example shows how to modify the gallery dynamically:

protected void Page_Load(object sender, EventArgs e)
    {
        AdvFlashAlbumGeneratorControl1.GalleryTitle = "DNzone Flash Album";
        AdvFlashAlbumGeneratorControl1.AddImage("images/image1.jpg", "the first image", "http://www.google.com", "_self");
        AdvFlashAlbumGeneratorControl1.AddImagesFromFolder("images");
    }

Note that this example requires the album control to be named "AdvFlashAlbumGeneratorControl1". If your control has a different name, change it accordingly. For the entire list of customizable properties and available methods read the API reference.


Follow us on twitter Subscribe to our RSS feed
Activate your free membership today | Login | Currency