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
- MulticastNotSupportedException.cs
- AspNetSynchronizationContext.cs
- IsolatedStorageFilePermission.cs
- UriScheme.cs
- CryptographicAttribute.cs
- GridEntry.cs
- SizeLimitedCache.cs
- StylusEventArgs.cs
- DataGridViewRowHeaderCell.cs
- XmlNodeComparer.cs
- Baml2006KnownTypes.cs
- WorkerRequest.cs
- BitStack.cs
- ScrollBarAutomationPeer.cs
- LocalizationParserHooks.cs
- PanelDesigner.cs
- DbConnectionStringCommon.cs
- DataGridViewComboBoxEditingControl.cs
- Error.cs
- Lasso.cs
- FontCacheUtil.cs
- MatrixTransform.cs
- SmiConnection.cs
- TextBoxAutomationPeer.cs
- ChameleonKey.cs
- ErasingStroke.cs
- SymmetricKey.cs
- LinqToSqlWrapper.cs
- FrugalList.cs
- Cursors.cs
- XamlPathDataSerializer.cs
- XmlEventCache.cs
- InstanceCompleteException.cs
- HtmlDocument.cs
- FormParameter.cs
- SafeLocalMemHandle.cs
- BamlTreeUpdater.cs
- GridViewSelectEventArgs.cs
- Stack.cs
- WmlValidatorAdapter.cs
- Vector3DCollectionConverter.cs
- SystemWebExtensionsSectionGroup.cs
- Light.cs
- SimplePropertyEntry.cs
- GenericXmlSecurityToken.cs
- HandoffBehavior.cs
- TextTrailingWordEllipsis.cs
- LeaseManager.cs
- ScriptModule.cs
- CmsInterop.cs
- OleDbDataReader.cs
- DecimalAnimation.cs
- RestHandlerFactory.cs
- DBConnectionString.cs
- DefaultAssemblyResolver.cs
- DeclaredTypeValidatorAttribute.cs
- _HelperAsyncResults.cs
- ColorConverter.cs
- PointLight.cs
- ProgressBar.cs
- WorkflowHostingResponseContext.cs
- VBIdentifierName.cs
- ToolStripDropDownItem.cs
- DataControlPagerLinkButton.cs
- AssemblyResourceLoader.cs
- XamlLoadErrorInfo.cs
- DesignerSerializationManager.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- IsolatedStorageFilePermission.cs
- PrintController.cs
- KeyValuePair.cs
- NullableIntSumAggregationOperator.cs
- BamlTreeNode.cs
- PreProcessInputEventArgs.cs
- SafeCancelMibChangeNotify.cs
- RemoteWebConfigurationHostServer.cs
- TableSectionStyle.cs
- ConversionHelper.cs
- PageHandlerFactory.cs
- AppDomainResourcePerfCounters.cs
- EventLog.cs
- OpenTypeMethods.cs
- IncomingWebResponseContext.cs
- MenuAutomationPeer.cs
- ExtendedProperty.cs
- ActivityExecutor.cs
- RegexBoyerMoore.cs
- DataServiceContext.cs
- HtmlInputImage.cs
- DrawListViewSubItemEventArgs.cs
- UICuesEvent.cs
- Camera.cs
- TextEndOfSegment.cs
- TypeConverterHelper.cs
- SizeValueSerializer.cs
- FilePresentation.cs
- LineProperties.cs
- ReferenceTypeElement.cs
- WMICapabilities.cs
- SamlDelegatingWriter.cs