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
- DSASignatureFormatter.cs
- WeakReference.cs
- InternalConfigEventArgs.cs
- GPRECT.cs
- DummyDataSource.cs
- AppDomainProtocolHandler.cs
- PackUriHelper.cs
- ToolStripStatusLabel.cs
- PerformanceCounter.cs
- CompositeControl.cs
- Maps.cs
- UIElementParagraph.cs
- ButtonFieldBase.cs
- EntityStoreSchemaGenerator.cs
- ObjectStorage.cs
- SafeThemeHandle.cs
- SystemWebExtensionsSectionGroup.cs
- MarshalByRefObject.cs
- HtmlInputCheckBox.cs
- HashHelpers.cs
- RawStylusInputCustomData.cs
- CapabilitiesPattern.cs
- RegistrationProxy.cs
- RegexRunner.cs
- IntegerValidator.cs
- DefaultAssemblyResolver.cs
- COM2TypeInfoProcessor.cs
- TimeStampChecker.cs
- HostingEnvironmentSection.cs
- AssemblyEvidenceFactory.cs
- KeyFrames.cs
- InvalidOperationException.cs
- AttributedMetaModel.cs
- formatter.cs
- ProviderBase.cs
- ReflectionPermission.cs
- MultipartIdentifier.cs
- IndependentlyAnimatedPropertyMetadata.cs
- EmptyEnumerator.cs
- FragmentQuery.cs
- GiveFeedbackEventArgs.cs
- WmlLabelAdapter.cs
- GestureRecognizer.cs
- ServicePointManagerElement.cs
- MediaTimeline.cs
- SQLString.cs
- DefaultMemberAttribute.cs
- EventKeyword.cs
- SizeChangedInfo.cs
- DeviceContext2.cs
- CodeDOMProvider.cs
- StylusPointPropertyUnit.cs
- XmlAttributeCollection.cs
- PriorityBinding.cs
- RadioButtonAutomationPeer.cs
- LinkedResourceCollection.cs
- TextModifier.cs
- AdCreatedEventArgs.cs
- TabItem.cs
- ApplicationSettingsBase.cs
- Byte.cs
- DetailsViewPagerRow.cs
- FrameworkObject.cs
- AppDomainManager.cs
- DefaultValueConverter.cs
- ObfuscateAssemblyAttribute.cs
- SoapIgnoreAttribute.cs
- DataGridAddNewRow.cs
- CodeSubDirectoriesCollection.cs
- ClockGroup.cs
- XmlIterators.cs
- EntryIndex.cs
- SqlTransaction.cs
- HtmlGenericControl.cs
- UpdateExpressionVisitor.cs
- GenericIdentity.cs
- UInt64Storage.cs
- RtfControlWordInfo.cs
- ListViewDataItem.cs
- RtfToken.cs
- VBIdentifierName.cs
- UserControlParser.cs
- Classification.cs
- DigitShape.cs
- ReverseInheritProperty.cs
- BaseValidator.cs
- ReachDocumentReferenceCollectionSerializerAsync.cs
- HttpContext.cs
- ResourceDescriptionAttribute.cs
- XmlSiteMapProvider.cs
- SmiContext.cs
- HorizontalAlignConverter.cs
- DataSourceControl.cs
- QilValidationVisitor.cs
- ConvertersCollection.cs
- TextOptionsInternal.cs
- DescendentsWalker.cs
- TableLayoutStyleCollection.cs
- PromptBuilder.cs
- ZipIOExtraField.cs