Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / ImageBrush.cs / 1305600 / ImageBrush.cs
//---------------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // Description: This file contains the implementation of ImageBrush. // The ImageBrush is a TileBrush which defines its tile content // by use of an ImageSource. // // History: // // 04/29/2003 : [....] - Created it. // 01/19/2005 : timothyc - Removed SizeViewboxToContent. Moved UpdateResource // to the generated file. //--------------------------------------------------------------------------- using MS.Internal; using MS.Internal.PresentationCore; using System; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Diagnostics; using System.Reflection; 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; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// ImageBrush - This TileBrush defines its content as an Image /// public sealed partial class ImageBrush : TileBrush { #region Constructors ////// Default constructor for ImageBrush. The resulting Brush has no content. /// public ImageBrush() { // We do this so that the property, when read, is consistent - not that // this will every actually affect drawing. } ////// ImageBrush Constructor where the image is set to the parameter's value /// /// The image source. public ImageBrush(ImageSource image) { ImageSource = image; } #endregion Constructors #region Protected methods ////// Obtains the current bounds of the brush's content /// /// Output bounds of content protected override void GetContentBounds(out Rect contentBounds) { // Note, only implemented for DrawingImages. contentBounds = Rect.Empty; DrawingImage di = ImageSource as DrawingImage; if (di != null) { Drawing drawing = di.Drawing; if (drawing != null) { contentBounds = drawing.Bounds; } } } #endregion Protected methods } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AdornedElementPlaceholder.cs
- ConstrainedDataObject.cs
- SocketInformation.cs
- ReverseQueryOperator.cs
- ServiceInfo.cs
- AtomMaterializer.cs
- ValueQuery.cs
- UserNameSecurityTokenProvider.cs
- EventItfInfo.cs
- FixedSOMPageConstructor.cs
- WSTransactionSection.cs
- XmlSchemaProviderAttribute.cs
- ProgressiveCrcCalculatingStream.cs
- SqlError.cs
- XmlMtomReader.cs
- ButtonBase.cs
- DragCompletedEventArgs.cs
- TypeValidationEventArgs.cs
- RangeBase.cs
- AxisAngleRotation3D.cs
- DataGridRowHeaderAutomationPeer.cs
- x509store.cs
- Dictionary.cs
- UpWmlMobileTextWriter.cs
- OdbcDataReader.cs
- DateTimeOffset.cs
- ExeConfigurationFileMap.cs
- SystemParameters.cs
- HttpContext.cs
- DbConnectionClosed.cs
- SerializableTypeCodeDomSerializer.cs
- RegistryPermission.cs
- BitmapMetadataBlob.cs
- SuppressMessageAttribute.cs
- CodeDelegateInvokeExpression.cs
- DataTableReader.cs
- OverflowException.cs
- Group.cs
- PartialCachingControl.cs
- AlignmentXValidation.cs
- formatter.cs
- FormsAuthenticationUserCollection.cs
- StorageMappingFragment.cs
- MessagePropertyDescriptionCollection.cs
- AlignmentXValidation.cs
- ApplicationActivator.cs
- CookieProtection.cs
- HttpVersion.cs
- DefaultAuthorizationContext.cs
- NavigationExpr.cs
- SecuritySessionFilter.cs
- SiteOfOriginContainer.cs
- RemoteWebConfigurationHostServer.cs
- DataRowChangeEvent.cs
- ScriptingWebServicesSectionGroup.cs
- GraphicsContainer.cs
- DataGridViewHeaderCell.cs
- XmlSecureResolver.cs
- FormClosingEvent.cs
- DataSourceXmlTextReader.cs
- ContainerFilterService.cs
- SolidBrush.cs
- PeerOutputChannel.cs
- PartitionResolver.cs
- StretchValidation.cs
- EnumerableRowCollection.cs
- CodeNamespaceImport.cs
- AdapterUtil.cs
- SID.cs
- PropertyMapper.cs
- LocatorGroup.cs
- ForeignKeyConstraint.cs
- CodePageEncoding.cs
- TemplateParser.cs
- ELinqQueryState.cs
- wgx_commands.cs
- UnsafeNativeMethods.cs
- StateMachineHistory.cs
- _FtpControlStream.cs
- DataGridTextBoxColumn.cs
- ItemTypeToolStripMenuItem.cs
- FixUp.cs
- WithStatement.cs
- GenericTextProperties.cs
- TreeNode.cs
- ConnectionStringSettingsCollection.cs
- Win32MouseDevice.cs
- LabelInfo.cs
- NonVisualControlAttribute.cs
- SimplePropertyEntry.cs
- BaseResourcesBuildProvider.cs
- DeadCharTextComposition.cs
- WebServiceBindingAttribute.cs
- OdbcParameter.cs
- XmlLanguage.cs
- LZCodec.cs
- DataGridAddNewRow.cs
- DirectionalLight.cs
- SizeConverter.cs
- SurrogateDataContract.cs