Getting error when creating a bitmap for Mappoint map image

A

amyyoungblood

I am trying to plot my pushpins manually, but when I go to create the
bitmap, I get an error message. Has anyone gotten this message
before?

code:
MapImage[] mapImages = render.GetMap(mapSpec);
MapImage mi = new MapImage();
mi = mapImages[0];

Bitmap newBitmap = new Bitmap(800, 600);
Graphics graphics = Graphics.FromImage(newBitmap);
Bitmap mapBitmap = new Bitmap(new
System.IO.MemoryStream(mi.MimeData.Bits));

I get error message when the bitmap line that says:
Object reference not set to an instance of an object.
 
N

Nicholas Paldino [.NET/C# MVP]

Well, it's one of three things, it's either mi, the MimeData property on
mi, or the BitsProperty on the return value of the MimeData property on mi.
Have you looked in the debugger to see which it is?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top