Back to Devexpress

PictureFill Class

officefileapi-devexpress-dot-docs-dot-presentation-ab541d57.md

latest2.7 KB
Original Source

PictureFill Class

A picture fill that uses an image as the fill pattern.

Namespace : DevExpress.Docs.Presentation

Assembly : DevExpress.Docs.Presentation.v25.2.dll

NuGet Package : DevExpress.Docs.Presentation

Declaration

csharp
public class PictureFill :
    Fill
vb
Public Class PictureFill
    Inherits Fill

The following members return PictureFill objects:

Remarks

The following code snippet uses the PictureFill class to fill a slide background with an image:

csharp
using DevExpress.Docs.Presentation;
using DevExpress.Drawing;
using System.Drawing;

    Slide slide = new Slide(new SlideLayout(layoutType: SlideLayoutType.Blank, name: "slide"));
    string imagePath = "D:\\image.png";
    Stream stream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
    PictureFill fill = new PictureFill(DXImage.FromStream(stream));
    fill.Stretch = true;
    slide.Background = new CustomSlideBackground(fill);
vb
Imports DevExpress.Docs.Presentation
Imports DevExpress.Drawing
Imports System.Drawing
Imports System.IO

    Dim slide As New Slide(New SlideLayout(SlideLayoutType.Blank, "slide"))
    Dim imagePath As String = "D:\image.png"
    Using stream As Stream = New FileStream(imagePath, FileMode.Open, FileAccess.Read)
        Dim fill As New PictureFill(DXImage.FromStream(stream))
        fill.Stretch = True
        slide.Background = New CustomSlideBackground(fill)
    End Using

For more information on how to customize the slide or shape fill, refer to the following help topics:

Implements

ICloneable

Inheritance

Object PresentationObject Fill PictureFill

See Also

PictureFill Members

DevExpress.Docs.Presentation Namespace