[vtkusers] vtkImageCanvasSource2D ScalarType

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 14 17:04:55 EST 2009


After you set the color that is to be used for drawing (SetDrawColor),
what are you drawing?

On Mon, Dec 14, 2009 at 3:49 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> If I do this, it works fine:
>
> drawing->SetScalarTypeToDouble();
> drawing->SetDrawColor(255.0, 0.0, 0.0, 0.5);
>
> However, if I try to use UnsignedChar:
>
> drawing->SetScalarTypeToUnsignedChar();
> drawing->SetDrawColor(255, 0, 0, 0.5);
>
> I end up with junk all over the image (random pixel which were written
> to that shouldn't have been). Anyone know why this may be the case?
>
> Also, I'm confused about the types. I thought 1.0 would be the max
> value when the scalar type is double, but I still have to use 255. Why
> is this?
>
> One last thing - is the 4th parameter the alpha of the draw color?
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list