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
- ShapingEngine.cs
- UrlAuthorizationModule.cs
- XmlResolver.cs
- CompilationUnit.cs
- LowerCaseStringConverter.cs
- DesignerActionUIStateChangeEventArgs.cs
- OverrideMode.cs
- HttpServerUtilityBase.cs
- SystemUdpStatistics.cs
- TextStore.cs
- CodeIndexerExpression.cs
- RegistryKey.cs
- UdpAnnouncementEndpoint.cs
- XmlDataSourceView.cs
- MarginsConverter.cs
- SqlAggregateChecker.cs
- SQLMoneyStorage.cs
- AssemblyName.cs
- rsa.cs
- SQLString.cs
- ListViewGroupItemCollection.cs
- FrameworkContextData.cs
- MediaEntryAttribute.cs
- ProcessHostConfigUtils.cs
- PageStatePersister.cs
- StringSorter.cs
- ZipArchive.cs
- GridViewDeletedEventArgs.cs
- RbTree.cs
- AdornerLayer.cs
- ProfileParameter.cs
- StickyNoteHelper.cs
- WebPartEditorApplyVerb.cs
- EastAsianLunisolarCalendar.cs
- SystemIPGlobalProperties.cs
- QueryCacheManager.cs
- StorageEndPropertyMapping.cs
- WorkflowItemPresenter.cs
- AlphabeticalEnumConverter.cs
- WindowsRebar.cs
- LogLogRecordEnumerator.cs
- CompiledELinqQueryState.cs
- DesignerSerializerAttribute.cs
- SRGSCompiler.cs
- UpdateCommand.cs
- ArithmeticLiteral.cs
- ExtensionDataReader.cs
- ValueUtilsSmi.cs
- StructuredTypeEmitter.cs
- VirtualPathExtension.cs
- ComPlusTypeValidator.cs
- Decoder.cs
- ExpressionParser.cs
- SafeHandle.cs
- HMACRIPEMD160.cs
- WebPartUtil.cs
- CodeMethodInvokeExpression.cs
- CompressionTracing.cs
- DoubleCollectionValueSerializer.cs
- Helpers.cs
- DBCSCodePageEncoding.cs
- PerformanceCounterLib.cs
- Lazy.cs
- ClientSession.cs
- CodeBlockBuilder.cs
- WebPartEditVerb.cs
- FormatVersion.cs
- DataGridTextColumn.cs
- Predicate.cs
- TextEditorParagraphs.cs
- XsdDataContractExporter.cs
- AccessorTable.cs
- ItemType.cs
- TextEditorContextMenu.cs
- CacheDependency.cs
- Paragraph.cs
- CellParaClient.cs
- ClientCultureInfo.cs
- InternalRelationshipCollection.cs
- dataprotectionpermission.cs
- AutomationIdentifier.cs
- CustomAttribute.cs
- bindurihelper.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- DrawingCollection.cs
- MSAAEventDispatcher.cs
- sqlser.cs
- CompModSwitches.cs
- DataSetSchema.cs
- PositiveTimeSpanValidator.cs
- Native.cs
- DecoratedNameAttribute.cs
- SchemaAttDef.cs
- VisualTreeUtils.cs
- HtmlUtf8RawTextWriter.cs
- ReaderContextStackData.cs
- TraceFilter.cs
- ChildrenQuery.cs
- GestureRecognizer.cs
- List.cs