I’m looking for a way to get an image from a desktop clipboard and insert it into my Wisej web project. I’m converting a vb.net desktop app into a web app. The code I used when my app was a desktop app simply pulled the data from the clipboard, but obviously I need to get it to the server. I’ve been looking at CKEditor and I found a plugin that works with it https://alfonsoml.blogspot.com/p/simpleuploads-plugin-for-ckeditor.html?m=1 but before I climb that hill, I wondered if there was any functionality built into Wisej that I’ve overlooked. I’ve experimented with the Wisej.Web.Clipboard functions but so far they are not grabbing the image.
Thanks!
Gerry
You can also use a PictureBox. In any case //svr1/ is not a valid URL.
Hi
Trying to use a wisej.Web.HtmlPanel’ in oHtml form so image is in a browser panel and then can do a copy to clipboard..
Close bu it won’t render image but HTML is good? Ideas?
private void ViewImage(string ImageFile= @”\\svr1\Overview 0.jpg”)
{
try
{
FileInfo oFileinfo = new FileInfo(ImageFile);
string imageHtml = “file:” + oFileinfo.FullName.Replace(“\\”, “/”).Replace(” “, “%20″);//e.g. file://svr1/Overview%200.jpg
string strhtml = @”<html> <body><center><hr><img src=” + “\”” + imageHtml + “\”><hr> </body></html>”;frmPopupHtmlBox oHtml = new frmPopupHtmlBox(strhtml, “Viewing: ” + oFileinfo.Name);
oHtml.ShowDialog();
// Need to be able to copy image to clipboard etc
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
Trying to work out how to create an extension so we can Copy text and images to clipboard | charisTheo.io also an examples here Copy an Image or a Text to Clipboard in Javascript
You can only send text to the browser’s clipboard. See https://docs.wisej.com/api/wisej.web/general/wisej.web.clipboard#setclienttext-text. There is no other way because the only way to set the browser’s clipboard is to create a hidden textarea, set the text and execute the copy command. You could convert an image to a data url, or use a plugin that does that.
Please login first to submit.