필터 지우기
필터 지우기

Making a Graphics Object

조회 수: 2 (최근 30일)
Taimur Saleem
Taimur Saleem 2013년 10월 20일
댓글: Taimur Saleem 2013년 10월 21일
I want to make a logo having a "X" sign in it and I want to set it differently on every iteration so I would want it to be in a handle. I tried making "X" using 2 rectangles and using linear equations as their coordinates but I can't seem to set them to 1 handle. If anyone has a better way to make an "X" sign I would appreciate the help.

채택된 답변

John Barber
John Barber 2013년 10월 20일
You have several options:
1) Depending on how complex the shape is, you could draw it as a single patch object and modify the vertex locations as needed.
2) Put the graphics primitives into an hggroup object. The hggroup handle can serve as a single reference, but your code that modifies the coordinates would still need to access the handles of the underlying graphics primitives.
3) Put the graphics primitives into an hgtransform object. This is similar to an hggroup, but you can apply affine transformations such as scaling, rotation, translation, and shear via the Matrix property of the hgtransform. (Note that the help documentation incorrectly states that shear transformations are not allowed for hgtransform objects. See my File Exchange program obliqueview for an example.)
  댓글 수: 3
John Barber
John Barber 2013년 10월 21일
Try using a patch object. I usually use the 'Vertices'/'Faces' method of specifying the location data, but use whatever suits your needs. See the help docs for the syntax:
Taimur Saleem
Taimur Saleem 2013년 10월 21일
Thanks John, I never knew the patch command would be so helpful in this case.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by