Utilization - YBeyin/.NetPhotoAlbum GitHub Wiki
.NetPhotoAlbum Utilization
When you are initialize .NetPhotoAlbum all you need is to connect the data source. If you want to change some properties just visit the Properties page.
Compatible Extensions :
Well for now i have tested with .png , .jpeg extensions. But .NetPhotoAlbum uses Image
type as DataSource. So you can use with any kind of extensions which compatible with Image
type.
DataSource :
When you initialize a .NetPhotoAlbum component, you must give a data source to show your images. Basicly it is like regular DataSource
logic with parameters.
.NetPhotoAlbum creates Thumbnails
with data source images for album. So with this way, performance is increases. And Ram usage is reduces. When you double click on any album object, component will load the original image.
- Id parameter is required for selection of an image from album. When you double click on an image at album, component will check the
Id
and then, original image will be loaded to singular picture box. - Image parameter is for carry the data of raw image. If you do not have enought ram, do not use this parameter. Because of when you are use this parameters, your images will be loaded to component all together. And that may reduce the performance. Also if you given a path to Path parameter, component will dispose the image from Image parameter.
Recommended usage of
Image
parameter: 20 or less number of images that have 720p and lover resolutions.
- Path (RECOMMENDED) parameter is holds the file path of images. When you give a value to this parameter, component will create
Thumbnails
from file path, and when you double click on any album object, image will be loaded from thePath
.
- .NetPhotoAlbum always checks the
Path
ifPath
has a valid value, component will dispose the image fromDataSource
if there is any image.- If you want to use only
Path
parameter, nullImage
parameter will not become a problem.
-
Information parameter is carries
string
value for album object (Only forAlbumStyle.List
for now). You can show some string on album object with this parameter. If you don't want, just let it benull
. -
Url Not included yet but i hope so soon...
Usage Of Path As Data Source
List<ObjectDataSource> Objs = new List<ObjectDataSource>();
for (int i = 0; i < 15; i++)
{
ObjectDataSource obj = new ObjectDataSource();
obj.Path = @"D:\ "somefilepath" \Test.jpg";
obj.Information = "Test Picture " + i.ToString();
Objs.Add(obj);
}
netPhotoAlbum1.DataSource = Objs;
Usage Of Image As Data Source
List<ObjectDataSource> Objs = new List<ObjectDataSource>();
for (int i = 0; i < 15; i++)
{
ObjectDataSource obj = new ObjectDataSource();
obj.Image = Image.FromFile("Some image path"); // or raw image
obj.Information = "Test Picture " + i.ToString();
Objs.Add(obj);
}
netPhotoAlbum1.DataSource = Objs;