フィルターのクリア

How to avoid rrbox to generate black root window?

2 ビュー (過去 30 日間)
Walter Zimmer
Walter Zimmer 2017 年 1 月 4 日
コメント済み: Walter Zimmer 2017 年 5 月 4 日
Using the simple program
figure(1);
set(gcf,'Units','normalized')
k = waitforbuttonpress;
rect_pos = rbbox;
annotation('rectangle',rect_pos,'Color','red')
and press the mouse button in the figure, all above the cursor becomes black (sometimes some old figures and part of Matlab IDE is visible)
ones I release the button and move the mouse over black parts, they return back to normal.
I'm using 2016b on Windows 10
Some advice on how to proceed is appreciated
  2 件のコメント
NM
NM 2017 年 1 月 11 日
I do have the same problem. This started after applying the windows update in December 2016. Currently I found not workaround...
Ana Rakonjac
Ana Rakonjac 2017 年 1 月 12 日
Try uninstalling Windows updates KB3207752 and possibly KB3210131 (see my answer below).

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

採用された回答

Swathi Iyer
Swathi Iyer 2017 年 5 月 4 日
編集済み: Swathi Iyer 2017 年 5 月 4 日
  1 件のコメント
Walter Zimmer
Walter Zimmer 2017 年 5 月 4 日
Microsoft updates removed the problem. I assume the MS bug was removed.

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

その他の回答 (3 件)

Mudambi Srivatsa
Mudambi Srivatsa 2017 年 1 月 9 日
The black screen appearance while using the "rbbox" functionality is reproducible on some Windows machines. Currently, there is no workaround available for Windows 10. However, on some Windows 7 machines, switching to 16-bit color might resolve the issue.
  2 件のコメント
Walter Zimmer
Walter Zimmer 2017 年 1 月 9 日
編集済み: Walter Zimmer 2017 年 1 月 9 日
Is Mathworks working on this?
Until then, which alternative for rbbox is Mathworks suggesting?
Ana Rakonjac
Ana Rakonjac 2017 年 1 月 10 日
I have the same bug, but it has only cropped up recently (December 2016) on several Windows 7 machines, so I suspect something in a recent Windows update has caused this problem? The bug doesn't occur on a Windows 7 machine running 2015a that hasn't been updated in the last three months or so. For the other machines, the bug occurs both for 2015a and 2015b.
For what it's worth, this is the code I've tried (it's a snippet adapted from a more complex Matlab GUI we use extensively, so it would be nice if we can find the source of the problem):
testmat = ones(100,100);
figure(102)
imagesc(testmat)
t = waitforbuttonpress; % wait for mouse button to be pressed
point1 = get(gca,'CurrentPoint'); % button down detected
finalRect = rbbox; % return figure units
point2 = get(gca,'CurrentPoint'); % button up detected
Up until the last month, rbbox has posed no problems. Everything still works (you can just click on the Matlab command window and the screen goes back to normal), but it's annoying to be doing this all the time.

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


Ana Rakonjac
Ana Rakonjac 2017 年 1 月 12 日
I have found a workaround for Windows 7, but unfortunately I can't help with Windows 10! Perhaps a similar approach might work, however!
I looked through the list of updates for Windows 7 in the last month and uninstalled a couple that I suspected could be responsible. I have uninstalled the following two updates, which got rid of the problem: KB3207752 (security update) KB3210131 (some generic update)
I uninstalled KB3210131 first, which didn't help, and then I uninstalled KB3207752, which fixed the problem, so it's either the security update or both updates. I did not reinstall KB3210131 to confirm. Obviously, uninstalling security updates is not a good fix for a problem! I have no idea what's actually in these updates, so someone with more Windows knowledge might have more insight. I'm hoping that January's security updates won't cause an issue, so we can continue happily using rbbox.
  1 件のコメント
Ana Rakonjac
Ana Rakonjac 2017 年 1 月 25 日
I'd just like to add that after the January security update from Microsoft, the problem with the screen going black has manifested itself again, so I have had to uninstall it. The update in question is KB3212646.
Any proper solutions to this problem would be most welcome!

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


Song
Song 2017 年 3 月 4 日
Hi guys, I have exactly the same problem with rbbox() on my window10 machine in MT2016a. Does anyone know a workaround for this? It is really a big issue for my application :(
  2 件のコメント
Song
Song 2017 年 3 月 4 日
Hi guys, after trying a little, I think I get a workaround by myself.
I added a while endless loop, watching for the mousebuttonup event, and then let the program flow go further. At least this solve the issue with distorted screen and still give me the same functionality, even though now no box lines can be seen. :P
Hope that this helps other who have the same isse here.
Ana Rakonjac
Ana Rakonjac 2017 年 3 月 8 日
Would you mind sharing the code you are using for this?

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

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by