Introduction
Compare a solid fill, a two-color gradient and an outer shadow in one presentation using Aspose.Slides FOSS for C++. The three shapes share the same size and base color, making the effect of each setting visible.

Download the complete example · Open the comparison deck
Quick Start
Tested 8 November 2026: Windows x64, MSVC v142, C++20, and v26.9.0 source commit 31fb2cf.
Extract the example into an empty directory. This example builds the library from its pinned v26.9.0 source commit using CMake and Git. The tested Windows commands require Visual Studio 2019 C++ Build Tools with the v142 toolset:
cmake -S . -B build -G "Visual Studio 16 2019" -A x64 -T v142
cmake --build build --config Release
.\build\Release\example.exe
The source-build configuration is:
cmake_minimum_required(VERSION 3.20)
project(SlidesExample LANGUAGES CXX)
include(FetchContent)
FetchContent_Declare(aspose_slides_foss
GIT_REPOSITORY https://github.com/aspose-slides-foss/Aspose.Slides-FOSS-for-Cpp.git
GIT_TAG 31fb2cf21ec69a05afbf4ce9fac4efd87dfa006f)
FetchContent_MakeAvailable(aspose_slides_foss)
add_executable(example main.cpp)
target_compile_features(example PRIVATE cxx_std_20)
target_link_libraries(example PRIVATE AsposeSlidesFoss::AsposeSlidesFoss)
Build the comparison
Save this complete program as main.cpp. The project download includes the complete CMakeLists.txt, including the pinned dependency and executable target.
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
#include <Aspose/Slides/Foss/auto_shape.h>
#include <Aspose/Slides/Foss/drawing/color.h>
#include <Aspose/Slides/Foss/export/save_format.h>
#include <Aspose/Slides/Foss/fill_format.h>
#include <Aspose/Slides/Foss/fill_type.h>
#include <Aspose/Slides/Foss/paragraph.h>
#include <Aspose/Slides/Foss/paragraph_collection.h>
#include <Aspose/Slides/Foss/portion.h>
#include <Aspose/Slides/Foss/portion_collection.h>
#include <Aspose/Slides/Foss/portion_format.h>
#include <Aspose/Slides/Foss/presentation.h>
#include <Aspose/Slides/Foss/shape_collection.h>
#include <Aspose/Slides/Foss/shape_type.h>
#include <Aspose/Slides/Foss/slide.h>
#include <Aspose/Slides/Foss/slide_collection.h>
#include <Aspose/Slides/Foss/text_frame.h>
using namespace Aspose::Slides::Foss;
using Aspose::Slides::Foss::Drawing::Color;
#include <Aspose/Slides/Foss/gradient_format.h>
#include <Aspose/Slides/Foss/gradient_shape.h>
#include <Aspose/Slides/Foss/effect_format.h>
#include <Aspose/Slides/Foss/effects/outer_shadow.h>
int main() {
Presentation presentation;
const std::vector<std::string> labels{"Solid", "Gradient", "Outer shadow"};
for (std::size_t i = 0; i < labels.size(); ++i) {
auto& shape = presentation.slides()[0].shapes().add_auto_shape(ShapeType::RECTANGLE, 30 + i * 230, 160, 200, 180);
shape.set_name(labels[i]);
shape.text_frame()->set_text(labels[i]);
shape.text_frame()->paragraphs()[0].portions()[0].portion_format().set_font_height(22);
shape.fill_format().set_fill_type(FillType::SOLID);
shape.fill_format().solid_fill_color().set_color(Color::from_argb(255, 22, 78, 99));
if (labels[i] == "Gradient") {
shape.fill_format().set_fill_type(FillType::GRADIENT);
auto& gradient = shape.fill_format().gradient_format();
gradient.set_gradient_shape(GradientShape::LINEAR);
gradient.set_linear_gradient_angle(90);
gradient.gradient_stops().add(0.0f, Color::from_argb(255, 22, 78, 99));
gradient.gradient_stops().add(1.0f, Color::from_argb(255, 15, 118, 110));
} else if (labels[i] == "Outer shadow") {
shape.effect_format().enable_outer_shadow_effect();
auto* shadow = shape.effect_format().outer_shadow_effect();
shadow->set_blur_radius(6);
shadow->set_distance(6);
shadow->set_direction(45);
shadow->shadow_color().set_color(Color::from_argb(100, 0, 0, 0));
}
}
presentation.save("effects-comparison.pptx", SaveFormat::PPTX);
std::cout << "Created effects-comparison.pptx\n";
}
Read the three results
The solid shape uses RGB color #164E63. It gives a baseline for the other two shapes and a consistent background behind the label.
The gradient runs from #164E63 to #0F766E. Its stop positions are 0 and 1, the beginning and end of the fill. The 90-degree linear angle produces the top-to-bottom transition shown in the screenshot. Use a modest difference between colors when text must remain readable across the entire shape.
The outer shadow keeps the solid fill and adds a six-point blur and six-point distance at 45 degrees. The shadow color uses alpha 100 on the 0–255 scale, making it partly transparent. The saved shape contains those parameters, and the shadow is visible below and to the right in PowerPoint.
Limits and troubleshooting
The screenshot was exported from this generated file with Microsoft PowerPoint 16.0, build 12527. Viewer rendering can differ, particularly for transparency and effects. Inspect the output in the application your recipients use.
If the gradient appears unchanged, confirm you selected gradient fill before adding stops. If the shadow is absent, confirm the effect was enabled before setting its properties. For a darker or lighter result, change the color or alpha explicitly; changing a text color does not change the shape fill.
This comparison covers these three settings. It does not promise that every glow, bevel, material or camera combination behaves identically. Start with one effect at a time when adapting the example.