[D3D] Magnifying part of the display and exporting print-resolution screenshots

Started by
2 comments, last by ET3D 16 years, 10 months ago
Hi All, 1) Is it possible with direct X to display a small area of the whole scene like a magnification lens? Suppose you have a 200x200 display screen and you want to display the rect x20, y20, width 50, height 50 to and fill the original 200x200 screen. In opengl is done using gluPickMatrix function. 2) Is it possible with direct X to save a bitmap of the scene with higher resolution than the display screen? I mean you have a scene on screen of 200x200 and want to produce a 2000x2000 image for printing a poster size image. Thanks so much, Alberto EDIT: Chose a better subject line for you. Please refer to the forum FAQ [Edited by - jollyjeffers on June 12, 2007 5:22:04 AM]
Advertisement
Firstly, please refer to the forum FAQ's with regards to picking a subject line. All three of your recent threads violate the guidelines here and, to be honest, I get a little tired of going in and editing threads. I'd appreciate it if you could save me the hassle [smile]

Quote:Original post by devdept
1) Is it possible with direct X to display a small area of the whole scene like a magnification lens? Suppose you have a 200x200 display screen and you want to display the rect x20, y20, width 50, height 50 to and fill the original 200x200 screen. In opengl is done using gluPickMatrix function.
Yes, a simple way would be to use "render to texture." You render your normal sized image to a texture and then render that texture to the screen at a size greater than the original render (or a subset of it).

You can achieve the same by tweaking the viewport and/or projection matrices, but it depends whether you want a geometry-space process or a screen-space process.

Quote:Original post by devdept
2) Is it possible with direct X to save a bitmap of the scene with higher resolution than the display screen? I mean you have a scene on screen of 200x200 and want to produce a 2000x2000 image for printing a poster size image.
Not using the built in functions. But manipulating bitmaps isn't too hard so you can probably do it yourself.

Bare in mind that a simple up-scale like you describe is not likely to be a good solution. The amount of blurring you'll introduce is going to destroy image quality (most resize filters blur with more than 2-4x zoom).

There are some articles online (seem to remember ShaderX/GPU-Gems/GPG had a print article) on how to achieve this. You can implement tile-based rendering to actually render a super-high-res screenshot.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Ooops... Sorry, I am not a forum user expert. I will check FAQ immediately.

Thanks a lot for your answers!

devdept, it's not clear to me if you're after enlarging images as a bitmap, or rendering a more finely detailed version of it. From your mention of gluPickMatrix, I assume the latter.

In this case, for (1) I think your best bet is to find the transformation gluPickMatrix provides, and use that. Sounds like it'd be a scale/translation. For (2), create a render target of size 2000x2000 and render the same scene into it.

This topic is closed to new replies.

Advertisement