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
- IconBitmapDecoder.cs
- WrappedIUnknown.cs
- StreamGeometry.cs
- NavigationPropertySingletonExpression.cs
- DataKey.cs
- PlaceHolder.cs
- ReliabilityContractAttribute.cs
- sqlnorm.cs
- WorkflowControlClient.cs
- UxThemeWrapper.cs
- ProxyWebPartManager.cs
- TemplateManager.cs
- MappedMetaModel.cs
- httpapplicationstate.cs
- IFlowDocumentViewer.cs
- DataListItem.cs
- RolePrincipal.cs
- Module.cs
- TileBrush.cs
- Codec.cs
- UserPersonalizationStateInfo.cs
- VirtualDirectoryMapping.cs
- ArglessEventHandlerProxy.cs
- CommandHelpers.cs
- StylusPointPropertyId.cs
- ToolStripDropDownButton.cs
- ToolboxItemFilterAttribute.cs
- GridViewActionList.cs
- CodeTypeDeclarationCollection.cs
- Pkcs7Recipient.cs
- AlignmentYValidation.cs
- Context.cs
- SqlDependencyUtils.cs
- MenuTracker.cs
- DataGridTextBoxColumn.cs
- UIElement3DAutomationPeer.cs
- RuntimeCompatibilityAttribute.cs
- PersonalizationState.cs
- Exceptions.cs
- DataKeyArray.cs
- ItemType.cs
- SqlCacheDependency.cs
- XmlNotation.cs
- ViewUtilities.cs
- IntegrationExceptionEventArgs.cs
- SchemaNotation.cs
- Baml2006ReaderFrame.cs
- PartitionerStatic.cs
- ThicknessKeyFrameCollection.cs
- StaticResourceExtension.cs
- TextEditor.cs
- NetTcpSectionData.cs
- ManualResetEvent.cs
- columnmapkeybuilder.cs
- SelectedGridItemChangedEvent.cs
- RoleManagerEventArgs.cs
- MLangCodePageEncoding.cs
- ReadOnlyDataSourceView.cs
- filewebrequest.cs
- WindowsComboBox.cs
- IUnknownConstantAttribute.cs
- RtfNavigator.cs
- FunctionDescription.cs
- TypeSystemProvider.cs
- MultitargetUtil.cs
- Point3DKeyFrameCollection.cs
- TypeConverterHelper.cs
- RectAnimationBase.cs
- hebrewshape.cs
- ReflectTypeDescriptionProvider.cs
- RIPEMD160Managed.cs
- Section.cs
- MobileErrorInfo.cs
- SchemaHelper.cs
- WsdlImporterElementCollection.cs
- DragCompletedEventArgs.cs
- ExecutionContext.cs
- ToolStripProgressBar.cs
- ImageAttributes.cs
- SoapTypeAttribute.cs
- RegexCompiler.cs
- CompressEmulationStream.cs
- SQLConvert.cs
- ComponentCollection.cs
- XamlDesignerSerializationManager.cs
- WpfWebRequestHelper.cs
- AmbientValueAttribute.cs
- Roles.cs
- ThrowHelper.cs
- SizeIndependentAnimationStorage.cs
- UserNameSecurityToken.cs
- IApplicationTrustManager.cs
- ClientApiGenerator.cs
- ToolStripOverflow.cs
- ComplexBindingPropertiesAttribute.cs
- TableProviderWrapper.cs
- WebReferencesBuildProvider.cs
- FormViewDeletedEventArgs.cs
- SafeThemeHandle.cs
- CodeTypeReference.cs