Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / CommonUI / System / Drawing / Advanced / ColorPalette.cs / 1 / ColorPalette.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /*************************************************************************\ * * Copyright (c) 1998-1999, Microsoft Corp. All Rights Reserved. * * Module Name: * * ColorPalette.cs * * Abstract: * * Native GDI+ Color Palette structure. * * Revision History: * * 9/22/1999 [....] * Created it. * \**************************************************************************/ namespace System.Drawing.Imaging { using System.Runtime.InteropServices; using System.Diagnostics; using System; using System.Drawing; ////// /// Defines an array of colors that make up a /// color palette. /// public sealed class ColorPalette { /// Note (From VSWhidbey#444618): We don't provide a public constructor for ColorPalette because if we allow /// arbitrary creation of color palettes you could in theroy not only change the color entries, but the size /// of the palette and that is not valid for an image (meaning you cannot change the palette size for an image). /// ColorPalettes are only valid for "indexed" images like GIFs. private int flags; private Color[] entries; ////// /// public int Flags { get { return flags; } } ////// Specifies how to interpret the color /// information in the array of colors. /// ////// /// Specifies an array of public Color[] Entries { get { return entries; } } internal ColorPalette(int count) { entries = new Color[count]; } internal ColorPalette() { entries = new Color[1]; } internal void ConvertFromMemory(IntPtr memory) { // Memory layout is: // UINT Flags // UINT Count // ARGB Entries[size] flags = Marshal.ReadInt32(memory); int size; size = Marshal.ReadInt32((IntPtr)((long)memory + 4)); // Marshal.SizeOf(size.GetType()) entries = new Color[size]; for (int i=0; iobjects. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HttpModule.cs
- RunClient.cs
- Attributes.cs
- BooleanSwitch.cs
- ScrollChrome.cs
- DataGridViewDataErrorEventArgs.cs
- UserPreferenceChangedEventArgs.cs
- _NTAuthentication.cs
- ButtonColumn.cs
- UInt64.cs
- ContextMenu.cs
- WebPartZoneBase.cs
- SymLanguageType.cs
- XPathNode.cs
- Utility.cs
- ButtonStandardAdapter.cs
- ConfigXmlWhitespace.cs
- XmlWellformedWriter.cs
- BindingEditor.xaml.cs
- RegexParser.cs
- SettingsPropertyNotFoundException.cs
- Properties.cs
- DocumentEventArgs.cs
- LoginName.cs
- HandleCollector.cs
- ValidationErrorEventArgs.cs
- PatternMatcher.cs
- OleDbErrorCollection.cs
- ValidatingReaderNodeData.cs
- ComEventsInfo.cs
- LocalFileSettingsProvider.cs
- SizeIndependentAnimationStorage.cs
- ServiceErrorHandler.cs
- ScriptingJsonSerializationSection.cs
- Utils.cs
- AttachInfo.cs
- PrintDocument.cs
- StrongNameMembershipCondition.cs
- PartitionerQueryOperator.cs
- FontInfo.cs
- VariableAction.cs
- CultureInfoConverter.cs
- Merger.cs
- wmiprovider.cs
- ComPlusServiceLoader.cs
- _NativeSSPI.cs
- XPathNavigatorKeyComparer.cs
- DataGridTablesFactory.cs
- TextProperties.cs
- GradientStopCollection.cs
- EnterpriseServicesHelper.cs
- RawStylusActions.cs
- TextTreeTextBlock.cs
- ProfileSettingsCollection.cs
- ReliabilityContractAttribute.cs
- FormViewRow.cs
- XmlLanguageConverter.cs
- ToolStripContainerDesigner.cs
- NumberAction.cs
- ReservationNotFoundException.cs
- TitleStyle.cs
- PhysicalFontFamily.cs
- CommandHelpers.cs
- ConfigXmlAttribute.cs
- BidPrivateBase.cs
- ObjectSet.cs
- EDesignUtil.cs
- FieldBuilder.cs
- TextLineResult.cs
- MessageQueuePermissionAttribute.cs
- SqlWriter.cs
- HttpRuntime.cs
- PrimarySelectionGlyph.cs
- IsolatedStoragePermission.cs
- Base64Encoder.cs
- XmlSerializerSection.cs
- EntityDesignerDataSourceView.cs
- WebPageTraceListener.cs
- BufferBuilder.cs
- MouseGesture.cs
- Geometry3D.cs
- HotSpotCollection.cs
- RtfFormatStack.cs
- LayoutTable.cs
- CrossAppDomainChannel.cs
- HttpCacheVary.cs
- SetterBaseCollection.cs
- _BasicClient.cs
- safelink.cs
- CodeComment.cs
- ToolStripMenuItemDesigner.cs
- EntityProxyTypeInfo.cs
- DesignerHost.cs
- CheckoutException.cs
- VoiceChangeEventArgs.cs
- DataListItemCollection.cs
- MsdtcClusterUtils.cs
- ManagementQuery.cs
- RuntimeIdentifierPropertyAttribute.cs
- TargetParameterCountException.cs