Open lizhuangs opened 4 years ago
I agree, this would be really nice feature.
Missing that feature, too. It would keep Viewnior simple but functional.
It would be very helpful to post pics in Github issues. Currently, I use my screenshot.
Looking forward to it too.
Not to hijack this too much but would it be possible to do the reverse, pasting from clipboard into Viewnior? In Windows I often use the paste image feature of Irfanview to confirm how a screenshot turned out. If I need to start another thread for this I can.
I agree, both functionalities would be really nice.
Ristretto can do it, is free and is also in C, so it may be simple to borrow the code…
[Edit] I found this: https://gitlab.xfce.org/apps/ristretto/-/blame/master/src/main_window.c?ref_type=heads#L4314
{
GdkPixbuf *pixbuf;
RsttoImageViewer *viewer;
viewer = RSTTO_IMAGE_VIEWER (window->priv->image_viewer);
pixbuf = rstto_image_viewer_get_pixbuf (viewer);
if (pixbuf)
{
gtk_clipboard_set_image (gtk_clipboard_get (GDK_SELECTION_CLIPBOARD), pixbuf);
g_object_unref (pixbuf);
}
}
GTK is already a dependency for Viewnor, the only requirement is to get a GdkPixBuf
reference of the shown image, which should be pretty easy.
Official Gtk doc for clipboard
UniImageView
has a pixbuf
attribute, so it’s all thereUNI_IMAGE_VIEW(window->view)
seems to get the UniImageView
from the widgetuni-XXX.c
filesIf nobody do it first, I may try to fill a merge request is the following days at is seems pretty simple.
support copy image to clipboard,Tks~