Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_SETALPHA Question
#12
@TerryRitchie

Quote:While writing this lesson it was brought to my attention that the _RGB32 statement gained the ability to optionally work with the alpha channel rendering the need for _RGBA32 obsolete. _RGBA32 is still maintained for compatibility reasons however.

One thing to point out here -- *most* of the parameters for _RGB32 are optional now, with the number that you use affecting the result greatly.

color = _RGB32(value) <-- This is perfectly valid now, even though you didn't supply 3 values. In this case, what you're getting back is a GRAYSCALE color, which would be the same as: _RGB32(value, value, value).

color = _RGB32(value, alpha) <-- If you just supply two numbers, RGB32 will return a GRAYSCALE color back to you, *with* ALPHA levels. It's equivalent to: _RGBA32(value, value, value, alpha)

_RGB32(red, green, blue) <-- You covered this one, I think.

_RGB32(red, green, blue, alpha) <-- Same with this. You've already covered it.



I don't know if you want to include the two grayscale options with the _RGB tutorial, but I thought I'd mention them as they might be something folks should be aware of -- for debugging, if nothing else! After all, Kolor = _RGB32(red, greenblue) *would* work perfectly fine and with zero indication of any sort of error being involved where the user skipped the comma between the green and blue. I'm certain the result isn't going to be what they expect, but QB64PE *will* compile and run it with zero issues.
Reply


Messages In This Thread
_SETALPHA Question - by TerryRitchie - 09-29-2023, 04:08 AM
RE: _SETALPHA Question - by DSMan195276 - 09-29-2023, 04:21 AM
RE: _SETALPHA Question - by TerryRitchie - 09-29-2023, 04:33 AM
RE: _SETALPHA Question - by TerryRitchie - 09-29-2023, 05:01 AM
RE: _SETALPHA Question - by SMcNeill - 09-29-2023, 05:15 AM
RE: _SETALPHA Question - by TerryRitchie - 09-29-2023, 05:39 AM
RE: _SETALPHA Question - by SMcNeill - 09-29-2023, 07:19 AM
RE: _SETALPHA Question - by SMcNeill - 09-29-2023, 07:24 AM
RE: _SETALPHA Question - by DSMan195276 - 09-29-2023, 05:11 PM
RE: _SETALPHA Question - by TerryRitchie - 09-29-2023, 05:21 PM
RE: _SETALPHA Question - by TerryRitchie - 09-29-2023, 06:19 PM
RE: _SETALPHA Question - by SMcNeill - 09-29-2023, 06:41 PM
RE: _SETALPHA Question - by SMcNeill - 09-29-2023, 06:56 PM
RE: _SETALPHA Question - by TerryRitchie - 09-29-2023, 07:07 PM
RE: _SETALPHA Question - by TerryRitchie - 09-30-2023, 03:37 AM
RE: _SETALPHA Question - by SMcNeill - 09-30-2023, 11:19 AM
RE: _SETALPHA Question - by TerryRitchie - 09-30-2023, 02:00 PM



Users browsing this thread: 4 Guest(s)