Is it possible to have larger (than 16-by-16) pointer size?

8 次查看(过去 30 天)
Hi all,
I'm designing a drawing program in matlab (just imagine a simplified Photoshop), where the paintbrush can have larger than 16-by-16 size. I'd like to customize the pointer such that it has exactly the same size and same shape as the paintbrush (e.g. circle). Right now, I can change the shape by customizing PointershapeCData:
set(gcf,'Pointer','custom','PointerShapeCData',cdata,'PointerShapeHotSpot',[9 9]);
But the cdata is limited to 16-by-16, otherwise there will be a error. It seems matlab doesn't support any other sizes.
Is there anyway that I can make the pointer larger than 16-by-16?
Thank you very much in advance!
Best,
Leon
  6 个评论
Adam Danz
Adam Danz 2021-4-17
编辑:Adam Danz 2021-4-17
I see. In that case I agree that pointer control is insufficient.
I would assign a WindowButtonMotionFcn to the figure that activates when the cursor enters the axes (see example).
The callback function would activate a rectangle object that is centered around the CurrentPoint (position of cursor) with a fixed size.
Then I would assign a ButtonDownFcn to the axes that grabs the coordinates of the rectangle when a mouse button is pressed and then zooms into the image based on the rectangel's coordinates.
You could add an additional element that controls whether the rectangle should appear or not so you can turn this feature off.
Also note that the zoom tool in the axis toolbar allows the user to click-and-drag a rectagular area of an axes and then zooms into that area. It draws a rectangle around the section as your dragging the mouse.
Tim Kühlthau
Tim Kühlthau 2021-4-17
Thank you very much for your input.
If I will have to rework the code of my measurement script I will definitely try it out.
This could also be an answer to corviant_cat's question if a circle instead of a square is plotted around the cursor tho. :)

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2013-6-27
This is a limitation in the operating systems that support MATLAB, that the fast (hardware) cursor is limited to 16 x 16. To get cursors with larger dimensions they have to be drawn in software.
  2 个评论
covariant_cat
covariant_cat 2013-6-27
编辑:covariant_cat 2013-6-27
Thanks! But how come the fullcross cursor can be larger than 16x16? see the following screenshot. Is it possible to modify the behavior of this type of cursor such that it becomes a larger circle? http://i.imgur.com/6cBAV9K.png
Walter Roberson
Walter Roberson 2013-6-27
fullcross goes through a slightly different hardware path.
The hardware cursors often go through a separate hardware bit-plane so that they are drawn without damaging the contents of the frame buffer. For speed (and cost originally) that hardware is not very flexible

请先登录,再进行评论。

更多回答(1 个)

Adam Danz
Adam Danz 2021-4-16
编辑:Adam Danz 2021-4-16
> Is there anyway that I can make the pointer larger than 16-by-16?
Update: Starting in r2016b PointerShapeCData can be 16x16 or 32x32.
Resources for creating pointers:

类别

Help CenterFile Exchange 中查找有关 Graphics Performance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by