ImageData - how to set the bitmap

Developer
Nov 13, 2010 at 4:27 AM

I'm trying to set the Bitmap of the DotSpatial.Data.ImageData object to an in-memory generated bitmap.

the code:

ImageData myI = new ImageData()
myI.SetBitmap(myBitmap()

doesn't work because SetBitmap() method only sets the bitmap when InternalImage != null.

In the previous version of DotSpatial ImageData had a constructor with a .NET bitmap as a parameter. Is there any specific reason why the constructor was removed?

 

Thanks,

Jiri

Developer
Nov 13, 2010 at 4:33 AM

OK, I figured it out.

I need to use the DotSpatial.Data.InRamImageData class.

Nov 13, 2010 at 11:01 AM

Great post, thanks for that tip! I had a similar problem, since I need to draw bitmap on top of other image

Dragan

Developer
Nov 13, 2010 at 3:20 PM

Yes, hopefully we can get some documentation ready soon that will help people find their way a little easier =).  The original in-ram implementation was MWImageData, and I didn't really feel that "DotSpatialImageData" conveyed anything meaningful about what it did.  InRamImageData seemed like a good functional name.