Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CommonUI / System / Drawing / Advanced / ColorPalette.cs / 1 / 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. /// // 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
- MULTI_QI.cs
- WinEventWrap.cs
- InvalidComObjectException.cs
- FlowSwitchDesigner.xaml.cs
- ScriptIgnoreAttribute.cs
- PictureBox.cs
- ChannelFactory.cs
- OdbcConnectionFactory.cs
- GenerateHelper.cs
- UidPropertyAttribute.cs
- SvcMapFileLoader.cs
- StdValidatorsAndConverters.cs
- PerspectiveCamera.cs
- ListControlStringCollectionEditor.cs
- WebPartConnectionCollection.cs
- SignerInfo.cs
- Int16AnimationUsingKeyFrames.cs
- ZipIOExtraFieldZip64Element.cs
- ExtendedProtectionPolicyElement.cs
- TagNameToTypeMapper.cs
- CellParaClient.cs
- ImmutableCollection.cs
- ClientTargetSection.cs
- SingleConverter.cs
- WebConfigurationFileMap.cs
- PipelineDeploymentState.cs
- UInt16.cs
- MatchingStyle.cs
- ParentUndoUnit.cs
- FixedPageStructure.cs
- NullableFloatSumAggregationOperator.cs
- LogConverter.cs
- FontWeights.cs
- DbMetaDataCollectionNames.cs
- XmlIlTypeHelper.cs
- DbMetaDataCollectionNames.cs
- ConfigXmlSignificantWhitespace.cs
- SqlGenericUtil.cs
- TraceListeners.cs
- InputLangChangeRequestEvent.cs
- CommentAction.cs
- SourceInterpreter.cs
- ServerType.cs
- IISUnsafeMethods.cs
- ReverseInheritProperty.cs
- PageTheme.cs
- XmlSchemaGroup.cs
- _AuthenticationState.cs
- ChildTable.cs
- SQLInt32Storage.cs
- DateTimeUtil.cs
- GridViewColumn.cs
- XmlILOptimizerVisitor.cs
- TypeBuilder.cs
- SqlCacheDependencyDatabaseCollection.cs
- WithParamAction.cs
- CodeTypeConstructor.cs
- VisualTreeUtils.cs
- NativeMethods.cs
- XPathException.cs
- FixedDocument.cs
- TextElementAutomationPeer.cs
- InternalDispatchObject.cs
- MasterPageCodeDomTreeGenerator.cs
- AspNetSynchronizationContext.cs
- WinFormsUtils.cs
- SmtpNtlmAuthenticationModule.cs
- ViewCellRelation.cs
- JsonReader.cs
- StrokeNodeOperations2.cs
- DetailsViewPageEventArgs.cs
- InvalidPrinterException.cs
- InstanceData.cs
- XmlSchemaDatatype.cs
- Positioning.cs
- Function.cs
- ParameterReplacerVisitor.cs
- CheckBoxPopupAdapter.cs
- SQLResource.cs
- ManipulationVelocities.cs
- ExpressionList.cs
- ColorAnimationUsingKeyFrames.cs
- InterleavedZipPartStream.cs
- XPathNodePointer.cs
- PageContentAsyncResult.cs
- SqlUserDefinedAggregateAttribute.cs
- BamlLocalizableResourceKey.cs
- XmlSchemaCompilationSettings.cs
- SqlDataSourceSelectingEventArgs.cs
- SmiContext.cs
- ChangeInterceptorAttribute.cs
- Pipe.cs
- XmlSchemaExternal.cs
- SqlInternalConnectionTds.cs
- UpDownBase.cs
- XmlDocumentType.cs
- IPHostEntry.cs
- MailSettingsSection.cs
- BindingOperations.cs
- MemberCollection.cs