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
- MdImport.cs
- RuleEngine.cs
- ProviderConnectionPointCollection.cs
- RootBuilder.cs
- EnumUnknown.cs
- SoapException.cs
- PerfCounters.cs
- SafeRightsManagementSessionHandle.cs
- FolderBrowserDialogDesigner.cs
- BindingOperations.cs
- UICuesEvent.cs
- RSACryptoServiceProvider.cs
- DataServiceResponse.cs
- CellRelation.cs
- ArcSegment.cs
- XmlArrayItemAttributes.cs
- StrokeNodeEnumerator.cs
- WebPartCancelEventArgs.cs
- OracleTransaction.cs
- OperationCanceledException.cs
- SessionStateSection.cs
- String.cs
- XmlSchemaExporter.cs
- PriorityBinding.cs
- DbProviderFactoriesConfigurationHandler.cs
- DataGridHelper.cs
- ConnectionStringEditor.cs
- DetailsViewActionList.cs
- ButtonBase.cs
- ThaiBuddhistCalendar.cs
- ClientBuildManager.cs
- ValidatorCollection.cs
- HttpListenerResponse.cs
- VectorValueSerializer.cs
- ChooseAction.cs
- XmlEntity.cs
- FilteredSchemaElementLookUpTable.cs
- PropertyOverridesTypeEditor.cs
- OuterGlowBitmapEffect.cs
- COMException.cs
- SqlTopReducer.cs
- IndependentAnimationStorage.cs
- SmtpAuthenticationManager.cs
- HandlerWithFactory.cs
- DeflateEmulationStream.cs
- Clipboard.cs
- DebugView.cs
- FlatButtonAppearance.cs
- InheritanceContextHelper.cs
- AuthenticationException.cs
- CodeThrowExceptionStatement.cs
- Transform.cs
- HandleCollector.cs
- TraceContextEventArgs.cs
- ConfigurationSection.cs
- sapiproxy.cs
- EncoderParameters.cs
- ISAPIWorkerRequest.cs
- sapiproxy.cs
- PrintDialog.cs
- JsonReader.cs
- Image.cs
- TreeBuilderBamlTranslator.cs
- ExtensionQuery.cs
- ComponentDispatcher.cs
- Error.cs
- FunctionQuery.cs
- LineSegment.cs
- ContextMenuService.cs
- webbrowsersite.cs
- DataObjectPastingEventArgs.cs
- DownloadProgressEventArgs.cs
- ArrangedElement.cs
- AsyncMethodInvoker.cs
- ArithmeticLiteral.cs
- ObjectDataSourceMethodEventArgs.cs
- MetadataCache.cs
- DataGridColumnHeaderAutomationPeer.cs
- GroupBoxAutomationPeer.cs
- SqlReferenceCollection.cs
- PriorityRange.cs
- Constants.cs
- ListViewEditEventArgs.cs
- GeometryGroup.cs
- _HelperAsyncResults.cs
- StringValidatorAttribute.cs
- XmlValueConverter.cs
- NumberFormatInfo.cs
- WindowVisualStateTracker.cs
- ArraySet.cs
- BrowserTree.cs
- AbandonedMutexException.cs
- TextParagraphCache.cs
- DefaultBinder.cs
- VisualStyleRenderer.cs
- ReadOnlyMetadataCollection.cs
- SoapTypeAttribute.cs
- SqlReorderer.cs
- ControlBuilderAttribute.cs
- InsufficientExecutionStackException.cs