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
- DynamicQueryableWrapper.cs
- EntityDataSourceView.cs
- DbExpressionBuilder.cs
- WindowsPrincipal.cs
- DllNotFoundException.cs
- FlowNode.cs
- XmlLinkedNode.cs
- TailCallAnalyzer.cs
- CompensableActivity.cs
- DataTransferEventArgs.cs
- BindingManagerDataErrorEventArgs.cs
- ErrorEventArgs.cs
- LogPolicy.cs
- AttributedMetaModel.cs
- UrlEncodedParameterWriter.cs
- ClientCultureInfo.cs
- AutomationElementIdentifiers.cs
- ApplicationSecurityInfo.cs
- SmtpLoginAuthenticationModule.cs
- XmlWrappingReader.cs
- CodeTypeDelegate.cs
- OperationCanceledException.cs
- Cursor.cs
- ToolboxComponentsCreatingEventArgs.cs
- XpsFixedDocumentReaderWriter.cs
- _ConnectionGroup.cs
- CodeTypeReference.cs
- SoapAttributes.cs
- ConfigurationFileMap.cs
- HttpHandlerAction.cs
- BitmapFrame.cs
- XmlElementList.cs
- ServiceElement.cs
- ConnectionPoolManager.cs
- ToolStripSettings.cs
- DataSourceNameHandler.cs
- FixedTextView.cs
- SmtpNegotiateAuthenticationModule.cs
- ExtensionDataObject.cs
- WebEventCodes.cs
- ActivityBindForm.Designer.cs
- SHA1.cs
- PathSegmentCollection.cs
- CreatingCookieEventArgs.cs
- PageClientProxyGenerator.cs
- ComboBoxDesigner.cs
- Stack.cs
- SplitterEvent.cs
- IDQuery.cs
- ToolStripPanel.cs
- PartialArray.cs
- TranslateTransform.cs
- GraphicsState.cs
- SignedInfo.cs
- connectionpool.cs
- LookupNode.cs
- CultureTableRecord.cs
- WindowsClientElement.cs
- DefaultEventAttribute.cs
- CodeTypeDeclaration.cs
- CodeAccessSecurityEngine.cs
- WindowPattern.cs
- GridView.cs
- MetadataWorkspace.cs
- Msmq.cs
- Control.cs
- BinaryNode.cs
- StateFinalizationDesigner.cs
- SqlRecordBuffer.cs
- LinqDataSourceDisposeEventArgs.cs
- SerialReceived.cs
- WindowsFormsHost.cs
- SchemaImporterExtensionElementCollection.cs
- control.ime.cs
- TypeExtensionSerializer.cs
- RSATokenProvider.cs
- ApplicationSecurityInfo.cs
- SqlProviderServices.cs
- _NtlmClient.cs
- GetMemberBinder.cs
- WSFederationHttpSecurityMode.cs
- PlacementWorkspace.cs
- Int32Rect.cs
- PageAdapter.cs
- CommonDialog.cs
- HttpClientChannel.cs
- SqlCommandAsyncResult.cs
- InProcStateClientManager.cs
- DynamicPropertyReader.cs
- FileVersionInfo.cs
- ParameterModifier.cs
- LayoutManager.cs
- RestHandlerFactory.cs
- RequestCachePolicy.cs
- DependencyObject.cs
- BinaryObjectWriter.cs
- TreeViewDesigner.cs
- _ContextAwareResult.cs
- QueryCacheEntry.cs
- AutoResizedEvent.cs