Put your question and answer here

Window and Viewport

Window and Viewport

by Md. Zahidul Islam Sumon (171-15-1225) -
Number of replies: 2

What is the difference between window and viewport in computer graphics?

In reply to Md. Zahidul Islam Sumon (171-15-1225)

Re: Window and Viewport

by Md. Zahidul Islam Sumon (171-15-1225) -
A window characterizes a rectangular region in world directions. You characterize a window with a GWINDOW explanation. You can characterize the window to be bigger than, an indistinguishable size from, or littler than the real scope of data values, contingent upon whether you need to demonstrate the greater part of the information or just piece of the information.

A viewport characterizes in standardized directions a rectangular region on the display gadget where the picture of the information shows up. You characterize a viewport with the GPORT command. You can have your chart take up the whole display gadget or show it in just a bit, say the upper right part.

The distinction is:

The viewport is the size of the screen.

Window: is the size of the program window.

This can be exhibited when you have scroll bars on the base of the screen going left to right. The Window is bigger than the viewport.
In reply to Md. Zahidul Islam Sumon (171-15-1225)

Re: Window and Viewport

by Muhammad Shahnewaz (171-15-1367) -
Window port is the coordinate area specially selected for the display. Region Created according to World Coordinates. It is a region selected to form the real world. It is a graphically control thing and composed of visual areas along with some of its program-controlled with help of window decoration. A window port can be defined with the help of a GWINDOW statement.

The viewport is the display area of the viewport in which the window is perfectly mapped. Region Created according to Device Coordinates. It is the region in computer graphics which is a polygon viewing region. A viewport is defined by the GPORT command.

So, to display the image on the computer screen, we must map our window port to the viewport. The capture ratio of the window might not always be similar to or easily adjustable to the viewport. Thus, some necessary transformations ad adjustments like clipping and cropping are performed on the window.