Exemplo n.º 1
0
        /// <summary>
        /// Gets the watermark to use when the application is in reduced functionality mode.
        /// </summary>
        /// <param name="galleryId">The gallery ID.</param>
        /// <returns>Returns a <see cref="Watermark" /> instance.</returns>
        public static Watermark GetReducedFunctionalityModeWatermark(int galleryId)
        {
            IGallerySettings gallerySetting = Factory.LoadGallerySetting(galleryId);

            Watermark tempWatermark = null;

            try
            {
                tempWatermark = new Watermark();
                tempWatermark.WatermarkText       = GalleryServerPro.Business.Properties.Resources.Reduced_Functionality_Mode_Watermark_Text;
                tempWatermark.TextFontName        = gallerySetting.WatermarkTextFontName;
                tempWatermark.TextColor           = HelperFunctions.GetColor(gallerySetting.WatermarkTextColor);
                tempWatermark.TextHeightPixels    = 0;
                tempWatermark.TextWidthPercent    = 100;
                tempWatermark.TextOpacityPercent  = 100;
                tempWatermark.TextLocation        = ContentAlignment.MiddleCenter;
                tempWatermark._watermarkImage     = GalleryServerPro.Business.Properties.Resources.GSP_Logo;
                tempWatermark.ImageWidthPercent   = 85;
                tempWatermark.ImageOpacityPercent = 50;
                tempWatermark.ImageLocation       = ContentAlignment.BottomCenter;
            }
            catch
            {
                if (tempWatermark != null)
                {
                    tempWatermark.Dispose();
                }

                throw;
            }

            return(tempWatermark);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the watermark that is configured for the specified <paramref name="galleryId" />.
        /// </summary>
        /// <param name="galleryId">The gallery ID.</param>
        /// <returns>Returns a <see cref="Watermark" /> instance.</returns>
        public static Watermark GetUserSpecifiedWatermark(int galleryId)
        {
            IGallerySettings gallerySetting = Factory.LoadGallerySetting(galleryId);

            Watermark tempWatermark = null;

            try
            {
                tempWatermark = new Watermark();
                tempWatermark.WatermarkText       = gallerySetting.WatermarkText;
                tempWatermark.TextFontName        = gallerySetting.WatermarkTextFontName;
                tempWatermark.TextColor           = HelperFunctions.GetColor(gallerySetting.WatermarkTextColor);
                tempWatermark.TextHeightPixels    = gallerySetting.WatermarkTextFontSize;
                tempWatermark.TextWidthPercent    = gallerySetting.WatermarkTextWidthPercent;
                tempWatermark.TextOpacityPercent  = gallerySetting.WatermarkTextOpacityPercent;
                tempWatermark.TextLocation        = gallerySetting.WatermarkTextLocation;
                tempWatermark.ImagePath           = gallerySetting.WatermarkImagePath;
                tempWatermark.ImageWidthPercent   = gallerySetting.WatermarkImageWidthPercent;
                tempWatermark.ImageOpacityPercent = gallerySetting.WatermarkImageOpacityPercent;
                tempWatermark.ImageLocation       = gallerySetting.WatermarkImageLocation;
            }
            catch
            {
                if (tempWatermark != null)
                {
                    tempWatermark.Dispose();
                }

                throw;
            }

            return(tempWatermark);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the watermark that is configured for the specified <paramref name="galleryId" />.
        /// </summary>
        /// <param name="galleryId">The gallery ID.</param>
        /// <returns>Returns a <see cref="Watermark" /> instance.</returns>
        public static Watermark GetUserSpecifiedWatermark(int galleryId)
        {
            IGallerySettings gallerySetting = Factory.LoadGallerySetting(galleryId);

              Watermark tempWatermark = null;
              try
              {
            tempWatermark = new Watermark();
            tempWatermark.WatermarkText = gallerySetting.WatermarkText;
            tempWatermark.TextFontName = gallerySetting.WatermarkTextFontName;
            tempWatermark.TextColor = HelperFunctions.GetColor(gallerySetting.WatermarkTextColor);
            tempWatermark.TextHeightPixels = gallerySetting.WatermarkTextFontSize;
            tempWatermark.TextWidthPercent = gallerySetting.WatermarkTextWidthPercent;
            tempWatermark.TextOpacityPercent = gallerySetting.WatermarkTextOpacityPercent;
            tempWatermark.TextLocation = gallerySetting.WatermarkTextLocation;
            tempWatermark.ImagePath = gallerySetting.WatermarkImagePath;
            tempWatermark.ImageWidthPercent = gallerySetting.WatermarkImageWidthPercent;
            tempWatermark.ImageOpacityPercent = gallerySetting.WatermarkImageOpacityPercent;
            tempWatermark.ImageLocation = gallerySetting.WatermarkImageLocation;
              }
              catch
              {
            if (tempWatermark != null)
              tempWatermark.Dispose();

            throw;
              }

              return tempWatermark;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Gets the watermark to use when the application is in reduced functionality mode.
        /// </summary>
        /// <param name="galleryId">The gallery ID.</param>
        /// <returns>Returns a <see cref="Watermark" /> instance.</returns>
        public static Watermark GetReducedFunctionalityModeWatermark(int galleryId)
        {
            IGallerySettings gallerySetting = Factory.LoadGallerySetting(galleryId);

              Watermark tempWatermark = null;
              try
              {
            tempWatermark = new Watermark();
            tempWatermark.WatermarkText = GalleryServerPro.Business.Properties.Resources.Reduced_Functionality_Mode_Watermark_Text;
            tempWatermark.TextFontName = gallerySetting.WatermarkTextFontName;
            tempWatermark.TextColor = HelperFunctions.GetColor(gallerySetting.WatermarkTextColor);
            tempWatermark.TextHeightPixels = 0;
            tempWatermark.TextWidthPercent = 100;
            tempWatermark.TextOpacityPercent = 100;
            tempWatermark.TextLocation = ContentAlignment.MiddleCenter;
            tempWatermark._watermarkImage = GalleryServerPro.Business.Properties.Resources.GSP_Logo;
            tempWatermark.ImageWidthPercent = 85;
            tempWatermark.ImageOpacityPercent = 50;
            tempWatermark.ImageLocation = ContentAlignment.BottomCenter;
              }
              catch
              {
            if (tempWatermark != null)
              tempWatermark.Dispose();

            throw;
              }

              return tempWatermark;
        }