Main Site Documentation

DrawImage method


#21

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:
image

I must be doing something wrong (??)


#22

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


#23

Where should I send it ?


#24

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


#25

I then added a text file, ran fine.


#26

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


#27

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


#28

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 ?


#29

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


#30

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.


#31

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…


#32

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.


#33

Yes, that works. Thanks!


#34

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?


#35

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.


#36

Which image file formats are supported?


#37

gif is the other supported format right now.


#38

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 ?


#39

You can do that today I believe


#40

Do you have an example ?