Main Content

Manage Display Preferences

You can use Image Processing Toolbox™ preferences to control certain characteristics of howimshowand theImage Viewerapp display images on your screen. For example, using toolbox preferences, you can specify the initial magnification used.

Retrieve Values of Toolbox Preferences

To determine the current value of Image Processing Toolbox preferences, you can look in the Preferences dialog box or use theiptgetpreffunction.

To open the Preference dialog box, clickPreferencesin theHometab in the MATLAB®desktop. In the Preferences dialog box, select Image Processing Toolbox. You can also access Image Processing Toolbox preferences from theImage ViewerFilemenu, or by typingiptprefsat the command line.

To retrieve the values of Image Processing Toolbox preferences programmatically, typeiptgetprefat the command prompt. The following example usesiptgetprefto retrieve the value to determine the value of theImtoolInitialMagnificationpreference.

iptgetpref('ImtoolInitialMagnification')
ans = 100

首选项名称case insensitive and can be abbreviated. For a complete list of toolbox preferences, see theiptprefsreference page.

Set Values of Toolbox Preferences

To set the value of Image Processing Toolbox preferences, you can use the Preferences dialog box or use theiptsetpreffunction.

To open the Preference dialog box, clickPreferencesin theHometab in the MATLAB desktop. In the Preferences dialog box, select Image Processing Toolbox. You can also access Image Processing Toolbox preferences from theImage ViewerFilemenu, or by typingiptprefsat the command line.

To specify the value of a toolbox preference, use theiptsetpreffunction. This example callsiptsetprefto specify thatimshowresize the figure window so that it fits tightly around displayed images.

iptsetpref('ImshowBorder','tight');

For a table of the available preferences, see theiptprefsreference page.