views:

13

answers:

0

I'm developing an application in VB.Net using Managed DirectX that runs in windowed mode and renders onto a picture box that is smaller than the form.

Whenever I resize the form, the back buffer is streched to fit the picture box. This is not what I would like.

The backbuffer size is the same as screen size, however, I only want to render a part of the back buffer, whose size is controlled by the size of the picture box into which I'm rendering.

Resetting the device with new presentation parameters is something I would like to avoid.

I'm aware that I can use an overload of Device.Present if I set the swap effect to copy, but this doesn't allow me to use Multi Sample Anti Alias (which requires the Discard swap effect). It seems to me that the overload Device.Present is not usable with any other swap effect than copy, and throws an exception.

An other alternative I considered is the PresentFlags.DeviceClip, however it seems that it works only for Windows XP. I'm using Windows 7 and it doesn't seem to be doing anything.

So, is it even possible that I use anti-aliasing in this situation?