Solved

Loading a 256 colour cursor

Posted on 2002-05-20
4
235 Views
Last Modified: 2013-11-20
How do I programmatically load and display a custom 256 colour cursor into a view. MFC only seems to display monochrome cursors.
0
Comment
Question by:WarrenW
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 50 total points
ID: 7023124
You need to provide a handler for WM_SETCURSOR.  

Early in the program, load the cursor and save its handle.  E.g.,
    m_hcurView= AfxGetApp()->LoadCursor( IDC_MY256COLORCURSOR );

In your OnSetCursor fn, use

  ::SetCursor( m_hcurView );
  return( TRUE );

Another tip:  In order to create a 256-color-cursor resource, you need to create a new cursor, then use menu commands:

1) Image>New Device Image
2) [Custom]
3) Set size and color depth
4) Paste the 356-color image into the pcicture

5) select the orginal 32x32 mono from the Cursor-editor "Device:" drop-down box

6) Image > Delete Device Image

that way there is only one image (the 256-color one) in the cursor resource.

Finally, the pallet is limited.  Lots of pictures that look great in 24-bit color look crappy when translated into the standard 256-color palette.

-- Dan
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question