Skip to content

Custom cursor doesn't respond to DPI changes (and is inconvenient to add in C# app) #238

@benstevens48

Description

@benstevens48

I've just been experimenting with adding a custom cursor in my UWP app like this.

Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Custom, myResourceId);

It works OK, except that if I change the system DPI when the app is open then the cursor does not update to use the appropriately sized bitmap in the cur file, unlike the system cursors. It just gets scaled and looks pixelated. It does work if I restart the app after the DPI change. (Note that my cur file contains 128*128, 96*96, 64*64, 48*48 and 32*32 pixel bitmaps). Ideally this should be fixed.

The second issue I have, which is kind of separate, is that it's pretty inconvenient to add a custom cursor in a C# UWP app. One has to follow the steps in the last comment in this thread. It would be good if it wasn't necessary to create a separate project to do this.

(In case you are wondering, I'm trying to add an eye dropper cursor for picking a color from an image).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions