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
- DataGridViewHitTestInfo.cs
- UserPreferenceChangedEventArgs.cs
- IPHostEntry.cs
- SQLCharsStorage.cs
- AttributeSetAction.cs
- TableLayoutStyleCollection.cs
- Timer.cs
- LightweightCodeGenerator.cs
- SessionIDManager.cs
- LogEntryDeserializer.cs
- PropertyPath.cs
- ChangeConflicts.cs
- BookmarkOptionsHelper.cs
- UnSafeCharBuffer.cs
- ProxyAssemblyNotLoadedException.cs
- InstanceData.cs
- ImpersonateTokenRef.cs
- dbenumerator.cs
- XmlReaderSettings.cs
- SystemResourceHost.cs
- Point3DAnimationUsingKeyFrames.cs
- DataTableTypeConverter.cs
- ResourcePermissionBaseEntry.cs
- ToolStripProgressBar.cs
- LeftCellWrapper.cs
- SetStoryboardSpeedRatio.cs
- OutOfMemoryException.cs
- EndpointDispatcherTable.cs
- diagnosticsswitches.cs
- BamlLocalizableResource.cs
- Slider.cs
- Pair.cs
- InvalidOleVariantTypeException.cs
- DependencyPropertyKind.cs
- TextTreeUndoUnit.cs
- ObjectDataSourceEventArgs.cs
- ExtensibleClassFactory.cs
- OpenTypeLayout.cs
- TraceLevelHelper.cs
- PrimitiveDataContract.cs
- XomlSerializationHelpers.cs
- ChildrenQuery.cs
- RemoteWebConfigurationHostServer.cs
- Inline.cs
- MeasureItemEvent.cs
- SqlCaseSimplifier.cs
- ProfileEventArgs.cs
- DispatchWrapper.cs
- _Events.cs
- EntityTransaction.cs
- TreeNodeStyle.cs
- CopyAction.cs
- BindingNavigator.cs
- WSHttpBindingBase.cs
- ListControlConvertEventArgs.cs
- UInt16Converter.cs
- CombinedGeometry.cs
- ObjectViewListener.cs
- arclist.cs
- Vector3DConverter.cs
- DesignerActionUIService.cs
- EntityViewGenerationAttribute.cs
- TableSectionStyle.cs
- ScrollableControlDesigner.cs
- Exception.cs
- BCLDebug.cs
- DynamicValidatorEventArgs.cs
- WorkflowServiceHostFactory.cs
- AsyncPostBackErrorEventArgs.cs
- PathSegment.cs
- SendSecurityHeaderElement.cs
- FindCriteriaElement.cs
- DockPanel.cs
- AnnouncementDispatcherAsyncResult.cs
- NetCodeGroup.cs
- DocumentReference.cs
- PagesChangedEventArgs.cs
- LogArchiveSnapshot.cs
- DataGridViewRowsAddedEventArgs.cs
- ActivationArguments.cs
- CompilerTypeWithParams.cs
- IPGlobalProperties.cs
- Types.cs
- Token.cs
- TileModeValidation.cs
- SqlDataRecord.cs
- URLIdentityPermission.cs
- RenderData.cs
- propertyentry.cs
- EnvelopedSignatureTransform.cs
- EntityDesignerUtils.cs
- EventProviderBase.cs
- ReleaseInstanceMode.cs
- SweepDirectionValidation.cs
- RuntimeConfig.cs
- FieldTemplateUserControl.cs
- RegisteredExpandoAttribute.cs
- Italic.cs
- StringValidator.cs
- Soap.cs