Code:
/ DotNET / DotNET / 8.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
- HttpCookie.cs
- InputBuffer.cs
- StreamHelper.cs
- _LazyAsyncResult.cs
- SecurityUtils.cs
- TextRangeEdit.cs
- WorkflowDesignerColors.cs
- SqlPersonalizationProvider.cs
- ProcessingInstructionAction.cs
- ReadOnlyHierarchicalDataSourceView.cs
- CurrencyManager.cs
- EditorZoneBase.cs
- PhysicalFontFamily.cs
- Bidi.cs
- DocumentOrderQuery.cs
- Pen.cs
- ProtocolViolationException.cs
- X509SecurityTokenProvider.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- XmlParserContext.cs
- Stack.cs
- TextMarkerSource.cs
- RSAOAEPKeyExchangeDeformatter.cs
- XmlSerializerVersionAttribute.cs
- TextViewDesigner.cs
- HttpContextServiceHost.cs
- SqlCacheDependencyDatabaseCollection.cs
- XmlEntity.cs
- StorageModelBuildProvider.cs
- columnmapfactory.cs
- ReadWriteSpinLock.cs
- BmpBitmapDecoder.cs
- ContainerSelectorGlyph.cs
- ScriptHandlerFactory.cs
- DependencyProperty.cs
- wgx_render.cs
- ExceptionHelpers.cs
- cookiecontainer.cs
- XPathExpr.cs
- BinaryCommonClasses.cs
- OletxTransactionManager.cs
- ToolStripButton.cs
- SerialPort.cs
- WebPartMenuStyle.cs
- LogAppendAsyncResult.cs
- BufferedGraphicsContext.cs
- FontFamilyValueSerializer.cs
- UpDownEvent.cs
- Win32.cs
- mediaeventargs.cs
- HttpRawResponse.cs
- MethodAccessException.cs
- CodeDirectionExpression.cs
- NavigateEvent.cs
- SQLMembershipProvider.cs
- Optimizer.cs
- EntityDataSourceColumn.cs
- WindowsTitleBar.cs
- XslException.cs
- DataPagerFieldCollection.cs
- MemberJoinTreeNode.cs
- PropertyPathWorker.cs
- ChannelSinkStacks.cs
- FormatSettings.cs
- NavigationProperty.cs
- ChannelSinkStacks.cs
- WorkflowOwnershipException.cs
- CodeTypeReference.cs
- SamlAuthorizationDecisionClaimResource.cs
- ObjectQueryExecutionPlan.cs
- SessionStateSection.cs
- BaseTemplateParser.cs
- IDispatchConstantAttribute.cs
- Menu.cs
- QilTernary.cs
- ImplicitInputBrush.cs
- ChildChangedEventArgs.cs
- Bitmap.cs
- Module.cs
- OleDbCommand.cs
- HttpHandler.cs
- BaseParaClient.cs
- coordinator.cs
- LOSFormatter.cs
- FormParameter.cs
- ValidatingCollection.cs
- Brushes.cs
- base64Transforms.cs
- FontWeights.cs
- Soap.cs
- WebPartExportVerb.cs
- StorageMappingFragment.cs
- Int16AnimationUsingKeyFrames.cs
- ValidatorCompatibilityHelper.cs
- BinaryObjectInfo.cs
- SafeHandle.cs
- InstalledFontCollection.cs
- BulletedListEventArgs.cs
- OrderedDictionaryStateHelper.cs
- QilValidationVisitor.cs