Implementation of transparent markers for Windows Mobile

Mar 11, 2010 at 6:57 AM
Edited Mar 11, 2010 at 7:07 AM

I have implemented transparent markers for Windows Mobile, as shown here:

The source for my implementation is here.

To add to the GMaps solution, you need to do the following:

1. Add 'GMapMarkerTransparent.cs' and 'GMapMarkerTransparentGoogleGreen.cs' to the 'GMap.NET.WindowsForms.Markers' folder of the GMap.NET.WindowsForms project.

2. Add a link to these two files to the 'GMap.NET.WindowsForms.Markers' folder of the GMap.NET.WindowsMobile project.

3. Set the build action of 'bigMarkerGreen.png' and 'shadow50.png' to 'Embedded Resource' in both the WindowsForms and WindowsMobile project.  Transparency won't work without this change.  When using Properties.Resources.* (or any other .NET CF imaging objects) to access images, the .NET CF removes transparency information.  The images need to be loaded directly from a manifest resource stream to preserve transparency which is why the build action needs to be changed to 'Embedded Resource'.

4. To view a sample, replace MainForm.cs in either the Windows Forms or Windows Mobile project with the appropriate version from the ZIP file.

As demonstrated by the GMapMarkerTransparentGoogleGreen class, it is easy to implement your own transparent markers based on the abstract GMapMarkerTransparent class.  Just remember to load images directly from a resource stream or file stream to preserve transparency information.

This is implemented with code from both here and here.

Mar 11, 2010 at 2:56 PM

thats outstanding perfect! ;} any ideas to apply this technique to draw label overly in hybrid map mode?

Mar 14, 2010 at 8:15 AM

I'm happy to give it a go... have you got a picture to show the effect you are wanting to achieve?

Mar 14, 2010 at 3:03 PM
Edited Mar 14, 2010 at 3:04 PM

it's not effect, just two layers of tile, set map type to GoogleHybrid in desktop demo, the same should be in mobile version too ;}