Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-22 Thread PIERRE Sylvain
Hi,

For a standalone Pyqgis App I needed such function, so here it is (implemented 
for a QgsMapTool) :

from PyQt4 import QtCore

from PyQt4.QtGui import QPixmap , QApplication

# QGIS bindings for mapping functions
from qgis.gui import QgsMapTool

import tempfile

try:
   _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
   _fromUtf8 = lambda s: s

class SnapshotTool(QgsMapTool):
''' Provide a tool copy map canvas to clipboard '''
def __init__(self, parent):
QgsMapTool.__init__(self, parent.canvas)
self.mainwindow = parent
self.canvas = parent.canvas
#---
''' Overridden QgsMapTool Events '''
#---
def canvasPressEvent(self, event):
''' Get point and transform to map coordinates '''
point = event.pos()
self.transform = self.mainwindow.canvas.getCoordinateTransform()
# returns a QgsPoint object in map coordinates
qgsPoint = self.transform.toMapCoordinates(point.x(), point.y())

self.copyPaste2Clipboard(point, qgsPoint)


def canvasReleaseEvent(self, event):
pass

def copyPaste2Clipboard(self, point, qgsPoint):
''' Get canvas and copy to clipboard '''
# debugging
print "copyPaste2Clipboard()"
pxmap = QPixmap.grabWidget(self.canvas)
QApplication.clipboard().setPixmap(pxmap)


→  Sylvain PIERRE
 Chef de projet système d’information
 Direction des Systèmes d’Information
 Service Projets et Applications Numériques
   Conseil Départemental du Bas-Rhin

[cid:image001.jpg@01D25C34.CB1FA830]

 Hôtel du Département
 1 place du Quartier Blanc 67964 Strasbourg Cedex 9
 Tél : 03 88 76 68 88 - mobile :
 Mobile : 06 30 96 31 76
 Email : sylvain.pie...@bas-rhin.fr
 www.bas-rhin.fr


De : Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] De la part de Larry 
Shaffer
Envoyé : mardi 20 décembre 2016 21:44
À : DelazJ
Cc : qgis-user@lists.osgeo.org
Objet : Re: [Qgis-user] Tool to copy the content of the map canvas to the 
clipboard

Hi,

On Tue, Dec 20, 2016 at 11:02 AM, DelazJ 
> wrote:
Hi,
2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen 
>:
Hi List-members -

Is there in Qgis a function / button / menu-item / short-cut / plugin to make a 
simple bitmap copy of the current content of the map-canvas and save it to the 
clipboard ? My users need this to make a copy of the map and paste into MS-Word 
or other software.

