How to display a jpg or bmp figure on GUI pane with high quality?

10 ビュー (過去 30 日間)
Yao Li
Yao Li 2013 年 5 月 10 日
The jpg or bmp figure displays well if I open it outside matlab. But if I implement imread()and image() to display the image in axes on GUI pane, the quality of the image is unsatisfactory. Can anyone help?
  2 件のコメント
Jing
Jing 2013 年 5 月 10 日
What's the exact code you used?
Yao Li
Yao Li 2013 年 5 月 13 日
filename='aaa.bmp';
h=imread(filename);
image(h);

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2013 年 5 月 14 日
First you need to calculate the width and height of your image in pixels. Then you need to create an axis whose dimensions in pixels exceed that width and height; you can do that by specifying the name/value pair 'Units', 'pixels', and giving the appropriate Position property
Then
image(h)
axis image
You might need to play with the axis InnerPosition or Position properties in order to ensure that the portion of the image actually used to draw on is as big as you need.
If your image size exceeds the amount of screen space you can afford, you will not be able to fit the entire image in without decline in quality unless you only show a portion of the image at a time and then either have the user use the "pan" tool or else provide scroll bars such as by using http://www.mathworks.com/matlabcentral/fileexchange/14984-scrollplot-scrollable-xy-axes

その他の回答 (1 件)

Lisa Wu
Lisa Wu 2013 年 5 月 13 日
Try imshow(I),displaying the grayscale image I
  1 件のコメント
Yao Li
Yao Li 2013 年 5 月 13 日
thx, but sorry, I don't have this toolbox and can't call the function imshow(). Any other suggestions?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by