SilverScreen Solid Modeler

resize_window

resize_window

Previous topic Next topic  

resize_window

Previous topic Next topic JavaScript is required for the print function  

 

SilverScreenAPI

Antiquated

 

void resize_window( int left, int top, int right, int bottom, BOOLEAN char_coords )

 

int     left;  // Left-most pixel or character value

int     top;   // Top-most pixel or character value

int     right; // Right-most pixel or character value

int     bottom; // Bottom-most pixel or character value

BOOLEAN char_coords; // Are coordinates in character space?

 

 




Synopsis

#include "silver.h"

 

The resize_window function relocates the device coordinates of the current window. If char_coords is TRUE, then left, right, top, and bottom are in character space. If char_coords is FALSE, then left, right, top, and bottom are pixel values.

 

 

Parameters

left is the left-most pixel if char_coords is FALSE, and the left-most character if it is TRUE

top is the top-most pixel if char_coords is FALSE, and the left-most character if it is TRUE

right is the right-most pixel if char_coords is FALSE, and the left-most character if it is TRUE

bottom is the bottom-most pixel if char_coords is FALSE, and the left-most character if it is TRUE

 

char_coords is TRUE if the window coordinates are specified in character space and FALSE if they are specified in pixel space

 

 

Return Value

none

 

Remarks

This function used to be the only way to export images of a particular size in SilverScreen. It has been superseded by an expanded export image command, but is preserved for legacy code support.

 

When char_coords is FALSE, here are the value ranges for the window coordinates

 

Parameter

Minimum value

Maximum value

left

0

spixel_width

top

0

spixel_height

right

left

spixel_width

bottom

top

spixel_height

 

When char_coords is TRUE, here are the value ranges for the window coordinates

 

Parameter

Minimum value

Maximum value

left

schar_left

schar_right

top

schar_top

schar_bot

right

left

schar_right

bottom

top

schar_bot

 

 

See Also

resize_screen

 

 

Example

The following code will create a new screen, resize the current window so that it is 400x600 pixels, load the sdc drawing, and interactively swing. When the swing is terminated the screen is unloaded.

 

C / C++ Code

 

 #include "silver.h"

 

 void main(void)

    {

    int new_width;

    int new_height;

    int new_left;

    int new_top;

 

    new_width  = 600;

    new_height = 400;

 

 

    ss_command("clear all");

    ss_command("screen create");

 

    new_left = ((vpixel_right - vpixel_left) - new_width) * 0.5;

    new_top  = ((vpixel_bot - vpixel_top) - new_height) * 0.5;

 

 

    resize_window(new_left, new_top, new_width, new_height, FALSE);

 

    ss_command("open drawing sdc");

    ss_command("icommand swing");

    ss_command("screen unload");

    }

 

 

The following command would export the current window as a 24-bit Windows bitmap that is 400x600 pixels.

 

Command Script

 

 export picture file sdc.bmp format bmp24 window width 600 height 400