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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Label.cs
- path.cs
- CopyNodeSetAction.cs
- LicFileLicenseProvider.cs
- DocumentOrderComparer.cs
- RecognizeCompletedEventArgs.cs
- Nullable.cs
- SchemaHelper.cs
- ComponentManagerBroker.cs
- SequenceFullException.cs
- GraphicsState.cs
- XNodeValidator.cs
- relpropertyhelper.cs
- XmlIgnoreAttribute.cs
- DelegateSerializationHolder.cs
- ElementNotAvailableException.cs
- HttpResponseHeader.cs
- ResolveResponseInfo.cs
- FileDialogPermission.cs
- CharacterString.cs
- DesignConnection.cs
- UrlEncodedParameterWriter.cs
- SemanticResultKey.cs
- XmlNodeList.cs
- KeyFrames.cs
- latinshape.cs
- UserControlCodeDomTreeGenerator.cs
- WorkflowDesigner.cs
- SigningDialog.cs
- filewebrequest.cs
- RegistryDataKey.cs
- GridViewRowPresenter.cs
- Adorner.cs
- ConfigurationElementCollection.cs
- Set.cs
- Popup.cs
- AccessText.cs
- StandardToolWindows.cs
- Activator.cs
- AuthStoreRoleProvider.cs
- DiffuseMaterial.cs
- TypeUtil.cs
- Registration.cs
- oledbmetadatacollectionnames.cs
- rsa.cs
- InkCollectionBehavior.cs
- TableCell.cs
- HitTestWithPointDrawingContextWalker.cs
- FontCacheUtil.cs
- MenuItem.cs
- HttpRawResponse.cs
- Win32KeyboardDevice.cs
- AssociationTypeEmitter.cs
- GridViewUpdateEventArgs.cs
- PasswordRecovery.cs
- UnsafeNativeMethodsCLR.cs
- WebPartPersonalization.cs
- GeometryGroup.cs
- rsa.cs
- DesignBindingConverter.cs
- FontFamilyValueSerializer.cs
- tibetanshape.cs
- ResourceContainer.cs
- ManageRequest.cs
- FormCollection.cs
- TypeForwardedToAttribute.cs
- ButtonBaseAdapter.cs
- MessageTransmitTraceRecord.cs
- MsdtcClusterUtils.cs
- SqlBooleanizer.cs
- EncodingInfo.cs
- ConfigurationSection.cs
- AlternateViewCollection.cs
- AnchorEditor.cs
- EntityDataSourceUtil.cs
- AccessDataSource.cs
- OdbcParameter.cs
- Visual.cs
- Rule.cs
- UserPreferenceChangingEventArgs.cs
- ShapeTypeface.cs
- ContainerControl.cs
- HasCopySemanticsAttribute.cs
- SqlCommandSet.cs
- GorillaCodec.cs
- HtmlHistory.cs
- OdbcParameter.cs
- DataServiceStreamResponse.cs
- SpecialFolderEnumConverter.cs
- CodeVariableDeclarationStatement.cs
- DocumentSequence.cs
- UserValidatedEventArgs.cs
- LogReserveAndAppendState.cs
- IisTraceListener.cs
- _Win32.cs
- DecoderNLS.cs
- FusionWrap.cs
- EncryptedKey.cs
- SponsorHelper.cs
- SamlDelegatingWriter.cs