Code:
/ DotNET / DotNET / 8.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
- TemplateField.cs
- ElementsClipboardData.cs
- DispatcherFrame.cs
- AQNBuilder.cs
- ProtectedConfiguration.cs
- basenumberconverter.cs
- KeyInfo.cs
- _ListenerRequestStream.cs
- MenuItemCollectionEditorDialog.cs
- LogicalMethodInfo.cs
- TypeSystem.cs
- DataTableMappingCollection.cs
- ScriptingJsonSerializationSection.cs
- InternalUserCancelledException.cs
- ProxyWebPartManager.cs
- ObjectPersistData.cs
- PageFunction.cs
- StylusCollection.cs
- KeyedPriorityQueue.cs
- PaginationProgressEventArgs.cs
- VirtualDirectoryMapping.cs
- DesignerActionListCollection.cs
- SqlCachedBuffer.cs
- PenThreadWorker.cs
- DocumentApplication.cs
- Partitioner.cs
- TdsParameterSetter.cs
- ConnectionStringsExpressionBuilder.cs
- RadioButton.cs
- ConnectionPointConverter.cs
- DefaultSection.cs
- FigureHelper.cs
- ElapsedEventArgs.cs
- MonikerBuilder.cs
- ToolStripRenderEventArgs.cs
- NestedContainer.cs
- ChannelCacheSettings.cs
- ManagementQuery.cs
- RegexParser.cs
- XDeferredAxisSource.cs
- UndirectedGraph.cs
- Attribute.cs
- BindingValueChangedEventArgs.cs
- DesignerSerializationOptionsAttribute.cs
- DistinctQueryOperator.cs
- CodeBlockBuilder.cs
- CompilationLock.cs
- HeaderedItemsControl.cs
- ListControlBoundActionList.cs
- SemanticResolver.cs
- GridViewColumnHeaderAutomationPeer.cs
- ContextStack.cs
- relpropertyhelper.cs
- SafeArrayTypeMismatchException.cs
- ObjectDataSourceSelectingEventArgs.cs
- FixedSOMFixedBlock.cs
- RowUpdatingEventArgs.cs
- CodeSubDirectory.cs
- ListViewInsertEventArgs.cs
- DigitShape.cs
- PathFigureCollection.cs
- DataViewListener.cs
- SqlHelper.cs
- EncoderExceptionFallback.cs
- Geometry3D.cs
- PointLightBase.cs
- FontNameConverter.cs
- DataGridViewRow.cs
- HashMembershipCondition.cs
- RSAPKCS1SignatureFormatter.cs
- XmlILModule.cs
- NetworkInformationException.cs
- ClientSideQueueItem.cs
- GridViewSelectEventArgs.cs
- ServiceMetadataExtension.cs
- Configuration.cs
- CounterCreationData.cs
- CDSsyncETWBCLProvider.cs
- DataListCommandEventArgs.cs
- TextFindEngine.cs
- UserControlBuildProvider.cs
- FixedTextView.cs
- CodeObject.cs
- VarRefManager.cs
- LineProperties.cs
- FragmentQueryKB.cs
- XmlSchemaChoice.cs
- TextModifier.cs
- MembershipSection.cs
- TCEAdapterGenerator.cs
- ErrorWebPart.cs
- BufferedGraphics.cs
- ProtocolsConfigurationEntry.cs
- SqlTriggerAttribute.cs
- DecimalConverter.cs
- GridView.cs
- PreviewKeyDownEventArgs.cs
- ReverseInheritProperty.cs
- XmlValidatingReaderImpl.cs
- ManipulationStartedEventArgs.cs