While not part of the QGIS app, one could use this PyQGIS snippet to do so 
(tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS console:

from PyQt4.QtGui import *
QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(

This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a paint 
device, like an image. Code can be wrapped in a plugin, then have some key 
bindings applied (would need some more PyQt).

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota

I really need the functionality for my users and I can't seem to find it. The 
closest I've come is the "save as png" menu-item in the project menu. But it's 
to cumbersome to use in this case.

Afaics, there's no "save as png" option but "save as image" in Project menu, 
option from which you can choose the image file format (bmp, jpg...). It's not 
on the clipboard but easier and more accessible than print composer.
Regards,
Harrissou


I'm familiar with the composer function. My users can't use this neither 
because it takes to long to activate (to many choices and to many buttons to 
click)

So I've decided to make a simple plugin to cover this functionality. But first 
I want to be very sure the function actually is missing ;-)

Regards
Bo Victor Thomsen
Municipality of Frederikssund, Denmark.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-21 Thread Larry Shaffer
Hi,

Sorry for the top post...

Btw, you can also grab iface.mainWindow() for the full application main
window screen shot. This just grabs the content area, so no native window
dressings, e.g. no title bar, etc.

There is also the fun stuff in this Qt5 example (I think one for Qt4, too):
http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html

While the user could use another screen capture utility, having some
limited, but reasonable, capture functionality as part of QGIS core can be
quite useful, especially in educational settings, as it would require no
additional software.

Maybe even a simple movie recording feature that dumps to an animated GIF?
Ah, now that would be very, very useful and a fun feature to make. Btw, Qt
can grab the entire screen, or just the portions occupied by QGIS, as well.

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota

On Tue, Dec 20, 2016 at 1:43 PM, Larry Shaffer 
wrote:

> Hi,
>
> On Tue, Dec 20, 2016 at 11:02 AM, DelazJ  wrote:
>
>> Hi,
>>
>> 2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen > >:
>>
>>> Hi List-members -
>>>
>>> Is there in Qgis a function / button / menu-item / short-cut / plugin to
>>> make a simple bitmap copy of the current content of the map-canvas and save
>>> it to the clipboard ? My users need this to make a copy of the map and
>>> paste into MS-Word or other software.
>>>
>>
> While not part of the QGIS app, one could use this PyQGIS snippet to do so
> (tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS console:
>
> from PyQt4.QtGui import *
> QApplication.clipboard().setImage(QImage(QPixmap.
> grabWidget(iface.mapCanvas(
>
> This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a
> paint device, like an image. Code can be wrapped in a plugin, then have
> some key bindings applied (would need some more PyQt).
>
> Larry Shaffer
> Dakota Cartography
> Black Hills, South Dakota
>
>
>> I really need the functionality for my users and I can't seem to find it.
>>> The closest I've come is the "save as png" menu-item in the project menu.
>>> But it's to cumbersome to use in this case.
>>>
>>
>> Afaics, there's no "save as png" option but "save as image" in Project
>> menu, option from which you can choose the image file format (bmp, jpg...).
>> It's not on the clipboard but easier and more accessible than print
>> composer.
>>
>> Regards,
>> Harrissou
>>
>>
>>>
>>> I'm familiar with the composer function. My users can't use this neither
>>> because it takes to long to activate (to many choices and to many buttons
>>> to click)
>>>
>>> So I've decided to make a simple plugin to cover this functionality. But
>>> first I want to be very sure the function actually is missing ;-)
>>>
>>> Regards
>>> Bo Victor Thomsen
>>> Municipality of Frederikssund, Denmark.
>>> ___
>>> Qgis-user mailing list
>>> Qgis-user@lists.osgeo.org
>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-21 Thread Larry Shaffer
Hi Bo, et al.,

On Wed, Dec 21, 2016 at 4:34 AM, Bo Victor Thomsen <
bo.victor.thom...@gmail.com> wrote:

> Ok -
>
> A very rough, but functional first version of the plugin is now in
> https://github.com/Frederikssund/QGIS-canvas-to-clipboard/
>
>- No shortcut
>- No about-box, nice explanations or help text
>- No copyright statements
>- Only one button that create a bitmap of the current map-canvas and
>put into the clipboard
>
> But it works  !
>
> Is it possible that I could get some feedback on how it works on other
> platforms than Windows from someone(s) with access to Linux and/or Mac?
>

Plugin works fine here on macOS 10.11.6 with QGS 2.14. Thanks for putting
it together. Glad to see it works cross-platform without quirks!

Here on macOS, the clipboard contents are recognized as a TIFF-formatted
image (of course, not GeoTIFF, that would be too cool - though I don't know
where one could *paste* a GeoTIFF). Guessing that the clipboard format
might be platform-specific and managed by Qt.

Also here on macOS, there is a thin gray border, which I think is always
part of the widget's scene. IMO actually makes the capture better, if there
is a partial or wrapped white background shown in the canvas and the user
is pasting into a white-background document (common scenario).

Richard, if you are looking to add this to master, maybe it should go under
the View menu, e.g. View -> Copy to Clipboard (maybe right under 'Zoom
Out'?), since Edit menu seems to be just for editing features and is fully
greyed-out if only working with rasters. Another appropriate menu might be
Project -> Copy to Clipboard, under 'Save as Image...', though I think
under View is maybe better.

Be good to have a default key binding, though I can't think of a decent
cross-platform keystroke right now.

Regards,

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota


>
>
> Den 20-12-2016 kl. 21:43 skrev Larry Shaffer:
>
> Hi,
>
> On Tue, Dec 20, 2016 at 11:02 AM, DelazJ  wrote:
>
>> Hi,
>>
>> 2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen > >:
>>
>>> Hi List-members -
>>>
>>> Is there in Qgis a function / button / menu-item / short-cut / plugin to
>>> make a simple bitmap copy of the current content of the map-canvas and save
>>> it to the clipboard ? My users need this to make a copy of the map and
>>> paste into MS-Word or other software.
>>>
>>
> While not part of the QGIS app, one could use this PyQGIS snippet to do so
> (tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS console:
>
> from PyQt4.QtGui import *
> QApplication.clipboard().setImage(QImage(QPixmap.
> grabWidget(iface.mapCanvas(
>
> This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a
> paint device, like an image. Code can be wrapped in a plugin, then have
> some key bindings applied (would need some more PyQt).
>
> Larry Shaffer
> Dakota Cartography
> Black Hills, South Dakota
>
>
>> I really need the functionality for my users and I can't seem to find it.
>>> The closest I've come is the "save as png" menu-item in the project menu.
>>> But it's to cumbersome to use in this case.
>>>
>>
>> Afaics, there's no "save as png" option but "save as image" in Project
>> menu, option from which you can choose the image file format (bmp, jpg...).
>> It's not on the clipboard but easier and more accessible than print
>> composer.
>>
>> Regards,
>> Harrissou
>>
>>
>>>
>>> I'm familiar with the composer function. My users can't use this neither
>>> because it takes to long to activate (to many choices and to many buttons
>>> to click)
>>>
>>> So I've decided to make a simple plugin to cover this functionality. But
>>> first I want to be very sure the function actually is missing ;-)
>>>
>>> Regards
>>> Bo Victor Thomsen
>>> Municipality of Frederikssund, Denmark.
>>> ___
>>> Qgis-user mailing list
>>> Qgis-user@lists.osgeo.org
>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>
>
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-21 Thread Bo Victor Thomsen

Ok -

A very rough, but functional first version of the plugin is now in 
https://github.com/Frederikssund/QGIS-canvas-to-clipboard/


 * No shortcut
 * No about-box, nice explanations or help text
 * No copyright statements
 * Only one button that create a bitmap of the current map-canvas and
   put into the clipboard

But it works  !

Is it possible that I could get some feedback on how it works on other 
platforms than Windows from someone(s) with access to Linux and/or Mac?



Den 20-12-2016 kl. 21:43 skrev Larry Shaffer:

Hi,

On Tue, Dec 20, 2016 at 11:02 AM, DelazJ > wrote:


Hi,

2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen
>:

Hi List-members -

Is there in Qgis a function / button / menu-item / short-cut /
plugin to make a simple bitmap copy of the current content of
the map-canvas and save it to the clipboard ? My users need
this to make a copy of the map and paste into MS-Word or other
software.


While not part of the QGIS app, one could use this PyQGIS snippet to 
do so (tested quickly on macOS 10.11.6 under QGIS 2.14) from the 
PyQGIS console:


from PyQt4.QtGui import *
QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(

This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a 
paint device, like an image. Code can be wrapped in a plugin, then 
have some key bindings applied (would need some more PyQt).


Larry Shaffer
Dakota Cartography
Black Hills, South Dakota

I really need the functionality for my users and I can't seem
to find it. The closest I've come is the "save as png"
menu-item in the project menu. But it's to cumbersome to use
in this case.


Afaics, there's no "save as png" option but "save as image" in
Project menu, option from which you can choose the image file
format (bmp, jpg...). It's not on the clipboard but easier and
more accessible than print composer.

Regards,
Harrissou


I'm familiar with the composer function. My users can't use
this neither because it takes to long to activate (to many
choices and to many buttons to click)

So I've decided to make a simple plugin to cover this
functionality. But first I want to be very sure the function
actually is missing ;-)

Regards
Bo Victor Thomsen
Municipality of Frederikssund, Denmark.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org 
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user




___
Qgis-user mailing list
Qgis-user@lists.osgeo.org 
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user





___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-21 Thread Bo Victor Thomsen

Hi Larry -

The python snippet works like a charm on Windows too. I'll wrap a 
minimalistic python plugin around the snippet with a button and a 
short-cut. I owe you a large cold beer (actually several :-) . That 
snippet saved me from digging into a rather large pile of Qgis/PyQT 
documentation.  You'll get the beer(s) when we meet at some FOSS4G or 
Qgis event..


DelazJ: Yes, I was referring to the "Save as image". I simply couldn't 
remember the English translation for the menu item (Working with a 
Danish Qgis)


Karl-Magnus: (regarding snipping tool) - That's exactly what my users 
presently are doing. But even that is a bit too much work with the mouse 
and keyboard :-)


Richard: Actually, there already is a feature request for this function 
(http://hub.qgis.org/issues/10319) . I'll update the existing request. 
And thank you for the Qgis3 update (You'll get a beer too :-) . If it 
becomes necessary, I'll update the plugin to 3.0. But I hope that some 
developer with commit rights will have mercy on me and write this 
functionality into Qgis 3.0 core.


Regards

Bo Victor Thomsen
Municipality of Frederikssund


Den 20-12-2016 kl. 21:43 skrev Larry Shaffer:

Hi,

On Tue, Dec 20, 2016 at 11:02 AM, DelazJ > wrote:


Hi,

2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen
>:

Hi List-members -

Is there in Qgis a function / button / menu-item / short-cut /
plugin to make a simple bitmap copy of the current content of
the map-canvas and save it to the clipboard ? My users need
this to make a copy of the map and paste into MS-Word or other
software.


While not part of the QGIS app, one could use this PyQGIS snippet to 
do so (tested quickly on macOS 10.11.6 under QGIS 2.14) from the 
PyQGIS console:


from PyQt4.QtGui import *
QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(

This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a 
paint device, like an image. Code can be wrapped in a plugin, then 
have some key bindings applied (would need some more PyQt).


Larry Shaffer
Dakota Cartography
Black Hills, South Dakota

I really need the functionality for my users and I can't seem
to find it. The closest I've come is the "save as png"
menu-item in the project menu. But it's to cumbersome to use
in this case.


Afaics, there's no "save as png" option but "save as image" in
Project menu, option from which you can choose the image file
format (bmp, jpg...). It's not on the clipboard but easier and
more accessible than print composer.

Regards,
Harrissou


I'm familiar with the composer function. My users can't use
this neither because it takes to long to activate (to many
choices and to many buttons to click)

So I've decided to make a simple plugin to cover this
functionality. But first I want to be very sure the function
actually is missing ;-)

Regards
Bo Victor Thomsen
Municipality of Frederikssund, Denmark.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org 
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user




___
Qgis-user mailing list
Qgis-user@lists.osgeo.org 
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user





___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-21 Thread Neumann, Andreas
I agree. It would be nice to have this in QGIS core. 

Andreas 

On 2016-12-21 09:44, Richard Duivenvoorde wrote:

> On 12/20/2016 09:43 PM, Larry Shaffer wrote: 
> 
>> 2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen
>> >:
>> 
>> Hi List-members -
>> 
>> Is there in Qgis a function / button / menu-item / short-cut /
>> plugin to make a simple bitmap copy of the current content of
>> the map-canvas and save it to the clipboard ? My users need this
>> to make a copy of the map and paste into MS-Word or other software.
>> 
>> While not part of the QGIS app, one could use this PyQGIS snippet to do
>> so (tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS
>> console:
>> 
>> from PyQt4.QtGui import *
>> QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(
>> 
>> This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a
>> paint device, like an image. Code can be wrapped in a plugin, then have
>> some key bindings applied (would need some more PyQt).
> 
> Tested here on Linux: working fine too!!
> 
> I think this looks like a nice (easy?) feature request to make this core 
> functionality?
> 
> - right-click menu on mapcanvas with:
> - save Map to Clipboard
> (- set size of MapCanvas to...) I know this is also often needed...
> 
> - one or two buttons to do this?
> 
> While a plugin works for older versions, I think it should not be needed for 
> a teacher/user to hear: install QGIS and add the following plugins (while 
> that is actually what I often have to say)
> 
> I think I could even try to do this :-)
> 
> Regards,
> 
> Richard Duivenvoorde
> 
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

  ___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-21 Thread Richard Duivenvoorde

On 12/21/2016 09:44 AM, Richard Duivenvoorde wrote:

On 12/20/2016 09:43 PM, Larry Shaffer wrote:

2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen
>:

Hi List-members -

Is there in Qgis a function / button / menu-item / short-cut /
plugin to make a simple bitmap copy of the current content of
the map-canvas and save it to the clipboard ? My users need this
to make a copy of the map and paste into MS-Word or other
software.


While not part of the QGIS app, one could use this PyQGIS snippet to do
so (tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS
console:

from PyQt4.QtGui import *
QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(


And for master/QGIS3 use:

from qgis.PyQt.QtWidgets import *
from qgis.PyQt.QtGui import *
QApplication.clipboard().setImage(QImage(QWidget.grab(iface.mapCanvas(

Regards,

Richard
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-21 Thread Brent Wood
I just save the project as image, then add the image to a document. While 
perhaps a few more clicks than using the clipboard, it works fine.

Cheers,
Brent 

On Wednesday, December 21, 2016 9:45 PM, Richard Duivenvoorde 
 wrote:
 

 On 12/20/2016 09:43 PM, Larry Shaffer wrote:
>    2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen
>    >:
>
>        Hi List-members -
>
>        Is there in Qgis a function / button / menu-item / short-cut /
>        plugin to make a simple bitmap copy of the current content of
>        the map-canvas and save it to the clipboard ? My users need this
>        to make a copy of the map and paste into MS-Word or other software.
>
>
> While not part of the QGIS app, one could use this PyQGIS snippet to do
> so (tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS
> console:
>
> from PyQt4.QtGui import *
> QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(
>
> This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a
> paint device, like an image. Code can be wrapped in a plugin, then have
> some key bindings applied (would need some more PyQt).

Tested here on Linux: working fine too!!

I think this looks like a nice (easy?) feature request to make this core 
functionality?

- right-click menu on mapcanvas with:
  - save Map to Clipboard
  (- set size of MapCanvas to...) I know this is also often needed...

- one or two buttons to do this?

While a plugin works for older versions, I think it should not be needed 
for a teacher/user to hear: install QGIS and add the following 
plugins (while that is actually what I often have to say)

I think I could even try to do this :-)

Regards,

Richard Duivenvoorde

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

   ___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-21 Thread Richard Duivenvoorde

On 12/20/2016 09:43 PM, Larry Shaffer wrote:

2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen
>:

Hi List-members -

Is there in Qgis a function / button / menu-item / short-cut /
plugin to make a simple bitmap copy of the current content of
the map-canvas and save it to the clipboard ? My users need this
to make a copy of the map and paste into MS-Word or other software.


While not part of the QGIS app, one could use this PyQGIS snippet to do
so (tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS
console:

from PyQt4.QtGui import *
QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(

This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a
paint device, like an image. Code can be wrapped in a plugin, then have
some key bindings applied (would need some more PyQt).


Tested here on Linux: working fine too!!

I think this looks like a nice (easy?) feature request to make this core 
functionality?


- right-click menu on mapcanvas with:
  - save Map to Clipboard
  (- set size of MapCanvas to...) I know this is also often needed...

- one or two buttons to do this?

While a plugin works for older versions, I think it should not be needed 
for a teacher/user to hear: install QGIS and add the following 
plugins (while that is actually what I often have to say)


I think I could even try to do this :-)

Regards,

Richard Duivenvoorde

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-20 Thread Karl-Magnus Jönsson
Hi!
As I use Windows I usually use the Snipping tool in Windows for such needs. 
Isn’t that an option? Useful for other programs too.

Karl-Magnus Jönsson

Från: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] För Larry Shaffer
Skickat: den 20 december 2016 21:44
Till: DelazJ
Kopia: qgis-user@lists.osgeo.org
Ämne: Re: [Qgis-user] Tool to copy the content of the map canvas to the 
clipboard

Hi,

On Tue, Dec 20, 2016 at 11:02 AM, DelazJ 
> wrote:
Hi,
2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen 
>:
Hi List-members -

Is there in Qgis a function / button / menu-item / short-cut / plugin to make a 
simple bitmap copy of the current content of the map-canvas and save it to the 
clipboard ? My users need this to make a copy of the map and paste into MS-Word 
or other software.

While not part of the QGIS app, one could use this PyQGIS snippet to do so 
(tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS console:

from PyQt4.QtGui import *
QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(

This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a paint 
device, like an image. Code can be wrapped in a plugin, then have some key 
bindings applied (would need some more PyQt).

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota

I really need the functionality for my users and I can't seem to find it. The 
closest I've come is the "save as png" menu-item in the project menu. But it's 
to cumbersome to use in this case.

Afaics, there's no "save as png" option but "save as image" in Project menu, 
option from which you can choose the image file format (bmp, jpg...). It's not 
on the clipboard but easier and more accessible than print composer.
Regards,
Harrissou


I'm familiar with the composer function. My users can't use this neither 
because it takes to long to activate (to many choices and to many buttons to 
click)

So I've decided to make a simple plugin to cover this functionality. But first 
I want to be very sure the function actually is missing ;-)

Regards
Bo Victor Thomsen
Municipality of Frederikssund, Denmark.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-20 Thread Larry Shaffer
Hi,

On Tue, Dec 20, 2016 at 11:02 AM, DelazJ  wrote:

> Hi,
>
> 2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen 
> :
>
>> Hi List-members -
>>
>> Is there in Qgis a function / button / menu-item / short-cut / plugin to
>> make a simple bitmap copy of the current content of the map-canvas and save
>> it to the clipboard ? My users need this to make a copy of the map and
>> paste into MS-Word or other software.
>>
>
While not part of the QGIS app, one could use this PyQGIS snippet to do so
(tested quickly on macOS 10.11.6 under QGIS 2.14) from the PyQGIS console:

from PyQt4.QtGui import *
QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas(

This avoids having to re-render the QGraphicsView (QgsMapCanvas) to a paint
device, like an image. Code can be wrapped in a plugin, then have some key
bindings applied (would need some more PyQt).

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota


> I really need the functionality for my users and I can't seem to find it.
>> The closest I've come is the "save as png" menu-item in the project menu.
>> But it's to cumbersome to use in this case.
>>
>
> Afaics, there's no "save as png" option but "save as image" in Project
> menu, option from which you can choose the image file format (bmp, jpg...).
> It's not on the clipboard but easier and more accessible than print
> composer.
>
> Regards,
> Harrissou
>
>
>>
>> I'm familiar with the composer function. My users can't use this neither
>> because it takes to long to activate (to many choices and to many buttons
>> to click)
>>
>> So I've decided to make a simple plugin to cover this functionality. But
>> first I want to be very sure the function actually is missing ;-)
>>
>> Regards
>> Bo Victor Thomsen
>> Municipality of Frederikssund, Denmark.
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-20 Thread DelazJ
Hi,

2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen :

> Hi List-members -
>
> Is there in Qgis a function / button / menu-item / short-cut / plugin to
> make a simple bitmap copy of the current content of the map-canvas and save
> it to the clipboard ? My users need this to make a copy of the map and
> paste into MS-Word or other software.
>
> I really need the functionality for my users and I can't seem to find it.
> The closest I've come is the "save as png" menu-item in the project menu.
> But it's to cumbersome to use in this case.
>

Afaics, there's no "save as png" option but "save as image" in Project
menu, option from which you can choose the image file format (bmp, jpg...).
It's not on the clipboard but easier and more accessible than print
composer.

Regards,
Harrissou


>
> I'm familiar with the composer function. My users can't use this neither
> because it takes to long to activate (to many choices and to many buttons
> to click)
>
> So I've decided to make a simple plugin to cover this functionality. But
> first I want to be very sure the function actually is missing ;-)
>
> Regards
> Bo Victor Thomsen
> Municipality of Frederikssund, Denmark.
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Tool to copy the content of the map canvas to the clipboard

2016-12-20 Thread Bo Victor Thomsen

Hi List-members -

Is there in Qgis a function / button / menu-item / short-cut / plugin to 
make a simple bitmap copy of the current content of the map-canvas and 
save it to the clipboard ? My users need this to make a copy of the map 
and paste into MS-Word or other software.


I really need the functionality for my users and I can't seem to find 
it. The closest I've come is the "save as png" menu-item in the project 
menu. But it's to cumbersome to use in this case.


I'm familiar with the composer function. My users can't use this neither 
because it takes to long to activate (to many choices and to many 
buttons to click)


So I've decided to make a simple plugin to cover this functionality. But 
first I want to be very sure the function actually is missing ;-)


Regards
Bo Victor Thomsen
Municipality of Frederikssund, Denmark.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user