#22 Per pixel transparency

closed
Davis
5
2007-10-12
2007-10-11
Nils Labugt
No

The new drawing functions are nice (I haven't tested them yet), but for using the same icon with different backgrounds, or dragging an icon across a multicolored background, there would have to be some way to use per-pixel alpha, e.g. something like

struct rgb_alpha_pixel
{
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char alpha;
};

Discussion

  • Davis

    Davis - 2007-10-12
    • labels: --> Change to Component
    • assigned_to: nobody --> davisking
     
  • Davis

    Davis - 2007-10-12

    Logged In: YES
    user_id=1166290
    Originator: NO

    Ah, ok. So how about I add a function to the image_widget like my_img_widget.set_image(rgb_image,alpha_image)?

    -Davis

     
  • Nils Labugt

    Nils Labugt - 2007-10-12

    Logged In: YES
    user_id=1213427
    Originator: YES

    I guess which approach is best, extension to a RGBA "color space" or a separate mask, would depend on whether there is plans for supporting additional image formats like PNG, but I don't have experience with these things. Whatever you think is best or easiest.

     
  • Davis

    Davis - 2007-10-12

    Logged In: YES
    user_id=1166290
    Originator: NO

    Ah, good idea :)

    I just added an rgb_alpha_pixel to the list of pixels supported by the library. So now when you define image objects using that kind of pixel and display them on a window via the image_widget object or draw_image() function you should see some per pixel transparency.

    The changes are now also checked into subversion.

    -Davis

     
  • Davis

    Davis - 2007-10-12
    • status: open --> closed
     
  • Nobody/Anonymous

    Logged In: NO

    Thanks! :)

     

Log in to post a comment.