News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Project: BMP to CUR converter

Started by NoCforMe, February 08, 2022, 04:23:25 PM

Previous topic - Next topic

NoCforMe

This was inspired by my recent thread about splitters, where I'd need some custom cursors for the user to drag them with. Not having any way of creating .CUR files, I fixed up an old (16-bit DOS) BMP-to-ICO conversion program. Also my first console app; about time. Easy peasy.

Adapting the old code was really easy, because .CUR files are almost identical to .ICO files except for 2 things:

  • The type value is different (2 instead of 1)
  • Two fields in the header are used for the "hotspot" position (x,y) instead of other things
So here it is. Use it if you want to make your own cursors out of bitmap images. The requirements:

  • Images must be 32x32 pixels
  • Images must be 2 colors (1 bit/pixel)
  • Only one image per .BMP file
  • Uncompressed (almost all BMPs are)
Usage: bmp2cur <filename>
Assembly language programming should be fun. That's why I do it.

NoCforMe

Here's another li'l tool: a cursor tester that lets you load any .CUR file and take it out for a spin to see what it looks like in a window. Very simple.
Assembly language programming should be fun. That's why I do it.

hutch--

Do yourself a favour, get a cursor editor, they are simple things to make in a variety of sizes and you can even have animated cursors.

I own both Axialis Icon Workshop and Cursor Workshop and they are both very good tools. If you hunt around, you can find freeware apps that do the same thing.

NoCforMe

OK. In the meantime I'll use my tools and my go-to image editor (an old version of Paint Shop Pro).

2 questions: Should I move this to the "Showcase" since it's a finished project? If so, would you move it, Hutch?
Second, I could add a command-line option to set the "hotspot" in case someone doesn't want it right in the middle (currently it's [15,15]). Anyone think this would be a good feature?
Assembly language programming should be fun. That's why I do it.

jj2007

Quote from: NoCforMe on February 09, 2022, 05:49:22 AM
my go-to image editor (an old version of Paint Shop Pro).

You are on day 1595 of your 30 day evaluation period :cool:

hutch--

> Should I move this to the "Showcase" since it's a finished project? If so, would you move it, Hutch?

No. The showcase is for finished code, not experiments.

NoCforMe

OK, fair enough. What would it take for you to consider this finished? I've been using it to create cursors and it's worked fine.
Assembly language programming should be fun. That's why I do it.

Vortex

Hi NoCforMe,

Thanks for your work. Here is my cursor from binary example using your converter.  The cursor test tool could not display the arrow image ( cursor ) converted from bmp to cur. Maybe, my bitmap file is not correct, could you check the attached zip file?

NoCforMe

Hmm; your cursor worked for me. Dunno why it didn't for you. I could tell it was your cursor because it's hollow inside instead of being filled by white.
Of course, there's no possibility that my conversion tool is at fault.  :biggrin: :biggrin: :biggrin:
I'll look into it.
Assembly language programming should be fun. That's why I do it.

hutch--


NoCforMe

Here's my implementation of a cursor editor, nearly finished (just a little "chrome" to put in, like an "about" window, maybe some help). No razzle-dazzle, and all it does is edit a standard (32X32, 2-color) Windows cursor, but it works and I'm using it to create cursors for projects. See what you think.

When you're editing a cursor you can use the right mouse button to put in the opposite color to the selected one (white if you have black selected). Other than that, pretty straightforward.
Assembly language programming should be fun. That's why I do it.

hutch--

 :biggrin:

That works well, a very simple tool that does the job.  :thumbsup:

NoCforMe

Assembly language programming should be fun. That's why I do it.

hutch--

Now I know that making requests is probably unreasonable but of you could impliment drawing a line, it would make the app a lot easier to use.

Vortex