[vtkusers] questions about renderwindow size

David Gobbi david.gobbi at gmail.com
Tue Oct 28 09:25:40 EDT 2014


Hi Lin,

It looks like this was a problem with VTK 5 on Windows 8.
This was fixed in VTK 6.1, see the following patch:

http://vtk.org/gitweb?p=VTK.git;a=commit;h=5f8b3c0c

 - David

On Tue, Oct 28, 2014 at 12:15 AM, Lin M <majcjc at gmail.com> wrote:

> Hi David,
>
> 1) I'm using Win 8.1 pro
> 2) VTK version 5.10.1
> 3) It returned 692, 492 if I set size to 700, 500
>
> Thank you.
>
> On Tue, Oct 28, 2014 at 11:53 AM, David Gobbi <david.gobbi at gmail.com>
> wrote:
>
>> Hi Lin,
>>
>> Calling Render() should not change the window size, and in fact if it did,
>> then many of the nightly VTK tests would fail.  This means that there must
>> be something different about your computer as compared to the computers
>> that are used to test VTK.  So, the more information that you can provide
>> about your system, the better!
>>
>> 1) What operating system are you using (be as specific as possible)?
>> 2) What version of VTK are you using?
>> 3) What size did GetSize() return?  The exact numbers can be useful
>>   in figuring out what is causing the problem.
>> 4) If possible, run "ctest" to test your VTK for other problems.
>>
>>  - David
>>
>>
>> On Mon, Oct 27, 2014 at 9:39 PM, Lin M <majcjc at gmail.com> wrote:
>>
>>> Hi guys,
>>>
>>> I met a problem which confused me. I tried to specify the window size by
>>> myself. But when I checked it later, the GetSize() always returned a value
>>> a little bit different from what I set before. I put the code below. I only
>>> called the renderwin to Render() before I checked the window size. It seems
>>> the Render() changes the window size. But I don't get why is that. Does
>>> anyone can help me about that? Thanks very much!
>>>
>>> vtkSmartPointer< vtkRenderWindow > _imgRenderWin = vtkSmartPointer<
>>> vtkRenderWindow >::New();
>>> int _size[2] = { 700, 500 };
>>> _imgRenderWin->SetSize(_size);
>>> _imgRenderWin->AddRenderer(_renderer);
>>> _imgRenderWin->Render();
>>> int *_dim;
>>> _dim = _imgRenderWin->GetSize();
>>> int _dimx = _dim[0];
>>> int _dimy = _dim[1];
>>>
>>> Best,
>>> Lin
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141028/d956c59c/attachment.html>


More information about the vtkusers mailing list