Example #1
0
        public static void CreateImageThumbnail(int ImageID)
        {
            var imageDetail = GlobalVariables.db.GetImageDetail(ImageID);

            var filePath     = imageDetail[0].ImagePath + "/" + imageDetail[0].ImageName;
            var thumbnailDir = FileAccessHelper.GetImageThumbnailDirectory() + "/" + imageDetail[0].ImageName;
            var imageBitmap  = GetImageBitmapFromFilePath(filePath, imageDetail[0].ImageWidth, imageDetail[0].ImageHeight);


            var memoryStream = new MemoryStream();

            imageBitmap.Compress(Bitmap.CompressFormat.Jpeg, 30, memoryStream);
            File.WriteAllBytes(thumbnailDir, memoryStream.ToArray());
        }
Example #2
0
        static GlobalVariables()
        {
            string dbPath = FileAccessHelper.GetLocalFilePath("TravelersGuide.db");

            db = new DatabaseWrapper(dbPath);
        }