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
- ThreadInterruptedException.cs
- LoadWorkflowAsyncResult.cs
- DataGridViewRowEventArgs.cs
- BindingObserver.cs
- VirtualPathUtility.cs
- Imaging.cs
- httpapplicationstate.cs
- SystemInformation.cs
- DateTimeSerializationSection.cs
- IdentitySection.cs
- ProviderBase.cs
- X509Logo.cs
- NavigationWindow.cs
- FrameSecurityDescriptor.cs
- SystemDropShadowChrome.cs
- StylusShape.cs
- ProxyHwnd.cs
- ParallelQuery.cs
- StorageEntityTypeMapping.cs
- KeyPressEvent.cs
- DataSourceCacheDurationConverter.cs
- DataServiceQueryException.cs
- Schema.cs
- DataComponentGenerator.cs
- SecurityHelper.cs
- GeneralTransform3DTo2D.cs
- OleDbError.cs
- SolidColorBrush.cs
- latinshape.cs
- TextCompositionManager.cs
- HebrewCalendar.cs
- TemplateBuilder.cs
- Property.cs
- TemplatePagerField.cs
- Header.cs
- DataBoundControl.cs
- DelegatingConfigHost.cs
- ElementUtil.cs
- CqlIdentifiers.cs
- ViewGenerator.cs
- BuildResult.cs
- TextDecorationCollectionConverter.cs
- PersistenceTypeAttribute.cs
- CodeTypeParameterCollection.cs
- DataSysAttribute.cs
- EntityConnection.cs
- StateMachine.cs
- AutomationProperties.cs
- DataGridViewHeaderCell.cs
- NestedContainer.cs
- ObjectToIdCache.cs
- TypedTableHandler.cs
- followingquery.cs
- MiniConstructorInfo.cs
- SyntaxCheck.cs
- NativeCppClassAttribute.cs
- WebCategoryAttribute.cs
- StorageBasedPackageProperties.cs
- ByteKeyFrameCollection.cs
- BaseServiceProvider.cs
- EventMappingSettingsCollection.cs
- SocketAddress.cs
- TiffBitmapDecoder.cs
- TdsEnums.cs
- MediaContext.cs
- CompModSwitches.cs
- CellNormalizer.cs
- NamespaceQuery.cs
- EntityDataSourceContainerNameConverter.cs
- SessionStateContainer.cs
- IntSecurity.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- TagMapCollection.cs
- BamlStream.cs
- XsltSettings.cs
- ToggleButton.cs
- ComPersistableTypeElementCollection.cs
- relpropertyhelper.cs
- WebPartsPersonalization.cs
- PlaceHolder.cs
- WebBrowsableAttribute.cs
- PreservationFileWriter.cs
- AuthorizationRuleCollection.cs
- Identifier.cs
- ImageInfo.cs
- ContextBase.cs
- BoundConstants.cs
- NamedPermissionSet.cs
- RecipientInfo.cs
- MemberMaps.cs
- UnaryNode.cs
- HttpCookiesSection.cs
- SystemIPAddressInformation.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- CompilationUnit.cs
- StylusPointDescription.cs
- WrappedReader.cs
- HelpEvent.cs
- ContainerFilterService.cs
- GridViewDeletedEventArgs.cs