Represents a LEADTOOLS PictureBox control for displaying an image.
[DefaultEventAttribute("FrameChanged")][DockingAttribute(System.Windows.Forms.DockingBehavior)][DefaultPropertyAttribute("Image")]public class RasterPictureBox : System.Windows.Forms.Control
<DefaultEventAttribute("FrameChanged"),DockingAttribute(System.Windows.Forms.DockingBehavior),DefaultPropertyAttribute("Image")>Public Class RasterPictureBoxInherits System.Windows.Forms.Control
public [DefaultEventAttribute(L"FrameChanged"),DockingAttribute(System::Windows::Forms::DockingBehavior),DefaultPropertyAttribute(L"Image")]ref class RasterPictureBox : System::Windows::Forms::Control
The RasterPictureBox is used to display graphics from a bitmap, metafile, icon, JPEG, GIF or PNG (or any other image file format supported by LEADTOOLS) file.
Set the Image property to an RasterImage object to be displayed.
The RasterPictureBox control can automatically animate Multi-Page file formats.
using Leadtools;using Leadtools.Controls;using Leadtools.Codecs;using Leadtools.Drawing;using LeadtoolsExamples.Common;public void RasterPictureBox_RasterPictureBox(){MyForm1 form = new MyForm1();form.ShowDialog();}class MyForm1 : Form{private RasterPictureBox pictureBoxInstance;public MyForm1(){// Create the raster PictureBoxpictureBoxInstance = new RasterPictureBox();pictureBoxInstance.Dock = DockStyle.Fill;pictureBoxInstance.BorderStyle = BorderStyle.FixedSingle;pictureBoxInstance.UseDpi = false;// Set the paint propertiesRasterPaintProperties paintProperties = new RasterPaintProperties();paintProperties.PaintDisplayMode = RasterPaintDisplayModeFlags.Bicubic;paintProperties.PaintEngine = RasterPaintEngine.GdiPlus;paintProperties.UsePaintPalette = true;pictureBoxInstance.PaintProperties = paintProperties;this.Controls.Add(pictureBoxInstance);pictureBoxInstance.BringToFront();// load an image into the viewerusing (RasterCodecs codecs = new RasterCodecs())pictureBoxInstance.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "eye.gif"));Text = string.Format("Size mode = {0}, double click to change", pictureBoxInstance.SizeMode);pictureBoxInstance.DoubleClick += new EventHandler(pictureBoxInstance_DoubleClick);}void pictureBoxInstance_DoubleClick(object sender, EventArgs e){switch (pictureBoxInstance.SizeMode){case RasterPictureBoxSizeMode.Normal:pictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.StretchImage;break;case RasterPictureBoxSizeMode.StretchImage:pictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.Fit;break;case RasterPictureBoxSizeMode.Fit:pictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.AutoSize;break;case RasterPictureBoxSizeMode.AutoSize:pictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.CenterImage;break;case RasterPictureBoxSizeMode.CenterImage:pictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.Normal;break;}Text = string.Format("Size mode = {0}, double click to change", pictureBoxInstance.SizeMode);base.OnDoubleClick(e);}}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
Imports LeadtoolsImports Leadtools.ControlsImports Leadtools.CodecsImports Leadtools.Drawing<TestMethod>Public Sub RasterPictureBox_RasterPictureBox()Dim form As MyForm1 = New MyForm1()form.ShowDialog()End SubPrivate Class MyForm1 : Inherits FormPrivate pictureBoxInstance As RasterPictureBoxPublic Sub New()' Create the raster PictureBoxpictureBoxInstance = New RasterPictureBox()pictureBoxInstance.Dock = DockStyle.FillpictureBoxInstance.BorderStyle = BorderStyle.FixedSinglepictureBoxInstance.UseDpi = False' Set the paint propertiesDim paintProperties As RasterPaintProperties = New RasterPaintProperties()paintProperties.PaintDisplayMode = RasterPaintDisplayModeFlags.BicubicpaintProperties.PaintEngine = RasterPaintEngine.GdiPluspaintProperties.UsePaintPalette = TruepictureBoxInstance.PaintProperties = paintPropertiesMe.Controls.Add(pictureBoxInstance)pictureBoxInstance.BringToFront()' load an image into the viewerUsing codecs As RasterCodecs = New RasterCodecs()pictureBoxInstance.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "eye.gif"))End UsingText = String.Format("Size mode = {0}, double click to change", pictureBoxInstance.SizeMode)AddHandler pictureBoxInstance.DoubleClick, AddressOf pictureBoxInstance_DoubleClickEnd SubPrivate Sub pictureBoxInstance_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)Select Case pictureBoxInstance.SizeModeCase RasterPictureBoxSizeMode.NormalpictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.StretchImageCase RasterPictureBoxSizeMode.StretchImagepictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.FitCase RasterPictureBoxSizeMode.FitpictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.AutoSizeCase RasterPictureBoxSizeMode.AutoSizepictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.CenterImageCase RasterPictureBoxSizeMode.CenterImagepictureBoxInstance.SizeMode = RasterPictureBoxSizeMode.NormalEnd SelectText = String.Format("Size mode = {0}, double click to change", pictureBoxInstance.SizeMode)MyBase.OnDoubleClick(e)End SubEnd ClassPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class


|   | 
                            Products |
                            Support |
                            Feedback: RasterPictureBox Class - Leadtools.Controls  |
                            Introduction |
                            Help Version 19.0.2017.6.20
                         | 






Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.