ScreenShot Implementation & problems

(3 posts) (2 voices)
  1. sampin

    new member
    Joined: Sep '14
    Posts: 3

    Hi,

    My problem is concerning the snapshot in 3DVia Studio. I wanted to create a system which saves the entire 3d view window.

    For this, i use this code:

    vkImagePtr image = vkImage::CreateInstance();

    //Create the image (520,520 represent the width and height of the window)
    int e = image.Create(520, 520, vkPixelFormat::RGBA);

    //screenshot
    vkRenderManager::InstancePtr().GetDevice(0).Capture(*image);

    //output path
    path.Create([path], [file name]);
    //saving
    image.Save( path );

    The problem is:

    I can provide a screenshot. BUT,
    1) The size of this screenshot depends to the size of the 3D view window. I can change the width or height value in the "Create" Methods (I’ve tried image.Create(0,0, ...);), but the screenshot still have the same size.
    2) The screenshot began at the origin position of my screen, not at the origin position of my 3D view window. In my case, I need to put my 3D view window in a specific place. And this place is not in the top-right corner...

    So, if somebody has already created a snapshot system with 3DVia Studio, could he please tell me which is the matter?
    Did I use the wrong method?
    Or something else more mysterious?

    Thanks in advance for responses!

    Samuel

    PS : I've attached 2 files which explain this problem:
    - The first one (CaptureFULL.jpg) represent my full screen.
    - The second one (Capture3DVia) represent the screenshot. As you can see, I save the top right corner of my screen with the size of my 3D view Window...

    Attachments

    1. Capture3DVIA.jpg (76 KB, 19 downloads) 1 year old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 1 year ago #
  2. sampin

    new member
    Joined: Sep '14
    Posts: 3

    the full screen

    Attachments

    1. CaptureFull.jpg (117 KB, 24 downloads) 1 year old
    WARNING: Files uploaded in the forums are not monitored by 3DVIA and therefore might contain content that is malicious or offensive. Download at your own risk
    Posted 1 year ago #
  3. flamenco

    3DVIA Studio Guru
    Joined: Sep '09
    Posts: 188

    Best Answer

    Hi,
    I'll have a look at Capture() method.
    Waiting for that, another method could be to render your camera inside a texture (through a new viewport), then save the image of the texture. Then you don't have problem with relative window positionning, and control precisely what you capture.
    You could keep some of your code, but replace Capture() by calling "Render To Texture" Building block (it's a VSL BB, you can read its code to understand it just by pressing space when this BB is selected).
    Just note that you will loose anti-aliasing if not set to MLAA using this method.
    Cheers,
    Arnaud.

    Posted 1 year ago #

Reply

You must log in to post.