Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Media / Effects / BitmapEffectDrawingContextState.cs / 1 / BitmapEffectDrawingContextState.cs
//----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: BitmapEffectDrawingContextState.cs
//
// Description: This file contains the implementation of BitmapEffectDrawingContextState.
// This renders a drawing visual using the BitmapVisualManager
//
// History:
// 07/25/2005 : [....] - Created it.
//
//---------------------------------------------------------------------------
using System;
using System.Windows.Threading;
using MS.Win32;
using System.Security;
using System.Security.Permissions;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Composition;
using System.Windows.Media.Imaging;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using MS.Internal;
using System.Resources;
using MS.Utility;
using System.Runtime.InteropServices;
using MS.Internal.PresentationCore;
using SR = MS.Internal.PresentationCore.SR;
using SRID = MS.Internal.PresentationCore.SRID;
namespace System.Windows.Media.Effects
{
internal class BitmapEffectDrawingContextState : BitmapEffectState
{
public DrawingContext Context
{
get { return _visualCtx; }
}
public BitmapEffectDrawingContextState(BitmapEffect effect, BitmapEffectInput effectInput)
{
_bitmapEffect = effect;
_bitmapEffectInput = effectInput;
_visual = new DrawingVisual();
_visualCtx = _visual.RenderOpen();
}
///
/// Render the drawing visual, apply the effect to it, and update the world
/// transform
///
///
///
///
internal BitmapSource RenderBitmapEffect(ref Matrix worldTransform, Rect windowClip)
{
if (_bitmapEffectInput == null)
{
_bitmapEffectInput = new BitmapEffectInput();
}
RenderTargetBitmap renderTarget = null;
return GetEffectOutput(_visual, ref renderTarget, worldTransform, windowClip, out worldTransform);
}
#region Private Fields
DrawingVisual _visual;
DrawingContext _visualCtx;
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// File: BitmapEffectDrawingContextState.cs
//
// Description: This file contains the implementation of BitmapEffectDrawingContextState.
// This renders a drawing visual using the BitmapVisualManager
//
// History:
// 07/25/2005 : [....] - Created it.
//
//---------------------------------------------------------------------------
using System;
using System.Windows.Threading;
using MS.Win32;
using System.Security;
using System.Security.Permissions;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Composition;
using System.Windows.Media.Imaging;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using MS.Internal;
using System.Resources;
using MS.Utility;
using System.Runtime.InteropServices;
using MS.Internal.PresentationCore;
using SR = MS.Internal.PresentationCore.SR;
using SRID = MS.Internal.PresentationCore.SRID;
namespace System.Windows.Media.Effects
{
internal class BitmapEffectDrawingContextState : BitmapEffectState
{
public DrawingContext Context
{
get { return _visualCtx; }
}
public BitmapEffectDrawingContextState(BitmapEffect effect, BitmapEffectInput effectInput)
{
_bitmapEffect = effect;
_bitmapEffectInput = effectInput;
_visual = new DrawingVisual();
_visualCtx = _visual.RenderOpen();
}
///
/// Render the drawing visual, apply the effect to it, and update the world
/// transform
///
///
///
///
internal BitmapSource RenderBitmapEffect(ref Matrix worldTransform, Rect windowClip)
{
if (_bitmapEffectInput == null)
{
_bitmapEffectInput = new BitmapEffectInput();
}
RenderTargetBitmap renderTarget = null;
return GetEffectOutput(_visual, ref renderTarget, worldTransform, windowClip, out worldTransform);
}
#region Private Fields
DrawingVisual _visual;
DrawingContext _visualCtx;
#endregion
}
}
// 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
- AutoGeneratedField.cs
- XPathNodeHelper.cs
- State.cs
- Message.cs
- TransformedBitmap.cs
- XmlSchemaAnnotation.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- Cursors.cs
- GeometryConverter.cs
- InputGestureCollection.cs
- DataGridViewCellCollection.cs
- RangeValuePattern.cs
- WFItemsToSpacerVisibility.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- Triplet.cs
- CodeRegionDirective.cs
- Quaternion.cs
- NonParentingControl.cs
- MouseEventArgs.cs
- CharacterString.cs
- DBPropSet.cs
- CheckBoxField.cs
- ProviderBase.cs
- TableLayoutPanelBehavior.cs
- DatagridviewDisplayedBandsData.cs
- WebBrowserHelper.cs
- SecurityElement.cs
- VolatileEnlistmentState.cs
- ThicknessKeyFrameCollection.cs
- SizeIndependentAnimationStorage.cs
- EncoderBestFitFallback.cs
- GridViewCommandEventArgs.cs
- BaseTreeIterator.cs
- UInt32.cs
- ValidateNames.cs
- EmbossBitmapEffect.cs
- SmtpCommands.cs
- DataGridViewMethods.cs
- HttpsChannelFactory.cs
- InkCanvasSelection.cs
- DocumentSequence.cs
- GeneralTransform3D.cs
- Variable.cs
- processwaithandle.cs
- InputMethod.cs
- ZipIOCentralDirectoryBlock.cs
- CompressStream.cs
- XmlNullResolver.cs
- EntityDataSourceSelectedEventArgs.cs
- Path.cs
- PaperSize.cs
- objectresult_tresulttype.cs
- Overlapped.cs
- UserMapPath.cs
- IPCCacheManager.cs
- TypeSystem.cs
- DragStartedEventArgs.cs
- ClientSettingsStore.cs
- CompilationSection.cs
- QuaternionKeyFrameCollection.cs
- ModelItem.cs
- COM2FontConverter.cs
- AdRotator.cs
- DefaultEvaluationContext.cs
- RtfToXamlLexer.cs
- ComboBoxAutomationPeer.cs
- HtmlValidationSummaryAdapter.cs
- SafeNativeMethods.cs
- ComplexPropertyEntry.cs
- Permission.cs
- LocalizationParserHooks.cs
- CompressedStack.cs
- BufferModeSettings.cs
- PropertyTabAttribute.cs
- GetPageNumberCompletedEventArgs.cs
- MissingMethodException.cs
- ParameterToken.cs
- ProjectionCamera.cs
- IndexedString.cs
- ProviderSettingsCollection.cs
- ConfigurationStrings.cs
- GridViewCancelEditEventArgs.cs
- HostElement.cs
- TouchPoint.cs
- RichTextBoxConstants.cs
- CodeArrayIndexerExpression.cs
- BaseInfoTable.cs
- SendingRequestEventArgs.cs
- RootBrowserWindowProxy.cs
- DynamicFilterExpression.cs
- WaveHeader.cs
- counter.cs
- SQLChars.cs
- ContentFilePart.cs
- RelationshipType.cs
- SqlSupersetValidator.cs
- ServicesUtilities.cs
- XmlSchemaIdentityConstraint.cs
- MarkerProperties.cs
- TileModeValidation.cs