Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / Effects / BlurBitmapEffect.cs / 1407647 / BlurBitmapEffect.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2005 // // File: BlurBitmapEffect.cs //----------------------------------------------------------------------------- using MS.Internal; using System; using System.IO; 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.Markup; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using MS.Internal.PresentationCore; using System.Security; namespace System.Windows.Media.Effects { ////// BlurBitmapEffectPrimitive /// public sealed partial class BlurBitmapEffect : BitmapEffect { ////// Constructor /// public BlurBitmapEffect() { } ////// Creates the unmanaged effect handle /// ////// Critical - returns a security critical type SafeHandle. /// Safe - Always returns null. /// [SecuritySafeCritical] [Obsolete(MS.Internal.Media.VisualTreeUtils.BitmapEffectObsoleteMessage)] unsafe protected override SafeHandle CreateUnmanagedEffect() { return null; } ////// Update (propagetes) properties to the unmanaged effect /// ////// This method demands permission because effects should not be run /// in partial trust. /// /// SecurityCritical - because SetValue has a link demand /// SecutiryTreatAsSafe - because it demans UIWindow permission /// [SecurityCritical, SecurityTreatAsSafe] [Obsolete(MS.Internal.Media.VisualTreeUtils.BitmapEffectObsoleteMessage)] protected override void UpdateUnmanagedPropertyState(SafeHandle unmanagedEffect) { SecurityHelper.DemandUIWindowPermission(); } ////// An ImageEffect can be used to emulate a BlurBitmapEffect with certain restrictions. This /// method returns true when it is possible to emulate the BlurBitmapEffect using an ImageEffect. /// internal override bool CanBeEmulatedUsingEffectPipeline() { return (Radius <= 100.0); } ////// Returns a Effect that emulates this BlurBitmapEffect. /// internal override Effect GetEmulatingEffect() { if (_imageEffectEmulation != null && _imageEffectEmulation.IsFrozen) { return _imageEffectEmulation; } if (_imageEffectEmulation == null) { _imageEffectEmulation = new BlurEffect(); } double radius = Radius; if (_imageEffectEmulation.Radius != radius) { _imageEffectEmulation.Radius = radius; } KernelType kernelType = KernelType; if (_imageEffectEmulation.KernelType != kernelType) { _imageEffectEmulation.KernelType = kernelType; } _imageEffectEmulation.RenderingBias = RenderingBias.Performance; if (this.IsFrozen) { _imageEffectEmulation.Freeze(); } return _imageEffectEmulation; } BlurEffect _imageEffectEmulation; } } // 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
- TdsParser.cs
- SafeRightsManagementQueryHandle.cs
- COM2Enum.cs
- AsyncDataRequest.cs
- XmlUTF8TextWriter.cs
- CalendarDay.cs
- RuntimeConfig.cs
- XmlQueryStaticData.cs
- DataTrigger.cs
- PixelShader.cs
- SimpleHandlerBuildProvider.cs
- SmiMetaDataProperty.cs
- HtmlImage.cs
- DataGridViewRowPostPaintEventArgs.cs
- WindowCollection.cs
- WebPermission.cs
- SchemaDeclBase.cs
- ToolStripManager.cs
- CodeCompiler.cs
- OperatorExpressions.cs
- LazyLoadBehavior.cs
- MimeReturn.cs
- ClockController.cs
- ScriptManagerProxy.cs
- BuildManager.cs
- BypassElement.cs
- ArgumentReference.cs
- RepeaterItemCollection.cs
- ToolStripPanelRow.cs
- StyleCollectionEditor.cs
- FormattedText.cs
- ImageDesigner.cs
- EncodingNLS.cs
- CookieProtection.cs
- SQlBooleanStorage.cs
- IdentityHolder.cs
- SiteIdentityPermission.cs
- XmlDataSource.cs
- ServiceEndpointCollection.cs
- Camera.cs
- SqlBinder.cs
- ValidationSummary.cs
- DataGridAddNewRow.cs
- ColorPalette.cs
- PartitionResolver.cs
- SoapEnvelopeProcessingElement.cs
- Point3DConverter.cs
- EndpointDispatcherTable.cs
- ErrorItem.cs
- MenuItem.cs
- DataObjectMethodAttribute.cs
- BinaryMethodMessage.cs
- CurrentChangedEventManager.cs
- ZipIOExtraFieldElement.cs
- ZipIOExtraFieldZip64Element.cs
- VectorCollectionConverter.cs
- DaylightTime.cs
- DefaultValidator.cs
- ReachDocumentReferenceSerializer.cs
- AgileSafeNativeMemoryHandle.cs
- DbProviderServices.cs
- FileDataSourceCache.cs
- XmlChoiceIdentifierAttribute.cs
- TableLayoutRowStyleCollection.cs
- Timer.cs
- ChtmlTextWriter.cs
- DynamicObject.cs
- AccessKeyManager.cs
- EllipticalNodeOperations.cs
- GridViewRowEventArgs.cs
- UnsafeNativeMethods.cs
- DataKey.cs
- DataSourceBooleanViewSchemaConverter.cs
- InputDevice.cs
- ToolStrip.cs
- ConstraintCollection.cs
- DoubleConverter.cs
- ProviderCollection.cs
- FullTextState.cs
- ColumnCollection.cs
- TablePattern.cs
- Helper.cs
- InvariantComparer.cs
- ipaddressinformationcollection.cs
- EventLogEntryCollection.cs
- DesignerGenericWebPart.cs
- RegistryPermission.cs
- TrackPointCollection.cs
- PriorityQueue.cs
- SevenBitStream.cs
- PropertyGroupDescription.cs
- XpsFilter.cs
- LineSegment.cs
- SqlClientFactory.cs
- Rfc2898DeriveBytes.cs
- MaskDesignerDialog.cs
- PreservationFileReader.cs
- SettingsPropertyWrongTypeException.cs
- CategoryAttribute.cs
- FormattedTextSymbols.cs