I am using RenderTargetBitmap to render an image which is causing an outofmemory exception. Is there a way to catch that exception so that i can safely exit and tell the user that it was not possible to render the image...instead of crashing the client?
(MemoryStream imageStream = doSomething())
public Stream doSomething()
{ return renderTarget.Render(); // This is causing the exception }