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
- List.cs
- ErrorHandlerModule.cs
- JournalEntryListConverter.cs
- SingleSelectRootGridEntry.cs
- ProcessThreadCollection.cs
- BevelBitmapEffect.cs
- MtomMessageEncodingElement.cs
- CodeCatchClauseCollection.cs
- DataSourceCache.cs
- DispatchChannelSink.cs
- DescendentsWalkerBase.cs
- SortableBindingList.cs
- Funcletizer.cs
- Int32AnimationBase.cs
- ListItemConverter.cs
- Unit.cs
- RoleServiceManager.cs
- SerializationHelper.cs
- ProfileService.cs
- HMAC.cs
- BitmapEditor.cs
- XmlReader.cs
- ParserHooks.cs
- DirectionalLight.cs
- AmbiguousMatchException.cs
- MasterPageBuildProvider.cs
- ToolStripDropDownClosingEventArgs.cs
- CodeGenerator.cs
- SmtpDigestAuthenticationModule.cs
- ByteStreamGeometryContext.cs
- RegexCharClass.cs
- ButtonBase.cs
- DbConnectionPoolGroup.cs
- MediaScriptCommandRoutedEventArgs.cs
- GridSplitter.cs
- bidPrivateBase.cs
- ProvidersHelper.cs
- EntityDataReader.cs
- LabelEditEvent.cs
- Maps.cs
- XPathNodeList.cs
- TypeValidationEventArgs.cs
- GacUtil.cs
- XmlCollation.cs
- Merger.cs
- WsatRegistrationHeader.cs
- ErrorFormatter.cs
- RelationshipConstraintValidator.cs
- SyndicationSerializer.cs
- ApplyHostConfigurationBehavior.cs
- DefaultPrintController.cs
- MemoryMappedViewAccessor.cs
- XmlWrappingReader.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- TypeSemantics.cs
- DataSourceCacheDurationConverter.cs
- TextEmbeddedObject.cs
- MembershipPasswordException.cs
- PeerContact.cs
- PreProcessInputEventArgs.cs
- FormViewModeEventArgs.cs
- HtmlInputHidden.cs
- FileDetails.cs
- FormattedText.cs
- ColorConverter.cs
- CodeCompileUnit.cs
- LowerCaseStringConverter.cs
- ReflectionUtil.cs
- ProfessionalColorTable.cs
- GridViewColumnHeaderAutomationPeer.cs
- InvalidFilterCriteriaException.cs
- PageTheme.cs
- WebPartPersonalization.cs
- DataControlFieldCell.cs
- Scene3D.cs
- CurrentChangingEventManager.cs
- SerializationStore.cs
- CodeIndexerExpression.cs
- Point.cs
- DefaultConfirmation.cs
- RenderOptions.cs
- MetadataException.cs
- UIHelper.cs
- SystemThemeKey.cs
- IProvider.cs
- Resources.Designer.cs
- CodeAssignStatement.cs
- WebPartMinimizeVerb.cs
- ScalarConstant.cs
- TraceRecord.cs
- RichTextBoxAutomationPeer.cs
- PrePostDescendentsWalker.cs
- SiteMap.cs
- LayoutTableCell.cs
- TaiwanLunisolarCalendar.cs
- PingReply.cs
- SiblingIterators.cs
- MSAAWinEventWrap.cs
- TextBounds.cs
- ResourcePermissionBaseEntry.cs