SecurityException in AlignedImage.GetPixelOffset

Oct 13, 2009 at 3:36 AM

If you take a look at AlignedImage.GetPixelOffset, the line ps = PresentationSource.FromVisual(this); is wrapped in a try...catch and I have a case where the System.Security.SecurityException is being thrown and the performance penalty is really bad.

For now I've just commented out that line, and my application seems to work fine.  Can someone tell me what this line does?  Is there a way we can put a condition around it so that it doesn't call it if it's likely to throw the exception, or at least if we don't need to call it?

- Scott