Code:
/ 4.0 / 4.0 / 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. //---------------------------------------------------------------------------- // //// 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
- WebBrowserNavigatingEventHandler.cs
- UIElement.cs
- BufferModesCollection.cs
- SQLDateTimeStorage.cs
- ListViewItem.cs
- SpeakProgressEventArgs.cs
- XhtmlConformanceSection.cs
- ToolboxItemAttribute.cs
- AuthenticateEventArgs.cs
- TrackingRecord.cs
- OleDbEnumerator.cs
- controlskin.cs
- UnwrappedTypesXmlSerializerManager.cs
- TraceContextRecord.cs
- ClientConfigPaths.cs
- TextTreeInsertElementUndoUnit.cs
- ComplexObject.cs
- mediaeventshelper.cs
- Expander.cs
- DirectoryObjectSecurity.cs
- FlowNode.cs
- PropertyInformation.cs
- XpsFilter.cs
- LoadRetryAsyncResult.cs
- ResXResourceSet.cs
- ExceptionHandlersDesigner.cs
- StorageSetMapping.cs
- VoiceSynthesis.cs
- MappingException.cs
- UIElementParagraph.cs
- ApplicationManager.cs
- Screen.cs
- ListViewDeletedEventArgs.cs
- SelfIssuedAuthRSACryptoProvider.cs
- UnsafeNativeMethods.cs
- XmlAttributeProperties.cs
- DesigntimeLicenseContextSerializer.cs
- ClearTypeHintValidation.cs
- RelAssertionDirectKeyIdentifierClause.cs
- RoutedEventConverter.cs
- TdsEnums.cs
- SystemIPv4InterfaceProperties.cs
- XmlSchemaFacet.cs
- DayRenderEvent.cs
- ReceiveContextCollection.cs
- ProfilePropertyMetadata.cs
- PageStatePersister.cs
- NotifyParentPropertyAttribute.cs
- HttpContext.cs
- ActivityDelegate.cs
- SizeValueSerializer.cs
- UnicodeEncoding.cs
- PrintPreviewDialog.cs
- CodeSubDirectoriesCollection.cs
- AssociationSetEnd.cs
- TypeLoader.cs
- DefaultTextStore.cs
- UmAlQuraCalendar.cs
- AppDomainProtocolHandler.cs
- SvcMapFile.cs
- Light.cs
- WebMessageEncodingElement.cs
- RetrieveVirtualItemEventArgs.cs
- FileLevelControlBuilderAttribute.cs
- ColumnBinding.cs
- RepeatButtonAutomationPeer.cs
- InvalidFilterCriteriaException.cs
- BamlLocalizableResourceKey.cs
- MbpInfo.cs
- MsmqAuthenticationMode.cs
- XmlSchemaIdentityConstraint.cs
- SrgsGrammar.cs
- PassportAuthenticationEventArgs.cs
- _NestedMultipleAsyncResult.cs
- DynamicResourceExtensionConverter.cs
- StorageModelBuildProvider.cs
- HttpResponseInternalBase.cs
- XmlSerializerNamespaces.cs
- FileAccessException.cs
- UrlPropertyAttribute.cs
- MDIClient.cs
- WebHttpBindingCollectionElement.cs
- Viewport3DVisual.cs
- PeerNameRecord.cs
- UnsafeNativeMethodsCLR.cs
- WebPartRestoreVerb.cs
- WebScriptMetadataMessage.cs
- TableCell.cs
- TextSelectionHelper.cs
- RegistryPermission.cs
- SQLDecimalStorage.cs
- ContainerAction.cs
- Int32EqualityComparer.cs
- WebControlParameterProxy.cs
- ReliableMessagingHelpers.cs
- CryptographicAttribute.cs
- PackageFilter.cs
- PassportAuthenticationModule.cs
- MdbDataFileEditor.cs
- InternalBufferOverflowException.cs