PNG Alpha transparent vs Sprites

Discussion in 'Questions (Windows Mobile)' started by Byak@, Oct 2, 2009.

  1. Byak@

    Byak@ Active Member Licensed User

    i'm not understand, why alpha transparent doesn't work on PPC.ON pc is all right and nice?but on PPC all transparent's pixels replaced by white.
     
  2. agraham

    agraham Expert Licensed User

    PPCs don't support Alpha. Alpha is always 255 in a PPC color.
     
  3. Byak@

    Byak@ Active Member Licensed User

  4. agraham

    agraham Expert Licensed User

    I didn't know this but apparently GDI+ was introduced in Windows Mobile 5 so it is not present on 2003 and 2003 SE devices. It is also not present on any version of smartphone (including Windows Mobile 6 Standard) or basic Windows CE. It is a native mode API and is not available in the Compact Framework.

    Using GDI+ on Windows Mobile - Compact Framework

    I might have a go at porting my desktop GDI+ library once I have finished playing with my current Remoting ptoject.
     
  5. Byak@

    Byak@ Active Member Licensed User

    It is a good news)) how you think,Andrew, with GDI+ we can use alpha transparent in sprites?
     
  6. agraham

    agraham Expert Licensed User

    Very unlikely, the device GDI+ apparently only implements about 85 of the 400 functions present on the desktop. I can't, after a quick look, see support for bitmap alphablending. Even if it were available it would require a rewrite of the Sprite library so I don't think it will happen!
     
  7. Ariel_Z

    Ariel_Z Active Member Licensed User

  8. agraham

    agraham Expert Licensed User

    Thanks, I didn't.

    The AlphaBlend API function does the same as AlphaBlend already in ImageLibEx and GDI+Desktop which is a constant blend. Theoretically the AlphaBlend API can deal with individual pixel alpha but in practice the CF bitmap loading process strips any alpha information so you can't easily get the alpha information into the managed world on the device. What Byak@ wants is to use png images with individual pixel alpha.

    The COM interface article looks more interesting. Although I wouldn't attempt to interface to the COM exposure of GDI+ on the device (I hate COM and do this stuff for pleasure not pain!) the presence of pixel alpha capability in the COM Iimage does indicate that somewhere in the functions available to P/Invoke there might be a chance. I didn't see it on a very quick scan so I'll see if it's there if/when I look more closely at it - unless you want to take a stab at it first :).
     
  9. Ariel_Z

    Ariel_Z Active Member Licensed User

    I actually did... :) but my conclusion is very similar - I can't see a straightforward way, and so does experts on the web (whom I read). I didn't find a lead to a pixel-base alphablend. Although I see what you mean.
    The place I sometimes start looking from when I need to P/Invoke anything is pinvoke.net: the interop wiki! - especially the coredll at the bottom left. You might know the site. But I'm affraid that's all I have to contribute here... :(
     
  10. eww245

    eww245 Member Licensed User

    IImageFactory works quite well, but there seems to be a small memory leak when used with Com Interop.
    And will only work from a file or a resource.

    Per pixel AlphaBlend needs a 32bit DIB vs, a DDB which does not suppprt the Alpha channel.
    A Bitmap loaded from a file and then AlphaBlended on a DIB works but seems to get mirrored and split in two and does retain the Alpha.
    Bitmaps from a b4p imagelist don't seem to work at all.
    Though I think it should work as it is an embedded resource that can retain the Alpha channel, just haven't figured it out yet.

    So the answer for now anyway is IImage.
    I haven't got a chance to upload my Alpha library yet but it does work.
    Hopefully tomorrow I will after cleaning out the junk.
     
  11. Byak@

    Byak@ Active Member Licensed User

    Hello, eww245!
    as i understand-you find method for drawing AlphaBlended Images on PPC? it will be very great! I'm very wait!
     
  12. agraham

    agraham Expert Licensed User

    A bit of information from the Compact Framework design team I found and kept as possibly useful may explain this.
     
  13. eww245

    eww245 Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice