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
- Renderer.cs
- ValidationRuleCollection.cs
- ButtonAutomationPeer.cs
- Compensate.cs
- TripleDES.cs
- Symbol.cs
- ColorTransform.cs
- XmlILTrace.cs
- DeferredReference.cs
- DbConnectionInternal.cs
- Highlights.cs
- DispatcherHooks.cs
- Span.cs
- ServiceOperationParameter.cs
- AlphabetConverter.cs
- PartialTrustHelpers.cs
- ActiveXHelper.cs
- DrawingVisual.cs
- ConfigPathUtility.cs
- DataRelationPropertyDescriptor.cs
- DrawingContextFlattener.cs
- StoreContentChangedEventArgs.cs
- MemberInfoSerializationHolder.cs
- ContextProperty.cs
- DetailsViewModeEventArgs.cs
- ManagedFilter.cs
- BindingObserver.cs
- QueuePathDialog.cs
- CommandManager.cs
- RC2.cs
- SqlDataSource.cs
- FragmentQueryProcessor.cs
- ServiceDescriptions.cs
- TraversalRequest.cs
- ObjectItemCachedAssemblyLoader.cs
- ConnectionsZone.cs
- Vector3DAnimationBase.cs
- XamlDesignerSerializationManager.cs
- DataRow.cs
- DefinitionBase.cs
- ValidationHelper.cs
- JavascriptCallbackBehaviorAttribute.cs
- ToolStripLocationCancelEventArgs.cs
- InputScopeAttribute.cs
- TabControlEvent.cs
- EntityKeyElement.cs
- ClockController.cs
- UserControlBuildProvider.cs
- DataListItemCollection.cs
- PaintValueEventArgs.cs
- DataGridViewSortCompareEventArgs.cs
- RewritingPass.cs
- WindowsContainer.cs
- ListViewItem.cs
- TargetControlTypeCache.cs
- MulticastIPAddressInformationCollection.cs
- SchemaMerger.cs
- ForwardPositionQuery.cs
- IList.cs
- XmlEncApr2001.cs
- GPRECTF.cs
- XmlCollation.cs
- BaseCollection.cs
- ListView.cs
- TypeCollectionPropertyEditor.cs
- CodePageUtils.cs
- CorrelationService.cs
- X509SecurityTokenProvider.cs
- RemoteTokenFactory.cs
- DefaultAuthorizationContext.cs
- HtmlTable.cs
- BuiltInExpr.cs
- GestureRecognizer.cs
- SafeHGlobalHandleCritical.cs
- BinaryCommonClasses.cs
- _NegoState.cs
- MimeTypePropertyAttribute.cs
- storepermission.cs
- MetabaseSettingsIis7.cs
- ColorAnimationUsingKeyFrames.cs
- TextTreeRootTextBlock.cs
- QilReference.cs
- MoveSizeWinEventHandler.cs
- PassportAuthentication.cs
- PrintPreviewControl.cs
- TableColumnCollectionInternal.cs
- OleDbPropertySetGuid.cs
- FileUtil.cs
- LinqDataSourceInsertEventArgs.cs
- WeakReference.cs
- SimpleTypesSurrogate.cs
- Image.cs
- QilPatternFactory.cs
- VisualStyleTypesAndProperties.cs
- CheckBoxFlatAdapter.cs
- SqlFileStream.cs
- PrimitiveRenderer.cs
- RenderingBiasValidation.cs
- TemplateParser.cs
- SQLBinary.cs