Represents a LEADTOOLS PictureBox control for displaying an image.
[DockingAttribute(DockingBehavior.Ask)][ToolboxBitmapAttribute()][DefaultPropertyAttribute("Image")]public class RasterPictureBox : System.Windows.Forms.Control, System.ComponentModel.IComponent, System.ComponentModel.ISynchronizeInvoke, System.IDisposable, System.Windows.Forms.IBindableComponent, System.Windows.Forms.IDropTarget, System.Windows.Forms.IWin32Window
<DockingAttribute(DockingBehavior.Ask)><ToolboxBitmapAttribute()><DefaultPropertyAttribute("Image")>Public Class RasterPictureBoxInherits System.Windows.Forms.ControlImplements System.ComponentModel.IComponent, System.ComponentModel.ISynchronizeInvoke, System.IDisposable, System.Windows.Forms.IBindableComponent, System.Windows.Forms.IDropTarget, System.Windows.Forms.IWin32Window
[DockingAttribute(DockingBehavior.Ask)][ToolboxBitmapAttribute()][DefaultPropertyAttribute("Image")]public ref class RasterPictureBox : public System.Windows.Forms.Control, System.ComponentModel.IComponent, System.ComponentModel.ISynchronizeInvoke, System.IDisposable, System.Windows.Forms.IBindableComponent, System.Windows.Forms.IDropTarget, System.Windows.Forms.IWin32Window
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 Leadtools.RasterImage object to be displayed. The RasterPictureBox control can automatically animate Multi-Page file formats.
This example will create an instance of the RasterPictureBox control and add it to a form
Imports Leadtools.WinFormsImports LeadtoolsImports Leadtools.CodecsImports Leadtools.Drawing<TestMethod()> _Public Sub RasterPictureBox_RasterPictureBox()Dim form As MyForm1 = New MyForm1()form.ShowDialog()End SubPrivate Class MyForm1 : Inherits FormPrivate thePictureBox As RasterPictureBoxPublic Sub New()' Create the raster PictureBoxthePictureBox = New RasterPictureBox()thePictureBox.Dock = DockStyle.FillthePictureBox.BorderStyle = BorderStyle.Fixed3DthePictureBox.UseDpi = False' Set the paint propertiesDim p As RasterPaintProperties = New RasterPaintProperties()p.PaintDisplayMode = RasterPaintDisplayModeFlags.Bicubicp.PaintEngine = RasterPaintEngine.GdiPlusp.UsePaintPalette = TruethePictureBox.PaintProperties = pControls.Add(thePictureBox)thePictureBox.BringToFront()' load an image into the viewerDim codecs As RasterCodecs = New RasterCodecs()thePictureBox.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "eye.gif"))codecs.Dispose()Text = String.Format("Size mode = {0}, double click to change", thePictureBox.SizeMode)AddHandler thePictureBox.DoubleClick, AddressOf thePictureBox_DoubleClickEnd SubPrivate Sub thePictureBox_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)Select Case thePictureBox.SizeModeCase RasterPictureBoxSizeMode.NormalthePictureBox.SizeMode = RasterPictureBoxSizeMode.StretchImageCase RasterPictureBoxSizeMode.StretchImagethePictureBox.SizeMode = RasterPictureBoxSizeMode.FitCase RasterPictureBoxSizeMode.FitthePictureBox.SizeMode = RasterPictureBoxSizeMode.AutoSizeCase RasterPictureBoxSizeMode.AutoSizethePictureBox.SizeMode = RasterPictureBoxSizeMode.CenterImageCase RasterPictureBoxSizeMode.CenterImagethePictureBox.SizeMode = RasterPictureBoxSizeMode.NormalEnd SelectText = String.Format("Size mode = {0}, double click to change", thePictureBox.SizeMode)MyBase.OnDoubleClick(e)End SubEnd ClassPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"End Class
using Leadtools.WinForms;using Leadtools;using Leadtools.Codecs;using Leadtools.Drawing;public void RasterPictureBox_RasterPictureBox(){MyForm1 form = new MyForm1();form.ShowDialog();}class MyForm1 : Form{RasterPictureBox thePictureBox;public MyForm1(){// Create the raster PictureBoxthePictureBox = new RasterPictureBox();thePictureBox.Dock = DockStyle.Fill;thePictureBox.BorderStyle = BorderStyle.Fixed3D;thePictureBox.UseDpi = false;// Set the paint propertiesRasterPaintProperties p = new RasterPaintProperties();p.PaintDisplayMode = RasterPaintDisplayModeFlags.Bicubic;p.PaintEngine = RasterPaintEngine.GdiPlus;p.UsePaintPalette = true;thePictureBox.PaintProperties = p;Controls.Add(thePictureBox);thePictureBox.BringToFront();// load an image into the viewerRasterCodecs codecs = new RasterCodecs();thePictureBox.Image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"eye.gif"));codecs.Dispose();Text = string.Format("Size mode = {0}, double click to change", thePictureBox.SizeMode);thePictureBox.DoubleClick += new EventHandler(thePictureBox_DoubleClick);}void thePictureBox_DoubleClick(object sender, EventArgs e){switch (thePictureBox.SizeMode){case RasterPictureBoxSizeMode.Normal:thePictureBox.SizeMode = RasterPictureBoxSizeMode.StretchImage;break;case RasterPictureBoxSizeMode.StretchImage:thePictureBox.SizeMode = RasterPictureBoxSizeMode.Fit;break;case RasterPictureBoxSizeMode.Fit:thePictureBox.SizeMode = RasterPictureBoxSizeMode.AutoSize;break;case RasterPictureBoxSizeMode.AutoSize:thePictureBox.SizeMode = RasterPictureBoxSizeMode.CenterImage;break;case RasterPictureBoxSizeMode.CenterImage:thePictureBox.SizeMode = RasterPictureBoxSizeMode.Normal;break;}Text = string.Format("Size mode = {0}, double click to change", thePictureBox.SizeMode);base.OnDoubleClick(e);}}static class LEAD_VARS{public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";}
|
Products |
Support |
Feedback: RasterPictureBox Class - Leadtools.WinForms |
Introduction |
Help Version 19.0.2017.3.22
|

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.