Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / DrawingImage.cs / 1305600 / DrawingImage.cs
//---------------------------------------------------------------------------- // //// Copyright (C) Microsoft Corporation. All rights reserved. // // // // Description: DrawingImage class // An ImageSource with a Drawing for content // // // History: // 05/26/2005 : [....] - Created it // //--------------------------------------------------------------------------- using MS.Internal; using System; using System.ComponentModel; using System.Diagnostics; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Windows.Media.Imaging; namespace System.Windows.Media { ////// The class definition for DrawingImage /// public sealed partial class DrawingImage : ImageSource { ////// Default DrawingImage ctor /// public DrawingImage() { } ////// DrawingImage ctor that takes a Drawing /// /// The content of the DrawingImage public DrawingImage(Drawing drawing) { Drawing = drawing; } ////// Width of the DrawingImage /// public override double Width { get { ReadPreamble(); return Size.Width; } } ////// Height of the DrawingImage /// public override double Height { get { ReadPreamble(); return Size.Height; } } ////// Get the Metadata of the DrawingImage /// public override ImageMetadata Metadata { get { ReadPreamble(); // DrawingImage does not have any metadata currently defined. return null; } } ////// Size for the DrawingImage /// internal override Size Size { get { Drawing drawing = Drawing; if (drawing != null) { Size size = drawing.GetBounds().Size; if (!size.IsEmpty) { return size; } else { return new Size(); } } else { return new Size(); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ColumnWidthChangedEvent.cs
- GZipStream.cs
- ProtocolsConfigurationHandler.cs
- DiagnosticSection.cs
- StackBuilderSink.cs
- HwndProxyElementProvider.cs
- CardSpaceShim.cs
- SqlNodeAnnotations.cs
- FontWeight.cs
- UriExt.cs
- SafeRightsManagementQueryHandle.cs
- ManualResetEvent.cs
- glyphs.cs
- RIPEMD160Managed.cs
- FormatException.cs
- CollectionViewGroup.cs
- MessageBox.cs
- StsCommunicationException.cs
- RegexNode.cs
- UnknownBitmapEncoder.cs
- SystemIcmpV6Statistics.cs
- SingleSelectRootGridEntry.cs
- RoutedEvent.cs
- XmlSchemaSimpleType.cs
- Stack.cs
- DesignerTransaction.cs
- SortQuery.cs
- DataRelationPropertyDescriptor.cs
- DbProviderFactories.cs
- SafeSecurityHelper.cs
- StringCollection.cs
- XmlElementElementCollection.cs
- ProfilePropertyNameValidator.cs
- DataSet.cs
- DataTableTypeConverter.cs
- GatewayIPAddressInformationCollection.cs
- TextTreeTextElementNode.cs
- VirtualPathProvider.cs
- TreeView.cs
- AutomationProperties.cs
- TabPage.cs
- sqlinternaltransaction.cs
- EventRouteFactory.cs
- DesignerObject.cs
- FilterException.cs
- formatter.cs
- GenericRootAutomationPeer.cs
- SQLConvert.cs
- WindowsStartMenu.cs
- DateBoldEvent.cs
- ExpressionEditorAttribute.cs
- TextSelectionHighlightLayer.cs
- XmlResolver.cs
- AddInEnvironment.cs
- FontDifferentiator.cs
- sitestring.cs
- XmlResolver.cs
- CngProvider.cs
- UIElementAutomationPeer.cs
- BindableTemplateBuilder.cs
- CompModSwitches.cs
- XPathPatternBuilder.cs
- RootBuilder.cs
- ReturnType.cs
- XmlLanguage.cs
- sapiproxy.cs
- StorageMappingItemCollection.cs
- BitmapMetadataBlob.cs
- MatrixIndependentAnimationStorage.cs
- _LoggingObject.cs
- TreeNodeStyleCollection.cs
- ChooseAction.cs
- GlyphCollection.cs
- ExpandoClass.cs
- CryptoConfig.cs
- InfoCardSymmetricCrypto.cs
- WindowCollection.cs
- StringFormat.cs
- StringStorage.cs
- ConnectionInterfaceCollection.cs
- EventDrivenDesigner.cs
- MailMessageEventArgs.cs
- WebPartEventArgs.cs
- MarkupCompiler.cs
- CodeGeneratorOptions.cs
- MethodToken.cs
- SamlSerializer.cs
- TextElementAutomationPeer.cs
- FusionWrap.cs
- DocumentXmlWriter.cs
- BitmapMetadata.cs
- MouseGestureConverter.cs
- GridViewSortEventArgs.cs
- Column.cs
- CircleHotSpot.cs
- PackageProperties.cs
- CounterCreationDataCollection.cs
- StandardToolWindows.cs
- NumericUpDownAccelerationCollection.cs
- MailWebEventProvider.cs