Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CommonUI / System / Drawing / Advanced / ColorPalette.cs / 1305376 / 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. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataException.cs
- ContentControl.cs
- CfgParser.cs
- StrokeCollectionDefaultValueFactory.cs
- ConnectionPoolManager.cs
- TimersDescriptionAttribute.cs
- SoapAttributeOverrides.cs
- Serializer.cs
- SqlCacheDependencySection.cs
- CodeTypeMemberCollection.cs
- ToolStripRenderEventArgs.cs
- InputLanguageSource.cs
- SharedPerformanceCounter.cs
- FieldTemplateUserControl.cs
- DetailsViewActionList.cs
- ServiceNameCollection.cs
- QilStrConcatenator.cs
- ApplicationInfo.cs
- securitycriticaldataClass.cs
- ParallelLoopState.cs
- EntityUtil.cs
- WindowsGraphicsWrapper.cs
- SqlDataSourceRefreshSchemaForm.cs
- OdbcFactory.cs
- RightsManagementPermission.cs
- Compiler.cs
- SetStoryboardSpeedRatio.cs
- SapiRecoInterop.cs
- TextSelectionHighlightLayer.cs
- RequestQueue.cs
- PasswordBoxAutomationPeer.cs
- ErasingStroke.cs
- CacheOutputQuery.cs
- InstanceValue.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- PhonemeEventArgs.cs
- SplineKeyFrames.cs
- RegionInfo.cs
- SafeArrayTypeMismatchException.cs
- InfoCardUIAgent.cs
- CodeCompiler.cs
- LineProperties.cs
- RunWorkerCompletedEventArgs.cs
- ViewBox.cs
- XNodeSchemaApplier.cs
- KnownTypeAttribute.cs
- SmtpCommands.cs
- DetailsViewUpdateEventArgs.cs
- TablePattern.cs
- WebPartPersonalization.cs
- HotSpot.cs
- StyleModeStack.cs
- BindStream.cs
- MsmqPoisonMessageException.cs
- _ContextAwareResult.cs
- PngBitmapEncoder.cs
- ConfigurationSectionGroup.cs
- ToolBarOverflowPanel.cs
- hwndwrapper.cs
- NameSpaceEvent.cs
- ObjectAnimationBase.cs
- CategoryGridEntry.cs
- HtmlFormAdapter.cs
- ObjectManager.cs
- PointAnimationClockResource.cs
- ResizingMessageFilter.cs
- TableRow.cs
- TaiwanLunisolarCalendar.cs
- BindingContext.cs
- SortFieldComparer.cs
- StructuredTypeEmitter.cs
- DataControlReferenceCollection.cs
- SymmetricKey.cs
- RtfControls.cs
- _UriSyntax.cs
- Mappings.cs
- TableRowCollection.cs
- ConstructorNeedsTagAttribute.cs
- Bezier.cs
- SoapHeaderException.cs
- UnsafeCollabNativeMethods.cs
- FieldNameLookup.cs
- Decoder.cs
- PropertyPanel.cs
- DiscreteKeyFrames.cs
- MatrixStack.cs
- PointAnimationUsingPath.cs
- PagedControl.cs
- SessionPageStateSection.cs
- GridViewCancelEditEventArgs.cs
- FixedSOMContainer.cs
- InertiaExpansionBehavior.cs
- RectConverter.cs
- OleDbStruct.cs
- PathSegment.cs
- DeflateEmulationStream.cs
- SystemResourceHost.cs
- ObjectDataSourceMethodEventArgs.cs
- CollectionConverter.cs
- LoginView.cs