Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / Advanced / ColorPalette.cs / 1305376 / ColorPalette.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- 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
- TargetException.cs
- Identity.cs
- OleDbPropertySetGuid.cs
- ClientRuntimeConfig.cs
- FilteredSchemaElementLookUpTable.cs
- TypeHelpers.cs
- EmptyQuery.cs
- SafePEFileHandle.cs
- _AutoWebProxyScriptHelper.cs
- TextEditorTables.cs
- recordstate.cs
- Currency.cs
- SqlParameterCollection.cs
- COM2Properties.cs
- Int32.cs
- TextTreeInsertUndoUnit.cs
- SecureEnvironment.cs
- TypeLibConverter.cs
- EntityWrapperFactory.cs
- RangeEnumerable.cs
- CategoryNameCollection.cs
- EndOfStreamException.cs
- PartDesigner.cs
- LocatorGroup.cs
- RolePrincipal.cs
- DataGridViewRowPostPaintEventArgs.cs
- X509Certificate.cs
- BinaryFormatter.cs
- Location.cs
- CommonBehaviorsSection.cs
- ProviderConnectionPointCollection.cs
- CharacterMetrics.cs
- InkSerializer.cs
- XmlNodeChangedEventManager.cs
- DbProviderFactoriesConfigurationHandler.cs
- ApplicationBuildProvider.cs
- JpegBitmapDecoder.cs
- SelectionProviderWrapper.cs
- WebPartMenuStyle.cs
- MethodToken.cs
- Fault.cs
- ErrorHandler.cs
- PointConverter.cs
- MimeTypeMapper.cs
- HttpFileCollectionBase.cs
- ArraySegment.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- OrderPreservingPipeliningMergeHelper.cs
- TreeBuilderBamlTranslator.cs
- SerializerDescriptor.cs
- ObjectStateManagerMetadata.cs
- ToggleButton.cs
- BackgroundWorker.cs
- ScopelessEnumAttribute.cs
- PropertyDescriptor.cs
- DataGridState.cs
- UnsafeMethods.cs
- FlowLayoutPanel.cs
- InternalTypeHelper.cs
- TransactionException.cs
- DiscoveryReference.cs
- Condition.cs
- EmissiveMaterial.cs
- SafeEventLogReadHandle.cs
- ElementMarkupObject.cs
- TransformerConfigurationWizardBase.cs
- BamlLocalizabilityResolver.cs
- ToolStripScrollButton.cs
- RunWorkerCompletedEventArgs.cs
- CodePrimitiveExpression.cs
- AuthenticationModeHelper.cs
- CompModSwitches.cs
- HTMLTextWriter.cs
- TypedAsyncResult.cs
- SpnEndpointIdentity.cs
- RefType.cs
- FlagsAttribute.cs
- DefinitionBase.cs
- PriorityRange.cs
- CodeAccessPermission.cs
- HtmlControl.cs
- SafeProcessHandle.cs
- ValueTypeFixupInfo.cs
- PeerResolverBindingElement.cs
- OutputCacheSection.cs
- ReaderWriterLockWrapper.cs
- PointAnimationClockResource.cs
- ConstNode.cs
- ChooseAction.cs
- TargetControlTypeCache.cs
- VoiceChangeEventArgs.cs
- RedirectionProxy.cs
- CollectionViewProxy.cs
- assertwrapper.cs
- cryptoapiTransform.cs
- StringUtil.cs
- DocumentSequenceHighlightLayer.cs
- WorkerRequest.cs
- DataGridItem.cs
- EmbeddedMailObject.cs