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
- ResolveNameEventArgs.cs
- Label.cs
- CssStyleCollection.cs
- DiscriminatorMap.cs
- ObjectKeyFrameCollection.cs
- TriggerBase.cs
- ReadOnlyCollectionBase.cs
- XmlSchemaImporter.cs
- SynchronizedDispatch.cs
- EpmHelper.cs
- TemplateParser.cs
- VisualStyleRenderer.cs
- NetworkStream.cs
- ColumnMapVisitor.cs
- MenuAdapter.cs
- QueryInterceptorAttribute.cs
- GPStream.cs
- EncoderBestFitFallback.cs
- Classification.cs
- FreezableDefaultValueFactory.cs
- LicenseManager.cs
- ListCollectionView.cs
- ObjectSerializerFactory.cs
- IndentedWriter.cs
- IdentityValidationException.cs
- CubicEase.cs
- GenericAuthenticationEventArgs.cs
- DataSourceView.cs
- HandlerFactoryCache.cs
- EditBehavior.cs
- BeginStoryboard.cs
- SingleConverter.cs
- RegexBoyerMoore.cs
- RemotingConfigParser.cs
- PolyQuadraticBezierSegment.cs
- COM2TypeInfoProcessor.cs
- QilPatternFactory.cs
- SystemColorTracker.cs
- SendingRequestEventArgs.cs
- ComplexPropertyEntry.cs
- RegularExpressionValidator.cs
- WebPartsSection.cs
- PhysicalFontFamily.cs
- ViewGenerator.cs
- PreviousTrackingServiceAttribute.cs
- EventLogEntry.cs
- HtmlControlPersistable.cs
- LoginViewDesigner.cs
- NotFiniteNumberException.cs
- BinaryCommonClasses.cs
- UmAlQuraCalendar.cs
- Transform.cs
- AssemblyAssociatedContentFileAttribute.cs
- CanonicalFontFamilyReference.cs
- SimpleRecyclingCache.cs
- RegexStringValidatorAttribute.cs
- KerberosSecurityTokenParameters.cs
- CultureTable.cs
- RelatedView.cs
- SettingsPropertyCollection.cs
- State.cs
- StateInitializationDesigner.cs
- PackageProperties.cs
- EntityWithChangeTrackerStrategy.cs
- XsltArgumentList.cs
- Cursor.cs
- FixedSOMPageConstructor.cs
- DragDrop.cs
- PropertyTabChangedEvent.cs
- JoinGraph.cs
- PerformanceCounterLib.cs
- ReadWriteObjectLock.cs
- MSAAWinEventWrap.cs
- UnsafeNativeMethods.cs
- SpotLight.cs
- StringConverter.cs
- DbMetaDataCollectionNames.cs
- StreamReader.cs
- BamlLocalizabilityResolver.cs
- X509CertificateStore.cs
- ScaleTransform3D.cs
- AtomicFile.cs
- ClientUrlResolverWrapper.cs
- CallbackException.cs
- ObjectDataProvider.cs
- Process.cs
- FtpWebResponse.cs
- Mouse.cs
- DataListComponentEditor.cs
- CapiSymmetricAlgorithm.cs
- CryptoConfig.cs
- ContentDisposition.cs
- HtmlElementCollection.cs
- DataPagerFieldCollection.cs
- ControlValuePropertyAttribute.cs
- DSASignatureDeformatter.cs
- AlphabetConverter.cs
- CommandField.cs
- FlowDocumentFormatter.cs
- TargetInvocationException.cs