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
- OdbcConnectionPoolProviderInfo.cs
- XPathDocumentBuilder.cs
- TypeToArgumentTypeConverter.cs
- ValueCollectionParameterReader.cs
- InstanceContextManager.cs
- PersonalizationStateInfoCollection.cs
- SqlFactory.cs
- HighlightVisual.cs
- ColorAnimation.cs
- HybridCollection.cs
- GridViewColumnCollection.cs
- WebPartPersonalization.cs
- XmlTextWriter.cs
- PartitionerQueryOperator.cs
- XmlSchemaComplexType.cs
- InheritanceAttribute.cs
- BitmapImage.cs
- TdsParserStaticMethods.cs
- LinkDescriptor.cs
- ListCardsInFileRequest.cs
- CodeThrowExceptionStatement.cs
- SerializationAttributes.cs
- KeyInterop.cs
- PublisherMembershipCondition.cs
- ToolBar.cs
- DataKeyArray.cs
- DrawListViewSubItemEventArgs.cs
- SystemSounds.cs
- AccessDataSourceDesigner.cs
- CapabilitiesSection.cs
- DeclarativeExpressionConditionDeclaration.cs
- CollectionConverter.cs
- TrackingCondition.cs
- X509RawDataKeyIdentifierClause.cs
- SettingsProperty.cs
- ScrollableControl.cs
- TransportSecurityProtocol.cs
- BamlResourceDeserializer.cs
- GeometryConverter.cs
- CodeComment.cs
- XMLUtil.cs
- DefaultTypeArgumentAttribute.cs
- EmptyImpersonationContext.cs
- XmlSchemaAttributeGroup.cs
- WebBodyFormatMessageProperty.cs
- ServiceHttpModule.cs
- WindowsGraphicsCacheManager.cs
- SoapIgnoreAttribute.cs
- OleDbConnection.cs
- WebBrowserUriTypeConverter.cs
- TcpChannelHelper.cs
- ProcessHostConfigUtils.cs
- DropShadowBitmapEffect.cs
- _SslStream.cs
- SqlUnionizer.cs
- ParseNumbers.cs
- NullableDoubleAverageAggregationOperator.cs
- LocatorPart.cs
- XmlIncludeAttribute.cs
- EncryptedType.cs
- SafeEventLogReadHandle.cs
- ProxyWebPartManager.cs
- StorageEntityTypeMapping.cs
- DesignerProperties.cs
- Profiler.cs
- SelectionEditor.cs
- UnionExpr.cs
- FilePrompt.cs
- Matrix3DStack.cs
- MethodSet.cs
- FlowPosition.cs
- MaskedTextBox.cs
- SoapSchemaMember.cs
- SystemIPInterfaceStatistics.cs
- DetailsViewUpdateEventArgs.cs
- BaseParaClient.cs
- HttpModuleActionCollection.cs
- IERequestCache.cs
- PublisherIdentityPermission.cs
- ListBindableAttribute.cs
- TypedCompletedAsyncResult.cs
- DataSourceControl.cs
- User.cs
- SqlNode.cs
- BuildProviderCollection.cs
- WorkflowItemsPresenter.cs
- AutomationPatternInfo.cs
- PageClientProxyGenerator.cs
- TimeSpanSecondsConverter.cs
- ProcessHostFactoryHelper.cs
- StateFinalizationDesigner.cs
- UnknownBitmapEncoder.cs
- DataBoundControlHelper.cs
- SqlDataSourceQueryEditor.cs
- CompilerErrorCollection.cs
- ExpressionNormalizer.cs
- ExpressionParser.cs
- TemplateColumn.cs
- ExpressionBuilder.cs
- ClientScriptManager.cs