Image's drop shadow properties.
public ControlDropShadowOptions ImageDropShadow { get; set; }
public:
property ControlDropShadowOptions^ ImageDropShadow
{
ControlDropShadowOptions^ get()
void set(ControlDropShadowOptions^ value)
}
The images drop shadow properties. Default value is the return value from ControlDropShadowOptions.CreateDefault (invisible drop shadow).
For more information, refer to Image Viewer Appearance.
Run the demo, click the Example and the code will trigger drop shadow between view, image and none.
Start with the ImageViewer example, remove all the code inside the example function (search for the "// TODO: add example code here" comment) and insert the following code:
using Leadtools;
using Leadtools.Controls;
using Leadtools.Codecs;
using Leadtools.Drawing;
using Leadtools.ImageProcessing;
using Leadtools.ImageProcessing.Color;
public ImageViewerForm _form = new ImageViewerForm();
public ComboBox comboBox = new ComboBox();
public ImageViewer _imageViewer;
public void ImageViewerDropShadowExample()
{
// Get the Form's ImageViewer control
_imageViewer = _form.ImageViewer;
// Clear all the images already the viewer
_imageViewer.Items.Clear();
// Use vertical view layout
_imageViewer.ViewLayout = new ImageViewerVerticalViewLayout();
// Make sure the item size is larger than the image size (thumbnails mode)
_imageViewer.ItemSize = LeadSize.Create(200, 200);
// Add 4 items to the viewer
using (var codecs = new RasterCodecs())
{
for (var page = 1; page <= 4; page++)
{
var item = new ImageViewerItem();
var fileName = Path.Combine(LEAD_VARS.ImagesDir, string.Format("ocr{0}.tif", page));
// Create a thumbnail from the image
using (var image = codecs.Load(fileName, page))
{
item.Image = image.CreateThumbnail(180, 180, 24, RasterViewPerspective.TopLeft, RasterSizeFlags.Resample);
}
_imageViewer.Items.Add(item);
}
}
// Add view margin and item padding. The drop shadow are rendered inside these paddings
_imageViewer.ViewMargin = new Padding(20);
_imageViewer.ItemPadding = new Padding(20);
// Add a border style for both
_imageViewer.ImageBorderThickness = 1;
_imageViewer.ViewBorderThickness = 1;
// Add a combo box control to show the drop shadow modes
comboBox.Top = _form.ClientRectangle.Top;
_form.Controls.Add(comboBox);
// Add an entry for each drop shadow mode to the combo box
comboBox.Items.Add("No drop shadow");
comboBox.Items.Add("View drop shadow");
comboBox.Items.Add("Image drop shadow");
comboBox.BringToFront();
// User selects a drop shadow from the comboBox
comboBox.SelectedIndexChanged += ComboBox_SelectedIndexChanged;
}
private void ComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
ComboBox comboBox = sender as ComboBox;
ControlDropShadowOptions dropShadowOptions;
// Clear previous view drop shadow
dropShadowOptions = _imageViewer.ViewDropShadow;
dropShadowOptions.IsVisible = false;
_imageViewer.ViewDropShadow = dropShadowOptions;
// Clear previous image drop shadow
dropShadowOptions = _imageViewer.ImageDropShadow;
dropShadowOptions.IsVisible = false;
_imageViewer.ImageDropShadow = dropShadowOptions;
switch (comboBox.SelectedItem.ToString())
{
case "View drop shadow":
dropShadowOptions = _imageViewer.ViewDropShadow;
dropShadowOptions.Blur = 0;
dropShadowOptions.OffsetX = 10;
dropShadowOptions.OffsetY = 10;
dropShadowOptions.IsVisible = true;
_imageViewer.ViewDropShadow = dropShadowOptions;
break;
case "Image drop shadow":
dropShadowOptions = _imageViewer.ImageDropShadow;
dropShadowOptions.IsVisible = true;
_imageViewer.ImageDropShadow = dropShadowOptions;
break;
case "No drop shadow":
default:
break;
}
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document