News:

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

Main Menu

Another little toy (barber pole)

Started by NoCforMe, January 01, 2023, 06:08:25 PM

Previous topic - Next topic

zedd151

Quote from: NoCforMe on January 05, 2023, 12:09:03 PM
Back in the day, barbers were also surgeons and doctors of a sort.
And 'dentists', well they did pull teeth at least (without anasthesia I've heard). Ouch!

jj2007

Version 2 attached, a whopping 25 lines long. Now you can save a barberpole image with a right-click :cool:

NoCforMe

That's pretty cool, JJ.

I swear, every time I see "GuiParas" I think "GUI paragraphs", which of course makes no sense.

I need to look into your code to discover how to save a bitmap back to a file. Something I'll be doing soon in another project.
Assembly language programming should be fun. That's why I do it.

zedd151

Quote from: NoCforMe on January 05, 2023, 03:26:04 PM
I need to look into your code to discover how to save a bitmap back to a file. Something I'll be doing soon in another project.
This might be helpful, I converted to 32 bit from Vortex's 64 bit screen capture tool
32 bit screen capture yes I know that esi, edi was not preserved there :tongue:  but it should give you a starting point ... for writing the file headers, etc.


Disclaimer: That code is over four years old, and I don't remember much about it. I just remember I was experimenting converting 64-->32 bit code at that time.  :biggrin:  The code worked, so I left it as is ... after a little dabbling with it.
I should one day, check my older attachments for errors such as that (register preservation) and fix it to reattach a better example in its place.  :tongue:

NoCforMe

Don't worry, those are just details. All I really need to get started is the general idea of what functions to use, and where to find the data I need. That all seems to be there. I'm sure I can write bitmaps using [most of] that code. Doesn't matter if a few PUSHes or POPs are missing.
Assembly language programming should be fun. That's why I do it.

zedd151

Quote from: NoCforMe on January 05, 2023, 04:19:52 PM
Don't worry, those are just details. All I really need to get started is the general idea of what functions to use, and where to find the data I need. That all seems to be there. I'm sure I can write bitmaps using [most of] that code. Doesn't matter if a few PUSHes or POPs are missing.
:biggrin:  There is a link to Vortex's 64 bit version in that post if anything in my code is unclear. Even though it is 64 bit, may prove useful as well. Just returning the favor, as you have provided me with useful code in another project.  :cool:

jj2007

Quote from: NoCforMe on January 05, 2023, 03:26:04 PM
That's pretty cool, JJ.

Thanks :thup:

QuoteI swear, every time I see "GuiParas" I think "GUI paragraphs", which of course makes no sense.

GUI parameters it is, of course. In hindsight, I should have chosen the long GuiParameters (GuiArgs?) version, but now it's too late to adapt hundreds of old sources :sad:

QuoteI need to look into your code to discover how to save a bitmap back to a file. Something I'll be doing soon in another project.

It's mostly public, in \Masm32\MasmBasic\Res\MbGui.asm

Without GuiParas and other bells & whistles, it's a six-liner :biggrin:

include \masm32\MasmBasic\Res\MbGui.asm
include BarberPole.inc
  SetGlobals hCurrent=rv(InitBarberPole, rv(GetModuleHandle, 0))
  GuiControl bp1, "barberpole", y50, x50, w0+32, h0+96
  invoke SendMessage, hbp1, WM_BARBERPOLE_ON, 0, 0
GuiEnd         ; OPT_DebugL         BPcontrol.obj