- Aurigma Graphics Mill 5.5 for .NET
- Introduction
- What's New?
- Overview of Features
- Getting Started
- Programming with Graphics Mill for .NET
- File Formats
- Graphics Mill for .NET Add-ons
- Class Library Reference
- Aurigma.GraphicsMill Namespace
- AbortedException Class
- AdvancedPsdLibraryModule Class
- AviProcessorLibraryModule Class
- Bitmap Class
- BitmapChange Enumeration
- BitmapChangedEventArgs Class
- BitmapChangedEventHandler Delegate
- BitmapChangingEventArgs Class
- BitmapChangingEventHandler Delegate
- BitmapData Class
- BitmapEmptyException Class
- BitmapLockedException Class
- BitmapSavingEventArgs Class
- BitmapSavingEventHandler Delegate
- BitmapStatisticsProvider Class
- ChannelsProvider Class
- CMAdobeModuleLoadException Class
- CMException Class
- CMInappropriateProfileException Class
- CMOpenProfileException Class
- CMTransformException Class
- CmykColor Class
- Color Class
- ColorAdjustmentProvider Class
- ColorChannel Enumeration
- ColorManagementProvider Class
- ColorPalette Class
- ColorPaletteEmptyException Class
- ColorPaletteType Enumeration
- ColorProfile Class
- ColorProfileClass Enumeration
- ColorSpace Enumeration
- ErrorEventArgs Class
- Exception Class
- GlobalSettings Class
- GraphicsMillLibraryModule Class
- GrayScaleColor Class
- Histogram Class
- HistogramMode Enumeration
- ILockable Interface
- IPixelFormatSupport Interface
- IStateNavigable Interface
- ISyncEvents Interface
- ISyncHandler Interface
- IUnitConverter Interface
- LibraryModuleAbstract Class
- LockableObject Class
- MediaProcessorLibraryModule Class
- MessageLoopNotPresentedException Class
- ObjectEmptyException Class
- ObjectLockedException Class
- ObjectNotOpenedException Class
- OperationNotCompletedException Class
- PixelFormat Enumeration
- PixelFormatUtils Class
- ProgressEventArgs Class
- ProgressEventHandler Delegate
- Rational Structure
- RgbColor Class
- StateRestoringEventArgs Class
- StateRestoringEventHandler Delegate
- StopEventHandler Delegate
- StreamWrapper Class
- SyncHandler Class
- SynchronizationMode Enumeration
- TimeoutException Class
- TransformsProvider Class
- TrialPeriodTimeException Class
- UnexpectedException Class
- Unit Enumeration
- UnitConverter Class
- UnitConverterHandler Class
- UnitConverterObject Class
- UnsignedRational Structure
- UnsupportedPixelFormatException Class
- Win32Exception Class
- ZipCompressor Class
- Aurigma.GraphicsMill.AjaxControls Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace
- Aurigma.GraphicsMill.Codecs Namespace
- Aurigma.GraphicsMill.Drawing Namespace
- Aurigma.GraphicsMill.Licensing Namespace
- Aurigma.GraphicsMill.Transforms Namespace
- Aurigma.GraphicsMill.WebControls Namespace
- Aurigma.GraphicsMill.WinControls Namespace
- GraphicsMill Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.Math Namespace (Client Class Library)
- Aurigma.GraphicsMill.AjaxControls.VectorObjects.RedoUndo Namespace (Client Class Library)
- Aurigma.GraphicsMill Namespace
- Samples
- Licensing
- Copyright Notices
ColorPalette Class
This class represents palette, i.e. an array of color values. Used in indexed bitmaps.
Namespace:
Aurigma.GraphicsMill
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Syntax
<DefaultMemberAttribute("Item")> _
Public Class ColorPalette _
Inherits LockableObject _
Implements ICloneable, IEnumerable
[DefaultMemberAttribute("Item")]
public class ColorPalette : LockableObject, ICloneable, IEnumerable
Remarks
Color palettes are used in indexed bitmaps to store colors. Each pixel of the indexed bitmap is an index you should pass to Item[Int32] to get an actual color this pixel represents. These indices should not exceed total number of palette entries which you can get through Count property.
You can create a predefined palette, or create an empty one, and then import colors from array using Import(RgbColor[]) method. You can also export the palette into array using Export() method.
Since the palettes never store more than 256 entries, only few of 16 millions 24-bit RGB colors are available in the palette. That's why if you need change a color of some pixel, you cannot pass arbitrary color. You should find nearest color in the palette and pass its index instead. To convert the color into index in this palette, you can use FindNearestIndex(RgbColor) method. Note, this method works quite slow, that's why you should cache nearest index if possible.
Graphics Mill for .NET fully supports palette entries with alpha channels. It means that if you put semi-transparent entries, they will be drawn and processed properly. However not all file formats support alpha channel in palettes. In particular GIF format can have only one transparent entry (so-called key color). That's why in such cases only first entry with zero alpha channel will be treated as transparent. So if you need to set transparent index of GIF file, you should use SetColorKey(Int32) method instead of modifying alpha channel of the entry.
Examples
Dim palette As New Aurigma.GraphicsMill.ColorPalette( _
Aurigma.GraphicsMill.ColorPaletteType.WebSafe, True)
Aurigma.GraphicsMill.ColorPalette palette = new Aurigma.GraphicsMill.ColorPalette(
Aurigma.GraphicsMill.ColorPaletteType.WebSafe, true);
Inheritance Hierarchy
Thread Safety
Static members of this type are safe for multi-threaded operations. Instance members of this type are safe for multi-threaded operations.Object Model




