Hi Bryan,
I would use SDF from OpenNetCf.org--it makes alpha blending operations
and displaying PNG images much easier. Plus, it's free to use!
With SDF, you'd do something like this:
//initialization somewhere
private IImage _img;
new ImagingFactory().CreateImageFromFile(imagePath, out _img);
//DrawImage is called by OnPaint...
protected override void DrawImage(Graphics g, int xImage, int yImage){
IntPtr hDC = g.GetHdc();
RECT rc = RECT.FromXYWH(xImage, yImage, ImageWidth, ImageHeight);
_img.Draw(hDC, rc, null);
g.ReleaseHdc(hDC);
}
Good luck. For more info see:
http://csharponphone.blogspot.com/2006/05/alpha-blending.html Cheers,
j
[quoted text, click to view] Bryan wrote:
> I am still having no luck with displaying a PNG file. I've now tried both
> the AlphaBlend() funcation and the Imaging API that is new to CE 5.0.
> Neither of these options are working. I've download a sample from the
> internet and that doesn't work either. This makes me think that there is
> something missing in my CE image, but I have no idea what it is. Has anyone
> else had any luck with displaying a PNG file that has transparency? Here is
> a link to the example I was using:
>
>
http://blogs.msdn.com/chrislorton/archive/2006/04/07/570649.aspx >
> "Bryan" wrote:
>
> > I'm trying to display a PNG file that has multiple levels of transparency.
> > The PictureBox Control does not seem to be doing this in CE 5.0 (.NET CF 2.0
> > SP1). I have been trying to use the AlphaBlend() API function, but that
> > doesn't seem to be working. Does anyone have any ideas/suggestions for
> > things for me to try? Thanks for any help you can give me.