Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_SETALPHA Question
#16
Quote:As a rule of thumb when working in 32 bit screens use _RED32, _GREEN32 and _BLUE32, and when working in non 32 bit screens use _RED, _GREEN, and _BLUE.

You may want to reword this a little bit. "rule of thumb" says to me that it's *recommended* behavior, not *required*.

When dealing with a non 32-bit screen, you *have* to use _RED. _GREEN, _BLUE to get back your index values. Let's take a SCREEN 0, Red pixel, for example:

With _RGB(4), you're going to get a return value of 255. This looks up the screen, checks the palette for index 4, and returns the RGB value associated with red for that palette.

With _RGB32(4), you're going to get a return value of 0. _RGB32 *only* works with 32-bit values, so this number is going to be counted as &H00000004. Zero alpha, zero red, zero green, and 4 blue. That's almost as close to transparent black as possible!



With non 32-bit screens, one *has* to use _RED, _GREEN, _BLUE. It's not really a "point of thumb"; in this case, it's a "fact".

With 32-bit screens, one *can* use either _RED, _GREEN, _BLUE, or _RED32, _GREEN32, _BLUE32 -- but the _32 commands are always going to be much quicker and faster for them.

Wink
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: 5 Guest(s)