Re: Wierd problem when alpha blitting image with text in it



On Sat, 29 Jul 2006 23:02:35 -0700, "Dean Roddey"
<droddey@xxxxxxxxxxxxxxxx> wrote:
It's only if I alpha blit from the first to the second that the text pixels
get whacked, but everything else stays fine. At first I thought maybe it's
because the pixels are pre-blended but the drawn text pixels aren't (they
get an 0xFF I assume.) But the area of the image over which the text is
being drawn is fully opaque and would have 0xFF alpha anyway, so that
doesn't seem likely.

If the text (source) pixels have an alpha value of 0 but the RGB
values are not 0 (which is inconsistent with premultiplication), the
final pixels can overflow (which can end up looking "over-amped").
Could this be the case in your system? I haven't followed the entire
thread, but I just thought I'd throw this out as a potential cause.

I think the easiest way to debug this is to observe the actual R,G,B,A
values of the text pixels in a debugger (instead of guessing what they
might be) and then work them through the blending equation.

Chris
.



Relevant Pages

  • Re: How to Display Text On Live Video and Capturing it to a file
    ... > SelectObject(hdc, hobj); ... This ExtTextOutcall is where the text is actually drawn. ... bitmaps. ... but in this bitmap blank pixels are mapped ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Bitmap graphics
    ... for example the debris title logo is 96 pixels wide with 56 lines ... the ingame graphics are usually smaller. ... with font routines a slightly ... so the 8 lines are only drawn once. ...
    (rec.games.vectrex)
  • Getting on my YaST nerve
    ... Every time I use the YaST modules, I get a number of random lines that are a ... few pixels wide. ... These are drawn up and down the screen. ... Fear! ...
    (alt.os.linux.suse)
  • Re: Wierd problem when alpha blitting image with text in it
    ... final pixels can overflow. ... I was asking, when you alpha blit ... a pre-multiplied image to a memory bitmap, is is in the bitmap pre-multipied ... matter since the alpha channel in the area where the text is being drawn is ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Hints on Drawing in TASM
    ... > want to make boxes around numbers... ... you might want to consider blitting a bitmap with the number with a box ... pixels can be drawn by reading the byte from the screen and ORing in the ...
    (alt.lang.asm)

Loading