Example #1
0
 /// <summary>
 /// Gets the image filename.
 /// </summary>
 /// <param name="bitmapSource">The bitmap source.</param>
 internal static string GetImageFilename(BitmapSource bitmapSource)
 {
   string filename = bitmapSource.ToString();
   filename = UrlDecodeStringFromStringInternal(filename);
   if (filename.StartsWith("file:///"))
     filename = filename.Substring(8); // Remove all 3 slashes!
   else if (filename.StartsWith("file://"))
     filename = filename.Substring(5); // Keep 2 slashes (UNC path)
   return filename;
 }
        private void SetImageInfo(BitmapSource bitmapSource)
        {
            this.m_lblPictureInfoName.Content = this.m_lblPictureInfoSize.Content = String.Empty;

            if (null == bitmapSource)
            {
                return;
            }
            string strImagePath = bitmapSource.ToString();
            int iImageName = strImagePath.LastIndexOf('/');
            if (-1 != iImageName)
            {
                this.m_lblPictureInfoName.Content = strImagePath.Substring(iImageName+1);
            }

            this.ImagePath = strImagePath;
            
            this.m_lblPictureInfoSize.Content = String.Format("{0:0.##} x {1:0.##} (šířka x výška v pixelech)", bitmapSource.Width, bitmapSource.Height);
            this.m_strHyperlink = (null != this.Image.Tag ? (string)this.Image.Tag : "");
        }