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
- FileDialog_Vista_Interop.cs
- Expressions.cs
- SiteMapPath.cs
- SafeFindHandle.cs
- NamespaceQuery.cs
- TypeUtil.cs
- BulletChrome.cs
- BindToObject.cs
- WebPartAddingEventArgs.cs
- XmlSchemaGroupRef.cs
- HotCommands.cs
- Avt.cs
- StylusEventArgs.cs
- AnnotationMap.cs
- SeverityFilter.cs
- ObjectDataProvider.cs
- Activity.cs
- Activation.cs
- DataColumnMappingCollection.cs
- Base64Encoder.cs
- DataMemberAttribute.cs
- Assert.cs
- DefaultBindingPropertyAttribute.cs
- FixedSchema.cs
- TreeNode.cs
- SqlServices.cs
- HttpBrowserCapabilitiesWrapper.cs
- _Win32.cs
- AutomationProperties.cs
- mansign.cs
- SiteMapNodeItem.cs
- QueryGeneratorBase.cs
- Listbox.cs
- IdentifierElement.cs
- KeyNameIdentifierClause.cs
- CaseInsensitiveOrdinalStringComparer.cs
- KnownTypesHelper.cs
- CardSpacePolicyElement.cs
- sqlstateclientmanager.cs
- NullableDecimalSumAggregationOperator.cs
- AbsoluteQuery.cs
- GroupByQueryOperator.cs
- SqlCacheDependencyDatabaseCollection.cs
- WebPartVerbsEventArgs.cs
- ObjectItemAttributeAssemblyLoader.cs
- IsolatedStoragePermission.cs
- SpotLight.cs
- WmlMobileTextWriter.cs
- RadioButton.cs
- TextSchema.cs
- ParsedRoute.cs
- XhtmlBasicControlAdapter.cs
- ReceiveMessageContent.cs
- ProfileSettings.cs
- WorkflowRuntimeServiceElement.cs
- BindingExpressionBase.cs
- ToolStripRenderEventArgs.cs
- ShaperBuffers.cs
- DataGridCommandEventArgs.cs
- PackageStore.cs
- XPathNodeHelper.cs
- RepeaterItemEventArgs.cs
- MonitoringDescriptionAttribute.cs
- DiscoveryInnerClientAdhocCD1.cs
- InputLanguageManager.cs
- BinaryReader.cs
- KnownBoxes.cs
- XPathNodeInfoAtom.cs
- DetailsViewPagerRow.cs
- FixedNode.cs
- ReadOnlyDataSourceView.cs
- XmlFormatExtensionPrefixAttribute.cs
- MobileControl.cs
- QueryableDataSourceEditData.cs
- EventPropertyMap.cs
- DataGridCommandEventArgs.cs
- VBCodeProvider.cs
- SizeLimitedCache.cs
- FindCompletedEventArgs.cs
- WebPartConnectionsDisconnectVerb.cs
- FolderNameEditor.cs
- VirtualizedContainerService.cs
- ToolStripContentPanel.cs
- FixedPageStructure.cs
- BitmapDownload.cs
- DragSelectionMessageFilter.cs
- WindowsListViewItem.cs
- SqlDataSourceCache.cs
- GridItem.cs
- DataGridPageChangedEventArgs.cs
- GridViewAutomationPeer.cs
- ServiceContractListItemList.cs
- BamlBinaryReader.cs
- AsyncOperation.cs
- SqlMultiplexer.cs
- SqlDataSourceEnumerator.cs
- CustomValidator.cs
- SmiMetaDataProperty.cs
- SettingsBindableAttribute.cs
- SqlComparer.cs