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
- ArgumentElement.cs
- EventSourceCreationData.cs
- TypeLibConverter.cs
- TCEAdapterGenerator.cs
- FormsAuthenticationModule.cs
- ConfigsHelper.cs
- SafeNativeMethods.cs
- CompiledQueryCacheEntry.cs
- SiteMapNodeItem.cs
- TabItemAutomationPeer.cs
- SQLSingleStorage.cs
- ErrorRuntimeConfig.cs
- XmlAtomicValue.cs
- XhtmlMobileTextWriter.cs
- HttpServerProtocol.cs
- OleDbMetaDataFactory.cs
- EventProviderWriter.cs
- DrawListViewItemEventArgs.cs
- _BufferOffsetSize.cs
- XsltFunctions.cs
- CustomCategoryAttribute.cs
- Size3DConverter.cs
- HandlerFactoryCache.cs
- PersistenceProviderElement.cs
- ErrorWebPart.cs
- FormViewModeEventArgs.cs
- Tablet.cs
- ColumnReorderedEventArgs.cs
- ToolboxBitmapAttribute.cs
- AttachmentService.cs
- OleDbMetaDataFactory.cs
- UnsafeNativeMethodsPenimc.cs
- ChtmlLinkAdapter.cs
- ApplicationContext.cs
- CodeDirectiveCollection.cs
- KeyFrames.cs
- BitmapSource.cs
- PrintPreviewDialog.cs
- SingletonChannelAcceptor.cs
- SelectionListDesigner.cs
- TranslateTransform3D.cs
- QueryCursorEventArgs.cs
- NumberFunctions.cs
- VisualStates.cs
- _ListenerAsyncResult.cs
- ScriptResourceHandler.cs
- ResXResourceSet.cs
- Helpers.cs
- DynamicILGenerator.cs
- ScrollContentPresenter.cs
- MessageProtectionOrder.cs
- StateFinalizationActivity.cs
- StoreAnnotationsMap.cs
- ListViewCancelEventArgs.cs
- Switch.cs
- MenuBase.cs
- DocumentViewerHelper.cs
- MenuTracker.cs
- GAC.cs
- SemanticTag.cs
- TreeViewCancelEvent.cs
- BeginEvent.cs
- AutomationTextAttribute.cs
- DiffuseMaterial.cs
- Regex.cs
- COMException.cs
- errorpatternmatcher.cs
- PropertyEmitter.cs
- hresults.cs
- DataListCommandEventArgs.cs
- HttpListener.cs
- StateBag.cs
- DataColumnPropertyDescriptor.cs
- IPEndPointCollection.cs
- MenuCommandsChangedEventArgs.cs
- XPathPatternParser.cs
- WindowsEditBox.cs
- WindowsFormsDesignerOptionService.cs
- TdsParser.cs
- WindowInteractionStateTracker.cs
- GetReadStreamResult.cs
- FacetDescriptionElement.cs
- SubtreeProcessor.cs
- WebScriptServiceHostFactory.cs
- TextBoxBase.cs
- ByteStack.cs
- StartUpEventArgs.cs
- TypedTableGenerator.cs
- SizeAnimation.cs
- SessionEndingEventArgs.cs
- XpsSerializationException.cs
- InkPresenter.cs
- SubMenuStyleCollection.cs
- BaseInfoTable.cs
- XmlSchemaObjectTable.cs
- StretchValidation.cs
- ListViewInsertionMark.cs
- PriorityBinding.cs
- Panel.cs
- TreeBuilderXamlTranslator.cs