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
- InkCanvas.cs
- SafeEventLogReadHandle.cs
- CheckoutException.cs
- RelationshipDetailsRow.cs
- ISAPIApplicationHost.cs
- AutomationElement.cs
- TextServicesDisplayAttribute.cs
- SiteOfOriginContainer.cs
- LinqDataSourceStatusEventArgs.cs
- TypeExtension.cs
- LayoutDump.cs
- DispatchRuntime.cs
- BitmapMetadataEnumerator.cs
- DeviceOverridableAttribute.cs
- Menu.cs
- TempFiles.cs
- CheckBoxBaseAdapter.cs
- FormViewInsertedEventArgs.cs
- securestring.cs
- ConfigurationElementCollection.cs
- XmlDeclaration.cs
- DynamicResourceExtension.cs
- DataGridRow.cs
- InputScopeAttribute.cs
- _UncName.cs
- Block.cs
- RealizationDrawingContextWalker.cs
- DeliveryRequirementsAttribute.cs
- DataGridTableCollection.cs
- WebPartEditorCancelVerb.cs
- UInt32Converter.cs
- XmlSiteMapProvider.cs
- DBCSCodePageEncoding.cs
- SimpleTableProvider.cs
- FilterableAttribute.cs
- ExpressionReplacer.cs
- RegisteredHiddenField.cs
- CompilationUtil.cs
- DependencyPropertyAttribute.cs
- MembershipValidatePasswordEventArgs.cs
- CursorConverter.cs
- SplineKeyFrames.cs
- ToolStripStatusLabel.cs
- dbenumerator.cs
- PerspectiveCamera.cs
- MetadataArtifactLoaderResource.cs
- ReachSerializationUtils.cs
- MgmtConfigurationRecord.cs
- TriState.cs
- SQLBinary.cs
- EntityDataSourceDataSelection.cs
- ProviderCommandInfoUtils.cs
- ColorContext.cs
- ModelTreeEnumerator.cs
- FormViewInsertEventArgs.cs
- MDIWindowDialog.cs
- DataGridViewColumnHeaderCell.cs
- DesignerDataView.cs
- XmlDocumentFragment.cs
- PhysicalFontFamily.cs
- EventProperty.cs
- CharAnimationBase.cs
- GridViewDeletedEventArgs.cs
- NamespaceDecl.cs
- ToolStripRendererSwitcher.cs
- RootProfilePropertySettingsCollection.cs
- FormsAuthenticationUserCollection.cs
- CodeDefaultValueExpression.cs
- PenCursorManager.cs
- WebPartManagerInternals.cs
- StringReader.cs
- NativeMethods.cs
- FontStyle.cs
- CapiSafeHandles.cs
- DictionarySurrogate.cs
- TreeNode.cs
- EtwProvider.cs
- DynamicILGenerator.cs
- BrowserTree.cs
- MenuAutomationPeer.cs
- QueueSurrogate.cs
- InvalidAsynchronousStateException.cs
- HttpBindingExtension.cs
- SchemaTypeEmitter.cs
- EntityCommand.cs
- TypedReference.cs
- PersistChildrenAttribute.cs
- StaticSiteMapProvider.cs
- ChannelSinkStacks.cs
- MtomMessageEncodingElement.cs
- FileDetails.cs
- NullRuntimeConfig.cs
- MaskedTextBox.cs
- TableCellCollection.cs
- MatrixTransform.cs
- InkPresenter.cs
- ColumnWidthChangingEvent.cs
- HtmlHead.cs
- DataGridViewComboBoxCell.cs
- RemoteWebConfigurationHostStream.cs