[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Track mouse drags over an image

From: Stefan Monnier
Subject: Re: Track mouse drags over an image
Date: Fri, 11 Jan 2019 11:23:34 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> My question was indeed different: is there any possible use for such a
> feature in other elisp packages that could justify such efforts?
> Djvu-mode uses this for making annotations.  Could something like that
> be useful for other packages, too (packages I do not know about)?

I think I wanted to use such a drag in doc-view-mode to let the user
"zoom to the selected area", but never got to it (in part because of
the tedium of writing that code to do the highlighting of the rectangle
while tracking mouse movements).

I'd expect pdf-tools to want this as well (and there's a chance it's
already implemented there also).

>> E.g. make it work for any image rather than only for PPM images of
>> "depth" 255.  Images are pretty far from my area of expertise, tho, so
>> someone else should look into this.
> PPM (or PGM) images of "depth" 255 allow most easily to highlight the
> dragged region as they represent each pixel by three (or one) byte that
> can easily be addressed and inverted in elisp.  I do not know how to do
> the same thing with, say, PBM images that otherwise could probably be
> more efficient.

I think there's a chance that the end result can be obtained quite
differently (e.g. first convert the source image into a pixmap and then
use some existing toolkit functionality to do the image manipulation,
just like we recently added code to the image resizing).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]