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
- TraceSection.cs
- HighlightVisual.cs
- LinqDataView.cs
- Container.cs
- BlurBitmapEffect.cs
- CodeActivity.cs
- DataGridRow.cs
- MD5CryptoServiceProvider.cs
- TreeNodeCollection.cs
- WebPartZoneBase.cs
- UnknownBitmapEncoder.cs
- DoWhile.cs
- XmlSchemaObject.cs
- SharedDp.cs
- XmlLinkedNode.cs
- GridViewActionList.cs
- ChtmlMobileTextWriter.cs
- MultiplexingFormatMapping.cs
- ScrollItemProviderWrapper.cs
- PackagePartCollection.cs
- VirtualizedContainerService.cs
- MasterPageCodeDomTreeGenerator.cs
- WindowsGraphics2.cs
- PngBitmapDecoder.cs
- TypeElementCollection.cs
- DirectionalLight.cs
- DataGridHeaderBorder.cs
- UnSafeCharBuffer.cs
- ReservationCollection.cs
- DispatcherHooks.cs
- StrongNamePublicKeyBlob.cs
- SelectionChangedEventArgs.cs
- SqlClientMetaDataCollectionNames.cs
- TextRunCacheImp.cs
- JsonEncodingStreamWrapper.cs
- RelativeSource.cs
- DropDownList.cs
- MaskedTextBoxTextEditorDropDown.cs
- TokenBasedSet.cs
- DomainConstraint.cs
- ToolStripControlHost.cs
- DbDataAdapter.cs
- CellTreeNodeVisitors.cs
- UrlRoutingModule.cs
- LinqToSqlWrapper.cs
- SoapBinding.cs
- IndividualDeviceConfig.cs
- SparseMemoryStream.cs
- Function.cs
- UndirectedGraph.cs
- SubtreeProcessor.cs
- UIElementParagraph.cs
- NotifyInputEventArgs.cs
- JournalNavigationScope.cs
- ObjectConverter.cs
- Deflater.cs
- RuntimeCompatibilityAttribute.cs
- AvTraceDetails.cs
- MenuStrip.cs
- FormViewPagerRow.cs
- IdentityValidationException.cs
- DrawingImage.cs
- MouseWheelEventArgs.cs
- BamlRecordHelper.cs
- RijndaelManaged.cs
- loginstatus.cs
- DataGridViewIntLinkedList.cs
- RuntimeVariablesExpression.cs
- Setter.cs
- KeyedHashAlgorithm.cs
- DbgUtil.cs
- AppDomainUnloadedException.cs
- EntityTemplateUserControl.cs
- ComponentDispatcherThread.cs
- XmlByteStreamReader.cs
- ECDiffieHellmanCng.cs
- ClientConvert.cs
- EntityDataSourceReferenceGroup.cs
- EndPoint.cs
- FrameworkElementFactory.cs
- wgx_exports.cs
- ControllableStoryboardAction.cs
- PlainXmlDeserializer.cs
- RegexMatchCollection.cs
- ThicknessAnimationUsingKeyFrames.cs
- CompilerGeneratedAttribute.cs
- XslVisitor.cs
- ConditionalDesigner.cs
- XsltQilFactory.cs
- UnsafeNativeMethods.cs
- ImpersonateTokenRef.cs
- DoubleCollection.cs
- URLString.cs
- FrameworkElement.cs
- MenuItemStyle.cs
- DbgUtil.cs
- TableParagraph.cs
- DynamicDataExtensions.cs
- WebPartHeaderCloseVerb.cs
- SqlConnectionManager.cs