/// <summary>
        ///     Invoked once the Insert Online Image button has been clicked.
        /// </summary>
        /// <param name="doc"><see cref="HTMLEditorButtonArgs" /> instance that contains the context information.</param>
        public void IconClicked(HTMLEditorButtonArgs doc)
        {
            var dialog = new FrmInsertOnlineImage();

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var tag = string.Format(EmbeddedImageHtmlTagPattern, dialog.ImageBase64, dialog.Alt);
                var insertHtmlButton = new InsertHtmlButton(tag);
                insertHtmlButton.IconClicked(doc);
            }
        }
 public void IconClicked(HTMLEditorButtonArgs doc)
 {
     var image = Clipboard.GetImage();
     if (image != null)
     {
         using (var memoryStream = new MemoryStream())
         {
             image.Save(memoryStream, ImageFormat.Png);
             var base64 = Convert.ToBase64String(memoryStream.ToArray());
             var html = string.Format("<img src=\"data:image/png;base64,{0}\" alt=\"{1}\" />", base64,
                 Guid.NewGuid());
             var insertHtmlButton = new InsertHtmlButton(html);
             insertHtmlButton.IconClicked(doc);
         }
     }
     else
     {
         MessageBox.Show(Resources.NoImageInClipboard, Resources.Information, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #3
0
        public void IconClicked(HTMLEditorButtonArgs doc)
        {
            var image = Clipboard.GetImage();

            if (image != null)
            {
                using (var memoryStream = new MemoryStream())
                {
                    image.Save(memoryStream, ImageFormat.Png);
                    var base64 = Convert.ToBase64String(memoryStream.ToArray());
                    var html   = string.Format("<img src=\"data:image/png;base64,{0}\" alt=\"{1}\" />", base64,
                                               Guid.NewGuid());
                    var insertHtmlButton = new InsertHtmlButton(html);
                    insertHtmlButton.IconClicked(doc);
                }
            }
            else
            {
                MessageBox.Show(Resources.NoImageInClipboard, Resources.Information, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 /// <summary>
 ///     Invoked once the Insert Online Image button has been clicked.
 /// </summary>
 /// <param name="doc"><see cref="HTMLEditorButtonArgs" /> instance that contains the context information.</param>
 public void IconClicked(HTMLEditorButtonArgs doc)
 {
     var dialog = new FrmInsertOnlineImage();
     if (dialog.ShowDialog() == DialogResult.OK)
     {
         var tag = string.Format(EmbeddedImageHtmlTagPattern, dialog.ImageBase64, dialog.Alt);
         var insertHtmlButton = new InsertHtmlButton(tag);
         insertHtmlButton.IconClicked(doc);
     }
 }