Form

GPALPicture

Everything on Settings Every Control Takes applies here too. GPAL.Picture builds one. WithImage takes a GPALFile or a System.Drawing.Image, and WithSizeMode says how the image fills the control: Normal, StretchImage, AutoSize, CenterImage or Zoom, where Zoom fits it without distorting it. Click and DoubleClick are wired the usual way, so a picture works as a large button. GPAL.PictureFor(file) is the shorthand.

NOTE

WithImage reads the pixels out of the file and lets the file go, rather than leaving it open the way Image.FromFile does. A workflow can display a file and then write it again, which is what a run that captures the same screenshot on every pass needs.

Examples

GPAL Fluent: High-level fluent C# API

//A path converts to a GPALFile on its own, so the cast is only there to pick the GPALFile overload over the Image one.

GPALPicture logo = (GPALPicture)GPAL.Picture

.WithImage((GPALFile)@"c:sdilogo.png")

.WithSizeMode(PictureBoxSizeMode.Zoom)

.WithHeight(120)

.WithCallback<EventHandler>(ShowAbout)

.WithName("logo");

💬 Ask GPAL