get_SolidFillColor Method Returns Incorrect Value from Presentation Shape in C++

  • version:aspose-slides-cpp-windows-23.1
  • The fill color obtained by the following code is incorrect
void PrintFillFormat(System::String pptFilePath)
{
    System::SharedPtr<System::IO::FileStream> stream = System::MakeObject<System::IO::FileStream>(pptFilePath, System::IO::FileMode::Open, System::IO::FileAccess::Read, System::IO::FileShare::ReadWrite);
    System::SharedPtr<Aspose::Slides::Presentation> presentation = System::MakeObject<Aspose::Slides::Presentation>(stream);
    System::SharedPtr<ISlideCollection> slides = presentation->get_Slides();
    for (int slideIdx = 0; slideIdx < slides->get_Count(); slideIdx++)
    {
        System::SharedPtr<Aspose::Slides::ISlide> slide = slides->idx_get(slideIdx);
        System::SharedPtr<IShapeCollection> shapes = slide->get_Shapes();
        for (int i = 0, n = shapes->get_Count(); i < n; i++)
        {
            System::SharedPtr<IShape> shape = shapes->idx_get(i);
            System::SharedPtr<IFillFormatEffectiveData> fillFormat = shape->get_FillFormat()->GetEffective();
            Aspose::Slides::FillType fillType = fillFormat->get_FillType();
            if (fillType == Aspose::Slides::FillType::Solid) {
                System::Drawing::Color color = fillFormat->get_SolidFillColor();
                System::Console::WriteLine(u"color:{0}", color);
            }
        }
    }
}
  • Code console output:“color:Color [A=255, R=175, G=171, B=171]”,The right transparency is A=0

ppt file:fillformat.zip (27.7 KB)

@101ppt,
Thank you for contacting support. I am working on the issue and will get back to you as soon as possible.

@101ppt,
I reproduced the problem with retrieving the fill color value from the shape.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESCPP-3698

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@101ppt,
Our developers have investigated the case. PowerPoint can’t handle this presentation correctly. shape_settings.png (76.4 KB). As you can see, the Transparency value is set to 0%, which means complete opacity. However, PowerPoint displays the background of the shape as transparent. It should also be noted that changing the Transparency and Color values of this shape has no effect on its display.

This is not a bug in Aspose.Slides. It is not a transparency issue but it is a document issue. Examining the document showed that the shape is missing the a:prstGeom tag.