<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 17, 2015 at 8:46 PM, Lubomir I. Ivanov <span dir="ltr"><<a href="mailto:neolit123@gmail.com" target="_blank">neolit123@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 17 July 2015 at 21:36, Tomaz Canabrava <<a href="mailto:tcanabrava@kde.org">tcanabrava@kde.org</a>> wrote:<br>
><br>
>>>> I am forces to render the dive profile on a QImage so that I can convert<br>
>>>> it to grayscale image and then render it on top of the QWebview, Do you<br>
>>>> think there is a way to convert the vector graphics to grayscale?<br>
>>><br>
>>><br>
>>><br>
>>> graphicsview-common.h:QColor getColor(const color_indice_t i, bool<br>
>>> isGrayscale = false);<br>
>>><br>
>>> so, 90% of the time we are using getColor without the isGrayscale<br>
>>> boolean, triggering the false state.<br>
>>> this is where you should do your stuff :)<br>
>>><br>
>>> grep getColor inside qt-ui/profile and see where you should change.<br>
>>><br>
>>><br>
>><br>
>> I already tried to do this, I also added isGrayscale members in<br>
>> DiveProfileItem, but there are some remaining elements that I couldn't<br>
>> change into grayscale (eg. cylinder pressure curve and numbers on<br>
>> horizontal/vertical axis) please check the screenshot attached, Am I missing<br>
>> something?<br>
><br>
><br>
><br>
> yes, in a few places we are not using the get color correctly and this needs<br>
> to be fixed:<br>
><br>
> tankitem.cpp ( see the setColorAt calls )<br>
> rulerItem.cpp ( check for QColor usage )<br>
> profileWidget.cpp ( check for QColor )<br>
> diveprofileItem.cpp ( check for "     // This paints the colors of the<br>
> velocities. " )<br>
><br>
> getSacColor also doesn't takes into consideration printMode<br>
><br>
<br>
</span>thanks Tomaz,<br>
i admit that when i saw that profile2 didn't support the greyscale<br>
color table, i didn't even bother fixing this. :(<br>
<br>
Gehad, if we can't find an easy way to preserve everything in vector<br>
while in greyscale we may have to use the custom color table for the<br>
profile, after all.<br>
because having the profile and table in raster because of the<br>
greyscale mode is a bit subpar?<br>
<br></blockquote><div><br>The QPrinter::setColorMode() work very nicely it converts the whole printouts to grayscale pages without the need to rasterize the page, the only drawback is that this doesn't work correctly with the QPrintPreviewDialog which I think we may use the css filter way to work around this issue - we will not have identical previewing and printing methods though , what do you think? <br><br></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">regards,</div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div dir="ltr"><div>Gehad</div></div></div></blockquote></div></div>
</div></div>