Class RadBarcodeElement
Represents a barcode element that can display various types of barcodes using different symbologies.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadBarcodeElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Constructors
RadBarcodeElement()
Fields
previousDpi
Stores the previous DPI scale factor for comparison during DPI scale changes.
Declaration
protected SizeF previousDpi
Field Value
|
System.Drawing.SizeF
|
Properties
ElementFactory
Gets or sets the element factory that is used to create the elements of the displayed barcode.
Declaration
public IElementFactory ElementFactory { get; set; }
Property Value
|
IElementFactory
|
Symbology
Gets or sets the symbology that will be used to convert the value of this element into a visual barcode representation.
Declaration
public ISymbology Symbology { get; set; }
Property Value
|
ISymbology
|
Value
Gets or sets the value that will be converted into a barcode.
Declaration
public string Value { get; set; }
Property Value
|
System.String
|
Methods
ArrangeOverride(SizeF)
Arranges the barcode elements within the specified final size.
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
|
System.Drawing.SizeF
finalSize
The final size that the element should use to arrange itself and its children. |
Returns
|
System.Drawing.SizeF
The actual size used. |
Overrides
DpiScaleChanged(SizeF)
Called when the DPI scale factor changes.
Declaration
public override void DpiScaleChanged(SizeF scaleFactor)
Parameters
|
System.Drawing.SizeF
scaleFactor
The new DPI scale factor. |
Overrides
ExportToImage()
Exports the barcode with the current dimentions of the control.
Declaration
public Image ExportToImage()
Returns
|
System.Drawing.Image
An image of the barcode. |
ExportToImage(Int32, Int32)
Layouts the barcode using the provided dimentions and exports it to an image.
Declaration
public Image ExportToImage(int width, int height)
Parameters
|
System.Int32
width
The width of the exported image. |
|
System.Int32
height
The height of the exported image. |
Returns
|
System.Drawing.Image
An image of the barcode. |
ExportToImage(Stream, Size)
Layouts the barcode using the provided size and exports it to the specified stream.
Declaration
public void ExportToImage(Stream stream, Size size)
Parameters
|
System.IO.Stream
stream
The stream to export the barcode to. |
|
System.Drawing.Size
size
The size of the barcode. |
ExportToImage(Stream, Size, ImageFormat)
Layouts the barcode using the provided size and exports it to the specified stream in the specified image format.
Declaration
public void ExportToImage(Stream stream, Size size, ImageFormat imageFormat)
Parameters
|
System.IO.Stream
stream
The stream to export the barcode to. |
|
System.Drawing.Size
size
The size of the barcode. |
|
System.Drawing.Imaging.ImageFormat
imageFormat
The format of the exported image. |
ExportToImage(String, Size)
Layouts the barcode using the provided size and exports it to the specified file location.
Declaration
public void ExportToImage(string filePath, Size size)
Parameters
|
System.String
filePath
The location of the file where to export the barcode. |
|
System.Drawing.Size
size
The size of the barcode. |
ExportToImage(String, Size, ImageFormat)
Layouts the barcode using the provided size and exports it to the specified file location in the specified image format.
Declaration
public void ExportToImage(string filePath, Size size, ImageFormat imageFormat)
Parameters
|
System.String
filePath
The location of the file where to export the barcode. |
|
System.Drawing.Size
size
The size of the barcode. |
|
System.Drawing.Imaging.ImageFormat
imageFormat
The format of the exported image. |
InitializeFields()
Initializes the default field values for the RadBarcodeElement.
Declaration
protected override void InitializeFields()
Overrides
MeasureOverride(SizeF)
Measures the desired size of the barcode element.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
|
System.Drawing.SizeF
availableSize
The available size that the element can use. |
Returns
|
System.Drawing.SizeF
The desired size of the element. |
Overrides
MeasureSymbology(SizeF)
Measures the size required by the barcode symbology.
Declaration
protected virtual SizeF MeasureSymbology(SizeF availableSize)
Parameters
|
System.Drawing.SizeF
availableSize
The available size for the symbology. |
Returns
|
System.Drawing.SizeF
The size required by the symbology. |
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value changes.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
|
RadPropertyChangedEventArgs
e
The property change event arguments. |
Overrides
OnSymbologyChanged(EventArgs)
Raises the SymbologyChanged event.
Declaration
protected virtual void OnSymbologyChanged(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs instance containing the event data. |
OnSymbologyChanging(BarcodeSymbologyChangingEventArgs)
Raises the SymbologyChanging event.
Declaration
protected virtual void OnSymbologyChanging(BarcodeSymbologyChangingEventArgs e)
Parameters
|
BarcodeSymbologyChangingEventArgs
e
The BarcodeSymbologyChangingEventArgs instance containing the event data. |
OnSymbologyPropertyChanged(Object, PropertyChangedEventArgs)
Called when a property of the symbology changes. Suitable for performing necessary updates based on the changes.
Declaration
protected virtual void OnSymbologyPropertyChanged(object sender, PropertyChangedEventArgs e)
Parameters
|
System.Object
sender
|
|
System.ComponentModel.PropertyChangedEventArgs
e
|
OnValueChanged(EventArgs)
Raises the ValueChanged event.
Declaration
protected virtual void OnValueChanged(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs instance containing the event data. |
OnValueChanging(BarcodeValueChangingEventArgs)
Raises the ValueChanging event.
Declaration
protected virtual void OnValueChanging(BarcodeValueChangingEventArgs e)
Parameters
|
BarcodeValueChangingEventArgs
e
The BarcodeValueChangingEventArgs instance containing the event data. |
PaintElement(IGraphics, Single, SizeF)
Paints the barcode element using the specified graphics context.
Declaration
protected override void PaintElement(IGraphics graphics, float angle, SizeF scale)
Parameters
|
IGraphics
graphics
The graphics context to paint on. |
|
System.Single
angle
The rotation angle for painting. |
|
System.Drawing.SizeF
scale
The scale factor for painting. |
Overrides
PaintElements(IGraphics, ISymbology, IElementFactory)
Paints the barcode elements using the specified graphics context, symbology, and element factory.
Declaration
protected virtual void PaintElements(IGraphics graphics, ISymbology symbology, IElementFactory elementFactory)
Parameters
|
IGraphics
graphics
The graphics context to paint on. |
|
ISymbology
symbology
The symbology used to render the barcode. |
|
IElementFactory
elementFactory
The factory used to create barcode elements. |
PaintElements(IGraphics, ISymbology, IElementFactory, Size)
Paints the barcode elements using the specified graphics context, symbology, element factory, and size.
Declaration
protected virtual void PaintElements(IGraphics graphics, ISymbology symbology, IElementFactory elementFactory, Size size)
Parameters
|
IGraphics
graphics
The graphics context to paint on. |
|
ISymbology
symbology
The symbology used to render the barcode. |
|
IElementFactory
elementFactory
The factory used to create barcode elements. |
|
System.Drawing.Size
size
The size to use for painting the barcode. |
Update()
Updates the layout and invalidates the barcode.
Declaration
protected virtual void Update()
Events
SymbologyChanged
Occurs after the symbology of the barcode is changed.
Declaration
public event EventHandler SymbologyChanged
Event Type
|
System.EventHandler
|
SymbologyChanging
Occurs before the symbology of the barcode is changed.
Declaration
public event BarcodeSymbologyChangingEventHandler SymbologyChanging
Event Type
|
BarcodeSymbologyChangingEventHandler
|
ValueChanged
Occurs after the value of the barcode is changed.
Declaration
public event EventHandler ValueChanged
Event Type
|
System.EventHandler
|
ValueChanging
Occurs before the value of the barcode is changed.
Declaration
public event BarcodeValueChangingEventHandler ValueChanging
Event Type
|
BarcodeValueChangingEventHandler
|