Hi Paulo,
Thanks for reply. In several examples(eg. this and this) they all used unsigned char as scalar types for vtkImageCanvasSource2D class. If I change my code to using double, ie.
vtkNew<vtkImageCanvasSource2D> source;
source->SetScalarTypeToDouble();
source->SetExtent(extent);
source->SetNumberOfScalarComponents(4); // Ensure 4 components for RGBA
source->SetDrawColor(0, 0, 0, 0); // Transparent background
source->FillBox(extent[0], extent[1], extent[2], extent[3]);
source->SetDrawColor(1.0, 1.0, 0, 1.0); // Yellow color with full opacity
source->DrawCircle(200, 100, 30);
source->Update();
nothing will be shown.
Regards