Skip to main content
Language

From Resources

PhotoEditor SDK supports adding custom overlays from the resources. In this example, we add a custom "Grain" overlay.

WARNING: Be sure to put the drawables for the overlays in the res/drawable-nodpi folder. Otherwise, they will be scaled by the Android system.

Load overlay from resources#

Here, we create an OverlayAsset, providing it a unique id, the resource drawable, blend mode, and intensity.

Add overlay to AssetConfig#

To use the overlay, it must first be available in the SDK's backend. This is done by adding the overlay to the AssetConfig.

Configure UiConfigOverlay#

Here, we configure UiConfigOverlay and add a custom OverlayItem to the overlayList. Note how the OverlayItem uses the same id as the OverlayAsset. We also provide a name and a thumbnail ImageSource for the overlay.