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
- MultiView.cs
- DataPointer.cs
- CallId.cs
- UserControl.cs
- SoapInteropTypes.cs
- Int16Converter.cs
- DataGridViewRowStateChangedEventArgs.cs
- LocalizabilityAttribute.cs
- SmiConnection.cs
- PnrpPeerResolver.cs
- ClientBuildManagerCallback.cs
- RenderingBiasValidation.cs
- ClonableStack.cs
- EdmToObjectNamespaceMap.cs
- DataGridViewImageCell.cs
- ConstraintCollection.cs
- IDReferencePropertyAttribute.cs
- HMACMD5.cs
- UserPersonalizationStateInfo.cs
- DataTemplateKey.cs
- InvalidCastException.cs
- HijriCalendar.cs
- ObjectStateFormatter.cs
- _PooledStream.cs
- SqlNotificationEventArgs.cs
- MetadataProperty.cs
- SoapHeaderAttribute.cs
- DesignerAdapterUtil.cs
- InvalidComObjectException.cs
- DeviceSpecific.cs
- PageBreakRecord.cs
- RowParagraph.cs
- SHA1.cs
- OutKeywords.cs
- IgnoreFileBuildProvider.cs
- EdmEntityTypeAttribute.cs
- DataGridCellAutomationPeer.cs
- CmsUtils.cs
- ObjectItemCollection.cs
- CompositeFontInfo.cs
- XmlDownloadManager.cs
- SymbolTable.cs
- ComponentChangedEvent.cs
- PropertyMetadata.cs
- EventItfInfo.cs
- HttpCacheVary.cs
- RankException.cs
- FuncTypeConverter.cs
- PseudoWebRequest.cs
- AuthenticationSection.cs
- AuthenticationServiceManager.cs
- SatelliteContractVersionAttribute.cs
- RightsManagementInformation.cs
- Filter.cs
- DynamicEndpointElement.cs
- HostingEnvironmentException.cs
- DataControlImageButton.cs
- Debug.cs
- ApplicationDirectoryMembershipCondition.cs
- DrawListViewSubItemEventArgs.cs
- DBCommandBuilder.cs
- SerializationException.cs
- XmlTextAttribute.cs
- X500Name.cs
- HwndStylusInputProvider.cs
- TypefaceMap.cs
- _HeaderInfoTable.cs
- RootDesignerSerializerAttribute.cs
- XXXInfos.cs
- sqlser.cs
- FtpWebResponse.cs
- SQlBooleanStorage.cs
- Marshal.cs
- AsymmetricSignatureDeformatter.cs
- DesignTimeHTMLTextWriter.cs
- ToolStripDropTargetManager.cs
- Duration.cs
- RequestNavigateEventArgs.cs
- SubstitutionList.cs
- DriveInfo.cs
- ImportContext.cs
- QueryParameter.cs
- dbdatarecord.cs
- Tag.cs
- ToolZoneDesigner.cs
- XmlAnyElementAttributes.cs
- WeakEventManager.cs
- MessageDecoder.cs
- MatrixConverter.cs
- MetabaseSettings.cs
- InternalCache.cs
- XmlWriterSettings.cs
- SimpleHandlerFactory.cs
- ServiceOperationParameter.cs
- SoapInteropTypes.cs
- WebAdminConfigurationHelper.cs
- Utility.cs
- UpWmlMobileTextWriter.cs
- _AutoWebProxyScriptWrapper.cs
- ping.cs