Solved

Loading a 256 colour cursor

Posted on 2002-05-20
4
225 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
4 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 50 total points
Comment Utility
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now