<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:BatangChe;
        panose-1:2 3 6 9 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texte de bulles Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.gmail-
        {mso-style-name:gmail-;}
span.gmail-m5600810998998452839hoenzb
        {mso-style-name:gmail-m_5600810998998452839hoenzb;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.TextedebullesCar
        {mso-style-name:"Texte de bulles Car";
        mso-style-priority:99;
        mso-style-link:"Texte de bulles";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:FR;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">For a standalone Pyqgis App I needed such function, so here it is (implemented for a QgsMapTool) :<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">from</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
 PyQt4 </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">import</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US"> QtCore</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">from</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
 PyQt4.QtGui </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">import</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US"> QPixmap , QApplication</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:silver;mso-fareast-language:EN-US"># QGIS bindings for mapping functions</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">from</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
 qgis.gui </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">import</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US"> QgsMapTool</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">import</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
 tempfile</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">try</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">:</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">   _fromUtf8 = QtCore.QString.fromUtf8</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">except</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
 AttributeError:</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">   _fromUtf8 =
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">lambda</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US"> s: s</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">class</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
<b>SnapshotTool</b>(QgsMapTool):</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">   
</span><i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#C9802B;mso-fareast-language:EN-US">''' Provide a tool copy map canvas to
<u>clipboard</u> '''</span></i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">   
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">def</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
<b>__init__</b>(<i>self</i>, parent):</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">        QgsMapTool.__init__(<i>self</i>, parent.canvas)</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
<i>self</i>.mainwindow = parent</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
<i>self</i>.canvas = parent.canvas</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:silver;mso-fareast-language:EN-US">#-------------------------------------------------------------------------------</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">   
</span><i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#C9802B;mso-fareast-language:EN-US">''' Overridden QgsMapTool Events '''</span></i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:silver;mso-fareast-language:EN-US">#-------------------------------------------------------------------------------</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">   
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">def</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
<b>canvasPressEvent</b>(<i>self</i>, event):</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#C9802B;mso-fareast-language:EN-US">''' Get point and transform to map coordinates '''</span></i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">        point = event.pos()</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
<i>self</i>.transform = <i>self</i>.mainwindow.canvas.getCoordinateTransform()</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:silver;mso-fareast-language:EN-US"># returns a QgsPoint object in map coordinates</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><span style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">qgsPoint =
<i>self</i>.transform.toMapCoordinates(point.x(), point.y())</span><span style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">self</span></i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">.copyPaste2Clipboard(point,
 qgsPoint)</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">   
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">def</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
<b>canvasReleaseEvent</b>(<i>self</i>, event):</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">pass</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">   
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">def</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
<b>copyPaste2Clipboard</b>(<i>self</i>, point, qgsPoint):</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#C9802B;mso-fareast-language:EN-US">''' Get canvas and copy to
<u>clipboard</u> '''</span></i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:silver;mso-fareast-language:EN-US"># debugging</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US">print</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">
</span><i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#C9802B;mso-fareast-language:EN-US">"copyPaste2Clipboard()"</span></i><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">        pxmap = QPixmap.grabWidget(<i>self</i>.canvas)</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;mso-fareast-language:EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">       
</span><span style="font-size:10.0pt;font-family:Consolas;color:black;mso-fareast-language:EN-US">QApplication.clipboard().setPixmap(pxmap)</span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-bottom:10.0pt;line-height:115%"><span lang="EN-US" style="font-size:10.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="1" cellpadding="0" style="border:none;border-top:solid gray 1.0pt">
<tbody>
<tr style="height:54.95pt">
<td width="294" style="width:220.5pt;border:none;padding:1.5pt 1.5pt 1.5pt 1.5pt;height:54.95pt">
<p class="MsoNormal" style="margin-left:21.3pt;text-indent:-21.3pt;line-height:115%">
<b><span style="font-size:14.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#CC0066">→</span></b><span style="font-size:11.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#1F497D"> 
</span><b><span style="font-size:10.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#1F497D">Sylvain PIERRE</span></b><b><span style="font-size:10.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#CC0066"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="margin-left:21.3pt;text-indent:-21.3pt;line-height:115%">
<span style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#CC0066">        
</span><span style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#1F497D">Chef de projet système d’information<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:21.3pt;text-indent:-21.3pt;line-height:115%">
<span style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#1F497D">         Direction des Systèmes d’Information<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:21.3pt;text-indent:-21.3pt;line-height:115%">
<span style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#1F497D">         Service Projets et Applications Numériques<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:21.3pt;text-indent:-21.3pt;line-height:115%">
<span style="font-family:"Arial","sans-serif";color:navy">       </span><b><span style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#1F497D">Conseil Départemental du Bas-Rhin</span></b><b><span style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:navy"><o:p></o:p></span></b></p>
</td>
<td width="167" style="width:125.35pt;border:none;padding:1.4pt 1.4pt 1.4pt 1.4pt;height:54.95pt">
<p class="MsoNormal" align="center" style="text-align:center;line-height:115%"><a href="http://www.bas-rhin.fr/" title="Cliquez sur le logo pour accéder au site internet du département du Bas-Rhin"><span style="font-size:10.0pt;line-height:115%;font-family:"Arial","sans-serif";color:#1F497D;text-decoration:none"><img border="0" width="152" height="72" id="Image_x0020_18" src="cid:image001.jpg@01D25C34.CB1FA830"></span></a><span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Calibri","sans-serif";color:#1F497D"><o:p></o:p></span></p>
</td>
</tr>
<tr style="page-break-inside:avoid;height:54.95pt">
<td width="463" colspan="2" style="width:347.35pt;border-top:solid gray 1.0pt;border-left:none;border-bottom:solid gray 1.0pt;border-right:none;padding:1.5pt 1.5pt 1.5pt 1.5pt;height:54.95pt">
<p class="MsoNormal" style="line-height:115%"><span style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:gray">         Hôtel du Département<br>
         1 place du Quartier Blanc 67964 Strasbourg Cedex 9<br>
         Tél : 03 88 76 68 88 - mobile : <br>
         Mobile : 06 30 96 31 76<br>
         Email : <a href="mailto:sylvain.pierre@bas-rhin.fr">sylvain.pierre@bas-rhin.fr</a><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:115%"><span style="font-size:11.0pt;line-height:115%;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">        
<a href="http://www.bas-rhin.fr"><span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";mso-fareast-language:FR">www.bas-rhin.fr</span></a></span><span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Arial","sans-serif";color:gray"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Qgis-user [mailto:qgis-user-bounces@lists.osgeo.org]
<b>De la part de</b> Larry Shaffer<br>
<b>Envoyé :</b> mardi 20 décembre 2016 21:44<br>
<b>À :</b> DelazJ<br>
<b>Cc :</b> qgis-user@lists.osgeo.org<br>
<b>Objet :</b> Re: [Qgis-user] Tool to copy the content of the map canvas to the clipboard<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Tue, Dec 20, 2016 at 11:02 AM, DelazJ <<a href="mailto:delazj@gmail.com" target="_blank">delazj@gmail.com</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span class="gmail-">2016-12-20 18:23 GMT+01:00 Bo Victor Thomsen <<a href="mailto:bo.victor.thomsen@gmail.com" target="_blank">bo.victor.thomsen@gmail.com</a>>:<o:p></o:p></span></p>
<p class="MsoNormal">Hi List-members -<br>
<br>
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.<o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">from PyQt4.QtGui import *<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">QApplication.clipboard().setImage(QImage(QPixmap.grabWidget(iface.mapCanvas())))<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Larry Shaffer<br>
Dakota Cartography<o:p></o:p></p>
<div>
<p class="MsoNormal">Black Hills, South Dakota<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">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.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Harrissou<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><br>
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)<br>
<br>
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 ;-)<br>
<br>
Regards<span style="color:#888888"><br>
<span class="gmail-m5600810998998452839hoenzb">Bo Victor Thomsen</span><br>
<span class="gmail-m5600810998998452839hoenzb">Municipality of Frederikssund, Denmark.</span><br>
<span class="gmail-m5600810998998452839hoenzb">_______________________________________________</span><br>
<span class="gmail-m5600810998998452839hoenzb">Qgis-user mailing list</span><br>
<span class="gmail-m5600810998998452839hoenzb"><a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a></span><br>
<span class="gmail-m5600810998998452839hoenzb">List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-user</a></span><br>
<span class="gmail-m5600810998998452839hoenzb">Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-user</a></span></span><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">
http://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>