Results 1 to 17 of 17

Thread: Per-pixel alpha blend function math [Resolved]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 1999
    Location
    California, USA
    Posts
    662

    Per-pixel alpha blend function math [Resolved]

    I know this is not vb, but...

    I'm writing a function in vc++ for a dll that will be accessed from vb. It takes three hDC's and combines them, overlaying hdc2 over hdc1, using hdc3 as the mask.

    I'm working with the DIB of the hdc's so it's hella fast (array of pixel values). Anybody know what the math formula for blending the pixels is?

    this is how it might look in algebra.

    d = f(o, s, a)

    d = destination value
    o = "layer 1" value
    s = "layer 2" value
    a = "alpha" or opacity value

    all of the values range from 0 to 255 (this needs to be done for each channel of the pixel)

    255 is full opacity and 0 is no opacity

    if anybody can tell me what f is?


    if you don't understand what i'm asking, let me know. maybe i can phrase it better
    Last edited by agent; Jul 29th, 2003 at 11:25 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width