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
- HttpProfileBase.cs
- AutoCompleteStringCollection.cs
- EventsTab.cs
- ConsumerConnectionPointCollection.cs
- XmlDataLoader.cs
- Stackframe.cs
- IntegrationExceptionEventArgs.cs
- RtfControls.cs
- OperatorExpressions.cs
- basecomparevalidator.cs
- Table.cs
- SecurityHeaderTokenResolver.cs
- MediaContext.cs
- XpsFixedDocumentSequenceReaderWriter.cs
- HttpProfileBase.cs
- TextRangeAdaptor.cs
- CodeArrayCreateExpression.cs
- SpellerError.cs
- UIElement.cs
- wgx_commands.cs
- PerfCounters.cs
- RuntimeUtils.cs
- InfoCardArgumentException.cs
- LostFocusEventManager.cs
- NominalTypeEliminator.cs
- HttpResponseMessageProperty.cs
- ToolboxComponentsCreatedEventArgs.cs
- BoundPropertyEntry.cs
- ExternalException.cs
- XmlCompatibilityReader.cs
- NavigationProperty.cs
- TriState.cs
- TemplatePropertyEntry.cs
- KeyboardEventArgs.cs
- RequestCacheEntry.cs
- CompositeControlDesigner.cs
- CookieHandler.cs
- CommentAction.cs
- HyperLinkColumn.cs
- ServiceRouteHandler.cs
- SmtpLoginAuthenticationModule.cs
- HostingPreferredMapPath.cs
- DirectionalLight.cs
- RedBlackList.cs
- SemanticResolver.cs
- ChannelServices.cs
- CorrelationService.cs
- EventRouteFactory.cs
- ScriptRef.cs
- AsyncSerializedWorker.cs
- ReachDocumentSequenceSerializer.cs
- CodePrimitiveExpression.cs
- LinearGradientBrush.cs
- MethodImplAttribute.cs
- SizeF.cs
- PageCatalogPart.cs
- MergeExecutor.cs
- ContentType.cs
- ReadOnlyObservableCollection.cs
- BitmapData.cs
- KeyedCollection.cs
- HttpListenerRequest.cs
- UICuesEvent.cs
- StylusPointPropertyInfoDefaults.cs
- MimeMultiPart.cs
- MetadataPropertyCollection.cs
- ModelEditingScope.cs
- AnnotationAuthorChangedEventArgs.cs
- SectionInput.cs
- SafeLocalAllocation.cs
- IconHelper.cs
- FilteredAttributeCollection.cs
- SchemaDeclBase.cs
- DataGridState.cs
- OleDbWrapper.cs
- UserNameSecurityTokenAuthenticator.cs
- BinaryUtilClasses.cs
- BindingExpressionUncommonField.cs
- Effect.cs
- BaseDataBoundControl.cs
- RenamedEventArgs.cs
- CompositeActivityCodeGenerator.cs
- IndentTextWriter.cs
- Preprocessor.cs
- PeerResolver.cs
- OperatingSystem.cs
- C14NUtil.cs
- SemanticKeyElement.cs
- EpmSyndicationContentSerializer.cs
- Substitution.cs
- Exceptions.cs
- SequentialWorkflowRootDesigner.cs
- DataTemplateSelector.cs
- MimeBasePart.cs
- ControlIdConverter.cs
- DemultiplexingDispatchMessageFormatter.cs
- InvalidComObjectException.cs
- CapabilitiesPattern.cs
- ExecutionEngineException.cs
- listitem.cs