Necesito obtener el tamaño del rectángulo del cursor clásico de Windows.Cómo obtener el tamaño del cursor en C#
¿Cómo puedo obtener el tamaño del cursor en C#?
Necesito obtener el tamaño del rectángulo del cursor clásico de Windows.Cómo obtener el tamaño del cursor en C#
¿Cómo puedo obtener el tamaño del cursor en C#?
Puede utilizar Cursor.Size:
int cursorWidth = Cursor.Size.Width;
int cursorHeight = Cursor.Size.Height;
Sí, es así de simple!
Espero que esto ayude!
Un pequeño ejemplo: Reference
if(this.Cursor != Cursors.Hand &
Cursor.Current == Cursors.Default)
{
// Draw the cursor stretched.
Graphics graphics = this.CreateGraphics();
Rectangle rectangle = new Rectangle(
new Point(10,10), new Size(cursor.Size.Width * 2,
cursor.Size.Height * 2));
cursor.DrawStretched(graphics, rectangle);
// Draw the cursor in normal size.
rectangle.Location = new Point(
rectangle.Width + rectangle.Location.X,
rectangle.Height + rectangle.Location.Y);
rectangle.Size = cursor.Size;
cursor.Draw(graphics, rectangle);
// Dispose of the cursor.
cursor.Dispose();
}
para obtener información profunda visitar MSDN Enlace: http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.size.aspx
para WPF se puede ver: http://stackoverflow.com/questions/8038853/how-can- i-determine-the-cursor-size-in-wpf –