Hey guys,<br><br>I&#39;ve solved the problem.<br><br>It was just use the function 
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }</style>:<p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">mRasterLayer-&gt;setRasterShaderFunction(myRasterShaderFunction);</p><br>at the end of the applypalette() , and and create the myRasterShaderFunction this way:<br>

<br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">QgsColorRampShader* myRasterShaderFunction = new QgsColorRampShader(0,255);</p><br>instead of this way:<br><br>QgsRasterLayer * mypLayer = <span class="kw3">new<br></span> QgsRasterLayer<span class="br0">(</span>myRasterFileInfo.<span class="me1">filePath</span><span class="br0">(</span><span class="br0">)</span>,myRasterFileInfo.<span class="me1">completeBaseName</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span>;<br>

<br><br clear="all">Best Regards,<br>------------------------------<br>Sérgio Cavalcante<br><br>
<br><br><div class="gmail_quote">On Wed, Aug 12, 2009 at 11:03 AM, sergio cavalcante <span dir="ltr">&lt;<a href="mailto:sergio.cavalcante@gmail.com">sergio.cavalcante@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hello Guys, <br><br>I&#39;m with a little problem here trying to &quot;colormaping&quot; a raster.<br><br>Here is the code that adds a raster:<br><a href="http://pastebin.com/m3d57d2e2" target="_blank">http://pastebin.com/m3d57d2e2</a><br>


<br>Where: <br>- AddRasterLayer is the method that adds a layer to the canvas,<br>- qgsImage is the qgsMapCanvas<br>- mclLayerSet is the list of the MapLayers<br>- ui.twPalette is a TreeWidget that holds the colormap<br>

<br>
In this point,<br>myRasterShaderFunction-&gt;setColorRampItemList<span>(</span> myColorRampItems <span>)</span>;<br><br>The application exits abnormally.<br><br>That&#39;s anything that I need to configure in the raster before set this variable?<br>


<br>Anyone could help this desperated developer?<br><br clear="all">Best Regards,<br>------------------------------<br>Sérgio Cavalcante<br><br>
</blockquote></div><br>