pavc

hi,

I'm want do put some images with transparencys in a Pocket PC 2003.

I had tried everthing, png, green background, gif, etc...

And I steel cann't make the images appear propely...

Can anyone help me !



Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Alex Feinman

Image transparency is not supported in Compact Framework Bitmap class. It is possible to work with transparent images using Imaging API. See here and here. The latter is a part of free OpenNETCF SDF




Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Tryst

Hi Alex,

so to do any form of Transparency I'll need to the OpenNETCF SDF (as both of your links refer to it)

Thanks





Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Alex Feinman

What's in SDF is the same stuff that I presented at MEDC2006. The download for CLI328 can be found here




Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Tryst

Hi Alex,

I have downloaded the sample apps from the link you provided, but in the UPnPFinder project I get a COM Exception generated on the following line of code that sits in the SearchForDevices() method...

object oInst = Activator.CreateInstance(tFinder);

I get the following message:

COM object with CLSID '{E2085F28-FEB7-404A-B8E7-E659BDEAAA02}' cannot be created due to the following error: Class not registered.

How can I get around this, as I ain't too familar with COM

(I am running this in VS2005 and through the WM 5.0 PocketPC Emulator).

(Also, is this the project that makes use of transparency, as the other project in the download, although made use of images, I couldn't see anything to do with transparency.)

Thanks





Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Alex Feinman

Sorry, my bad. This is actually more of UPNP sample. It does not do much wrt transparent drawing.

Transparency is actually discussed in my blog: http://blog.opennetcf.org/afeinman/default,date,2006-02-03.aspx






Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Tryst

Hi Alex, me again :)

Uhm, i'm just going through your blog on Transparency (the link that you provided) and am having some issues with it. On the following lines of code from your example...

factory.CreateImageFromStream("rgba8.png"), out img);
Graphics
g = Graphics.FromImage(imageBackground);

On the first line you are missing an open bracket, or you have one closing bracket too many. Also, should it be CreateImageFromFile() as you are passing in a file name

Also, what is supposed to be in the 'imageBackground variable

In my scenario, I have several PictureBox Controls on my Form that contain PNG images, but when my app runs on a WM4.2 based device (such as the Symbol MC50) the image loses its transparency - using your provided example, how can I get this PNG's tranparency to work when it is contained in a PictureBox Control Does this somehow have to be passed in as the imageBackground variable

Thanks in advance.





Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Alex Feinman

I corrected the blog entry. Thank you for pointing it out.

As for using transparency in the PictureBox control, I don't believe it is supported by the picturebox control.






Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Tryst

Hi, thanks for the reply.

If they are not for PictureBox Controls, then in what scenario (or where) do these transparent images get used in your example As I was under the impression that if you wanted to display images on a Mobile Form, you had to place them in a PictureBox Control...





Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Alex Feinman

I would normally use transparent images in the image composition - custom controls mostly. Also composed image can be placed into a picturebox. Just don't expect the picture box to retain transparency




Re: Smart Devices VB and C# Projects Transparent images inC#.NET Compact Framework

Johan Andersson

I just found a solution what regards the PictureBox problem. I posted my solution here:
http://johan.andersson.net/blog/2007/10/solution-for-transparent-images-on.html

- Johan