필터 지우기
필터 지우기

delete drawn shape from image

조회 수: 6 (최근 30일)
mary
mary 2011년 6월 2일
댓글: Himanshu Giria 2021년 1월 5일
hi,
I have drawn several ellipses using imellipse instruction on an image in a figure. when i choose one of those ellipses and wanna delete it using 'delete' key, it doesn't work. how can i do it? tnx

채택된 답변

Walter Roberson
Walter Roberson 2011년 6월 2일
gco() should return the handle of the currently selected object. Selecting is just a matter of clicking (once) on the object. Recognizing the delete key would be done by setting KeyPressFcn callback for the figure: be sure to check the event data to be sure the proper key was pressed. It might also be a good idea to get() the Type of the current object and check it, so that you only delete the kind of objects you want.
  댓글 수: 2
Himanshu Giria
Himanshu Giria 2021년 1월 5일
Thank you
Himanshu Giria
Himanshu Giria 2021년 1월 5일
It worked

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sean de Wolski
Sean de Wolski 2011년 6월 2일
H = imellipse(...);
delete(H);
  댓글 수: 1
mary
mary 2011년 6월 2일
tnx for your reply,
but i have loaded an image in a figure, and drawn more than one ellipses on it.now a user should select one of them and after pressing delete key it must be deleted.
i don't know how to write the code of selecting and getting the input key by user.
tnx

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by