Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Monochrome instead of coloured cursors

Monochrome instead of coloured cursors

Scheduled Pinned Locked Moved C#
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jjansen
    wrote on last edited by
    #1

    I have made a 32x32 cursor that uses a 16-colours palette. When the cursor is displayed at runtime, however, it appears on screen as a monochrome (black and white) image. Does anyone know why this occurs?

    H 1 Reply Last reply
    0
    • J jjansen

      I have made a 32x32 cursor that uses a 16-colours palette. When the cursor is displayed at runtime, however, it appears on screen as a monochrome (black and white) image. Does anyone know why this occurs?

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      You might want to give specifics on how you're storing it (separate file, embedded resource in an assembly, etc.) and how you're loading it. It's kind of hard to diagnose a problem with specifics (it's like telling a doctor you have a pain without saying anything else).

      Microsoft MVP, Visual C# My Articles

      L 1 Reply Last reply
      0
      • H Heath Stewart

        You might want to give specifics on how you're storing it (separate file, embedded resource in an assembly, etc.) and how you're loading it. It's kind of hard to diagnose a problem with specifics (it's like telling a doctor you have a pain without saying anything else).

        Microsoft MVP, Visual C# My Articles

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        As I read today, the Cursor class only supports black and white cursors. :| top secret xacc-ide 0.0.1

        J 1 Reply Last reply
        0
        • L leppie

          As I read today, the Cursor class only supports black and white cursors. :| top secret xacc-ide 0.0.1

          J Offline
          J Offline
          jjansen
          wrote on last edited by
          #4

          leppie wrote: As I read today, the Cursor class only supports black and white cursors. If it is the case that the Cursor class only supports black and white cursors, it changes the nature of my question from 'what am I doing wrong' to 'how can I display coloured cursors'. As Heath Stewart quite justly comments, let me show me what I've done sofar to create, load and display my cursor. I created the cursor with Visual Studio 6.0. (By the way, earlier I created one by selecting "Cursor file" from the "Add New Item" dialog in Visual Studio .Net 2003 but that file appears to be an icon instead of a cursor. In the Properties Window it says "Icon Editor" and the hotspot tool is disabled. My old Visual Studio 6.0 recognised the file as an icon, too. I guess this may be a bug in Visual Studio .Net 2003 and I probably need an update for it. This is a different matter, however.) Anyway, this 16-coloured cursor works fine in a C++ 6.0 project. I also tested one of the coloured cursors that comes with WindowsXP; it also is displayed in monochrome, so I think we can discard the cursor file itself as the problem. I embedded the cursor by setting the Build Action to Embedded Resource. I declare the cursor: private Cursor MyCursor; and in the constructor of my user control I load it: System.Reflection.Assembly ThisDll = System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Stream TheRes; TheRes = ThisDll.GetManifestResourceStream("MyNamespace.MyCursor.cur"); MyCursor = new Cursor(TheRes); (I tried using simply MyCursor = new Cursor(this.GetType(), "MyCursor.cur");or MyCursor = new Cursor(this.GetType(), "MyNamespace.MyCursor.cur"); but that didn't work: the dataStream remains empty, apparently.) I asign the cursor (in special cases) to the user control by: this.Cursor = MyCursor; All in all, I'm doing nothing odd, I would say. So where have my wonderful colours gone? I would appreciate anyone's help on this. I cannot believe C# only allows monochrome cursors. Thanks.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups