PNG Alpha transparent vs Sprites

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.
 

Byak@

Active Member
Licensed User

agraham

Expert
Licensed User
Longtime 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.
 

Byak@

Active Member
Licensed User
It is a good news)) how you think,Andrew, with GDI+ we can use alpha transparent in sprites?
 

agraham

Expert
Licensed User
Longtime User
with GDI+ we can use alpha transparent in sprites?
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!
 

agraham

Expert
Licensed User
Longtime User
I guess you know them
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 :).
 

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... :(
 

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.
 

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!
 

agraham

Expert
Licensed User
Longtime User
And will only work from a file or a resource.
A bit of information from the Compact Framework design team I found and kept as possibly useful may explain this.
1.Creating a bitmap using the stream constructor will construct a DIB (Device Independent Bitmap).

2.Creating a bitmap using the width/height constructor will construct a DDB (Device Dependent Bitmap).

3.DIB's are allocated out of the virtual address space of the application.

4.DDB's are allocated by the driver. This typically means that they are allocated in the virtual address space of gwes.exe
 
Top