コード例 #1
0
        /// <summary>
        /// Static method to create a website screenshot including full height.
        /// </summary>
        /// <param name="url">The url string of the adress</param>
        /// <param name="presentationSize">Size of the presentation screen</param>
        /// <returns>A <see cref="Bitmap"/> with the web sites screenshot</returns>
        public static Bitmap GetWebSiteScreenshot(string url, Size presentationSize)
        {
            WebsiteImage thumbnailGenerator =
                new WebsiteImage(url, presentationSize);
            Bitmap screenshot = thumbnailGenerator.GenerateWebSiteScreenshot();

            return(screenshot);
        }
コード例 #2
0
    ///////////////////////////////////////////////////////////////////////////////
    // Defining Constants                                                        //
    ///////////////////////////////////////////////////////////////////////////////
    #region CONSTANTS
    #endregion //CONSTANTS

    ///////////////////////////////////////////////////////////////////////////////
    // Defining Variables, Enumerations, Events                                  //
    ///////////////////////////////////////////////////////////////////////////////
    #region FIELDS
    #endregion //FIELDS

    ///////////////////////////////////////////////////////////////////////////////
    // Construction and Initializing methods                                     //
    ///////////////////////////////////////////////////////////////////////////////
    #region CONSTRUCTION
    #endregion //CONSTRUCTION

    ///////////////////////////////////////////////////////////////////////////////
    // Defining events, enums, delegates                                         //
    ///////////////////////////////////////////////////////////////////////////////
    #region EVENTS
    #endregion EVENTS

    ///////////////////////////////////////////////////////////////////////////////
    // Defining Properties                                                       //
    ///////////////////////////////////////////////////////////////////////////////
    #region PROPERTIES
    #endregion //PROPERTIES

    ///////////////////////////////////////////////////////////////////////////////
    // Public methods                                                            //
    ///////////////////////////////////////////////////////////////////////////////
    #region PUBLICMETHODS

    /// <summary>
    /// Static method to create a website thumbnail
    /// </summary>
    /// <param name="url">The url string of the adress</param>
    /// <param name="browserWidth">The browser controls initial width</param>
    /// <param name="browserHeight">The browser controls initial height</param>
    /// <param name="thumbnailSize">Size of the thumbnail</param>
    /// <returns>A <see cref="Bitmap"/> with the web sites thumbnail</returns>
    public static Bitmap GetWebSiteThumbnail(
      string url,
      int browserWidth,
      int browserHeight,
      Size thumbnailSize)
    {
      WebsiteImage thumbnailGenerator =
        new WebsiteImage(url, browserWidth, browserHeight, thumbnailSize);
      return thumbnailGenerator.GenerateWebSiteThumbnailImage();
    }
コード例 #3
0
        ///////////////////////////////////////////////////////////////////////////////
        // Defining Constants                                                        //
        ///////////////////////////////////////////////////////////////////////////////
        #region CONSTANTS
        #endregion //CONSTANTS

        ///////////////////////////////////////////////////////////////////////////////
        // Defining Variables, Enumerations, Events                                  //
        ///////////////////////////////////////////////////////////////////////////////
        #region FIELDS
        #endregion //FIELDS

        ///////////////////////////////////////////////////////////////////////////////
        // Construction and Initializing methods                                     //
        ///////////////////////////////////////////////////////////////////////////////
        #region CONSTRUCTION
        #endregion //CONSTRUCTION

        ///////////////////////////////////////////////////////////////////////////////
        // Defining events, enums, delegates                                         //
        ///////////////////////////////////////////////////////////////////////////////
        #region EVENTS
        #endregion EVENTS

        ///////////////////////////////////////////////////////////////////////////////
        // Defining Properties                                                       //
        ///////////////////////////////////////////////////////////////////////////////
        #region PROPERTIES
        #endregion //PROPERTIES

        ///////////////////////////////////////////////////////////////////////////////
        // Public methods                                                            //
        ///////////////////////////////////////////////////////////////////////////////
        #region PUBLICMETHODS

        /// <summary>
        /// Static method to create a website thumbnail
        /// </summary>
        /// <param name="url">The url string of the adress</param>
        /// <param name="browserWidth">The browser controls initial width</param>
        /// <param name="browserHeight">The browser controls initial height</param>
        /// <param name="thumbnailSize">Size of the thumbnail</param>
        /// <returns>A <see cref="Bitmap"/> with the web sites thumbnail</returns>
        public static Bitmap GetWebSiteThumbnail(
            string url,
            int browserWidth,
            int browserHeight,
            Size thumbnailSize)
        {
            WebsiteImage thumbnailGenerator =
                new WebsiteImage(url, browserWidth, browserHeight, thumbnailSize);

            return(thumbnailGenerator.GenerateWebSiteThumbnailImage());
        }
コード例 #4
0
        /// <summary>
        /// Static method to create a website screenshot including full height
        /// including navigation to frames
        /// </summary>
        /// <param name="baseUrl">The url string of the base web adress</param>
        /// <param name="navigatingArgs">The url and target frame to navigate to.</param>
        /// <param name="presentationSize">Size of the presentation screen</param>
        /// <returns>A <see cref="Bitmap"/> with the web sites screenshot</returns>
        public static Bitmap GetWebSiteScreenshot(
            string baseUrl,
            WebBrowserNavigatingEventArgs navigatingArgs,
            Size presentationSize)
        {
            WebsiteImage thumbnailGenerator =
                new WebsiteImage(baseUrl, navigatingArgs, presentationSize);
            Bitmap screenshot = thumbnailGenerator.GenerateWebSiteScreenshot();

            return(screenshot);
        }
コード例 #5
0
 protected override void FixupTargetLogo()
 {
     StopAnimation();
     if (FileOperations.IsURL(targetName))
     {
         string urlCustomIcon = WebsiteImage.CustomSiteIcon(targetName);
         if (string.IsNullOrEmpty(urlCustomIcon))
         {
             UpdateLogoURL(targetName);
         }
         else
         {
             CustomIcon = urlCustomIcon;
         }
     }
     else
     {
         UpdateLogoFile(targetName);
     }
 }
コード例 #6
0
        internal void UpdateTargetURL(string newTarget, string newDescription)
        {
            CustomIcon = null;
            string urlCustomIcon = WebsiteImage.CustomSiteIcon(newTarget);

            if (string.IsNullOrEmpty(urlCustomIcon))
            {
                UpdateLogoURL(newTarget);
            }
            else
            {
                CustomIcon = urlCustomIcon;
            }

            targetName        = newTarget;
            TargetDescription = newDescription;
            if (string.IsNullOrEmpty(TargetDescription))
            {
                TargetDescription = newTarget;
            }
            FixupConfiguration();
            Update(true);
        }
コード例 #7
0
 public System.Drawing.Image GetSnapshot(string url, int height, int width)
 {
     var imageMaker = new WebsiteImage(url, height, width);
     return imageMaker.GenerateWebSiteImage();
 }
コード例 #8
0
 /// <summary>
 /// Static method to create a website screenshot including full height.
 /// </summary>
 /// <param name="url">The url string of the adress</param>
 /// <param name="presentationSize">Size of the presentation screen</param>
 /// <returns>A <see cref="Bitmap"/> with the web sites screenshot</returns>
 public static Bitmap GetWebSiteScreenshot(string url, Size presentationSize)
 {
   WebsiteImage thumbnailGenerator =
     new WebsiteImage(url, presentationSize);
   Bitmap screenshot = thumbnailGenerator.GenerateWebSiteScreenshot();
   return screenshot;
 }
コード例 #9
0
 /// <summary>
 /// Static method to create a website screenshot including full height
 /// including navigation to frames
 /// </summary>
 /// <param name="baseUrl">The url string of the base web adress</param>
 /// <param name="navigatingArgs">The url and target frame to navigate to.</param>
 /// <param name="presentationSize">Size of the presentation screen</param>
 /// <returns>A <see cref="Bitmap"/> with the web sites screenshot</returns>
 public static Bitmap GetWebSiteScreenshot(
   string baseUrl,
   WebBrowserNavigatingEventArgs navigatingArgs,
   Size presentationSize)
 {
   WebsiteImage thumbnailGenerator =
     new WebsiteImage(baseUrl, navigatingArgs, presentationSize);
   Bitmap screenshot = thumbnailGenerator.GenerateWebSiteScreenshot();
   return screenshot;
 }
コード例 #10
0
        /// <summary>
        /// Updates the target.
        /// </summary>
        /// <param name="newTarget">The new target.</param>
        internal void UpdateTarget(string newTarget)
        {
            CustomIcon = null;
            if (FileOperations.IsURL(newTarget))
            {
                string urlCustomIcon = WebsiteImage.CustomSiteIcon(newTarget);
                if (string.IsNullOrEmpty(urlCustomIcon))
                {
                    UpdateLogoURL(newTarget);
                }
                else
                {
                    CustomIcon = urlCustomIcon;
                }
                targetName        = newTarget;
                TranslationId     = string.Empty;
                TargetDescription = FileOperations.GetPageTitle(newTarget);
                if (string.IsNullOrEmpty(TargetDescription))
                {
                    TargetDescription = newTarget;
                }
                Update(true);
                Manager.FlushCurrentCircle();
            }
            else
            {
                string fileCustomIcon = FileImage.CustomFileIcon(newTarget);
                if (string.IsNullOrEmpty(fileCustomIcon))
                {
                    UpdateLogoFile(newTarget);
                }
                else
                {
                    CustomIcon = fileCustomIcon;
                    DestroyLogoImage();
                    FixupLogoImage();
                }

                //if the image was dragged on the stone, the logo is updated
                if (!FileOperations.FileIsImage(newTarget))
                {
                    targetName        = newTarget;
                    TranslationId     = string.Empty;
                    TargetDescription = Path.GetFileNameWithoutExtension(targetName);
                    if (string.IsNullOrEmpty(TargetDescription))
                    {
                        string rootPath = Path.GetPathRoot(targetName);
                        if (TextHelper.SameText(rootPath, targetName))
                        {
                            string    volumeName;
                            string    volumeLabel;
                            DriveInfo di = new DriveInfo(rootPath);
                            volumeName  = di.Name;
                            volumeLabel = di.VolumeLabel;
                            if (!string.IsNullOrEmpty(volumeLabel))
                            {
                                TargetDescription = volumeLabel + "(" + volumeName + ")";
                            }
                            else
                            {
                                TargetDescription = "(" + volumeName + ")";
                            }
                        }
                        else
                        {
                            TargetDescription = targetName;
                        }
                    }
                }
                else
                {
                    CustomIcon = newTarget;
                }



                FixupConfiguration();
                Update(true);
            }
        }