Main Site Documentation

DrawImage method


I created a new project for TinyCLR: NewCLR.

This is all that is in it: It would compile, deploy and run.

I went thru the procedure above to add a bitmap resource. and this is the result:

It successfully built (ctrl+shift+B). However, F5 produced:

I must be doing something wrong (??)


Send us your image, or whole new - simple project that you just made. I am curious.


Where should I send it ?


I also started with the simple application and added the resource (but no image or file) and it deployed and ran fine


I then added a text file, ran fine.


Now I also added a different image and it worked as well. Seems the bitmap i was using was bad.


Bad or too big? Have you tried images of the same or larger size?


Probably too big. is the problem Height x Width ? or is it file size ?

I could only get a bmp of 32 x 32 to work ?


Is that a question? Please tell us what size image you have tried, in pixels and in bytes.


I got an image of 32 x 32, 3.1 kb, 72 dpi, color to work. The original ‘failed’ image was 134 x 38 (pixels), 2.6 kb, 96dpi, color. I also used paint to reduce it to 32X32 but it still failed.


I am have a 350KB image loaded now. Can you email me the image that is giving you hard time? my email is g@ghiele…


We found the problem! TinyCLR hates 16 color BMP files! Change it to 256 color or 24 bit and will work!

  1. Open the file in MS paint
  2. Save As
  3. Select 256 color or 24 bit BMP

Please let us know if this works for you.


Yes, that works. Thanks!


I created another bmp 256 color that is 315KB. Deployment failed:

Incrementally deploying assemblies to the device:
The deployment is 815,372 bytes which cannot fit into the deployment area which is 524,288 bytes.
Assemblies not successfully deployed to the device.
Deployment to the device was not successful.

Is there something else i need to do in order to deploy it?


Unfortunately no, the image you added is just way too big to fit into the deployment area. According to the message you posted you’re about 291KB oversize. If you need large images, try the gif file format since it is compressed.


Which image file formats are supported?


gif is the other supported format right now.


It would be nice to have functionality of loading an image from a file from a filesystem on an SD. Is something like that going to happen ?


You can do that today I believe


Do you have an example ?