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
- RelativeSource.cs
- UriSection.cs
- AuthenticationService.cs
- SqlDataRecord.cs
- Rect.cs
- TextTreeTextNode.cs
- PersianCalendar.cs
- TransformerConfigurationWizardBase.cs
- IndicShape.cs
- DiscoveryDefaults.cs
- sitestring.cs
- CompatibleIComparer.cs
- AsyncContentLoadedEventArgs.cs
- ReadOnlyCollectionBase.cs
- BaseParser.cs
- NamedPermissionSet.cs
- ToolStripGrip.cs
- BaseProcessProtocolHandler.cs
- XmlLanguageConverter.cs
- Pair.cs
- TargetControlTypeCache.cs
- PathFigureCollection.cs
- MeasurementDCInfo.cs
- DataRelationPropertyDescriptor.cs
- TextEditorSelection.cs
- XmlSchemaExporter.cs
- GridErrorDlg.cs
- MimeTypePropertyAttribute.cs
- RegexGroupCollection.cs
- WeakReferenceEnumerator.cs
- DataGridLinkButton.cs
- TypeUnloadedException.cs
- WebFormDesignerActionService.cs
- Vector3DAnimationUsingKeyFrames.cs
- DateTimeSerializationSection.cs
- safelink.cs
- DeviceSpecificDesigner.cs
- CursorConverter.cs
- ReadingWritingEntityEventArgs.cs
- ResourceDictionaryCollection.cs
- Blend.cs
- SemanticBasicElement.cs
- Vector.cs
- CheckBoxAutomationPeer.cs
- Bezier.cs
- HandlerWithFactory.cs
- BamlLocalizableResource.cs
- ConfigurationStrings.cs
- TcpTransportElement.cs
- FileLogRecordHeader.cs
- DataControlImageButton.cs
- BaseValidator.cs
- MetadataUtil.cs
- CursorConverter.cs
- ToolboxItemSnapLineBehavior.cs
- HtmlInputImage.cs
- AudioStateChangedEventArgs.cs
- Decimal.cs
- SafeNativeMethods.cs
- LassoSelectionBehavior.cs
- BufferAllocator.cs
- UrlParameterReader.cs
- ClientApiGenerator.cs
- Light.cs
- RemotingSurrogateSelector.cs
- MimeMapping.cs
- NativeMethods.cs
- DesignerActionHeaderItem.cs
- FlowLayoutPanel.cs
- Attributes.cs
- ThreadExceptionEvent.cs
- ConnectionManagementSection.cs
- VirtualPathUtility.cs
- XmlProcessingInstruction.cs
- UnsafeNativeMethods.cs
- SupportingTokenParameters.cs
- CommandBinding.cs
- LineSegment.cs
- PrivilegedConfigurationManager.cs
- ReservationCollection.cs
- DataListComponentEditor.cs
- Panel.cs
- StringPropertyBuilder.cs
- LinqDataSourceUpdateEventArgs.cs
- AttributeCollection.cs
- KeyTime.cs
- ObjectCacheHost.cs
- AddInSegmentDirectoryNotFoundException.cs
- SoapExtensionReflector.cs
- Path.cs
- SafeFileHandle.cs
- XmlEventCache.cs
- FileLogRecordHeader.cs
- TextProperties.cs
- BinHexEncoder.cs
- DesignerTransaction.cs
- IteratorFilter.cs
- EventMappingSettingsCollection.cs
- UnionCqlBlock.cs
- ChannelOptions.cs