NullReferenceException on LoadBitmap()

Topics: General
Feb 14, 2012 at 11:33 AM
Edited Feb 14, 2012 at 11:35 AM

Hallo everybody,

firsly thanks for all for this project, great job :)

I have problems with the GMarkerGoogle. I have integrated the whole GMarkerGoogle Resources to my VisualStudio.

When iam starting the project, its all right and OK the currentmarker,

currentMarker = new GMarkerGoogle(MainMap.Position, GMarkerGoogleType.green_small

 is showing gree_small. That is OK.


But now to the Problem i want to show the Route with this code

GMapMarker m1 = new GMarkerGoogle(start, GMarkerGoogleType.green_big_go);
            var m3 = GMapProviders.GoogleMap.GetPlacemark(currentMarker.Position, out status);


but if i am click start route, than iam getting a NullReferenceException on LoadBitmap() on class GMarkerControl.

Size =  new System.Drawing.Size (Bitmap.Width, Bitmap.Height); <--- NullReferenceException

I dont know, why??

Feb 14, 2012 at 11:55 AM

'integrated Resources' wtf ;/

Feb 14, 2012 at 4:06 PM
Edited Feb 14, 2012 at 4:06 PM

I want to have other new images as marker, so i have added new Recources to my project designer with Recources.resx!

and now i have a NullReferenceException on start route with this marker, do you understand my problem??  :)

Feb 14, 2012 at 5:55 PM

it's easy, use your brain ;}

Feb 14, 2012 at 8:44 PM

sorry i use my brain, but i still get a NullReferenceException :)

Feb 15, 2012 at 8:44 AM

..just debug, find what object is null, all internal bitmaps are ok

Feb 15, 2012 at 9:28 AM

Size =  new System.Drawing.Size (Bitmap.Width, Bitmap.Height) is null

on LoadBitmap() on class GMarkerControl.

Feb 15, 2012 at 9:36 AM

not for me ;}

Feb 15, 2012 at 1:11 PM

The problem is solved, the name of resources was wrong, painful :)