Main Site Documentation

DrawImage method


#1

I am trying to display an image with the DrawImage method. I am trying to load the image from a file but have been unsuccessful. (using 1.0.0 libraries on UC5550)
Any hints ?


#2

Have you been able to add the image you want to a resource file in your Visual Studio project? Keep in mind only gif and bmp are supported in the 1.0 release.


#3

No, i have not been able to add the image to resources. when I did, I could no longer load the software to the 5550


#4

Capture output screen so we can see why


#5

When I do a build, (F5) I get “There were deployment errors, continue”. I respond “yes” and get “Failed to generate device specific assemblies…”


#6

How large is the image?


#7

Can you also paste the contents of the resx file and the resx designer file here?


#8

I am having trouble adding the bmp file as a resource. Is there a step by step procedure for doing this. I have googled and everything i tried did not work, such as:

http://www.csharp411.com/embedded-image-resources/


#9

Did you “add new file” and select resource to your project? Share some screenshots please.


#10

UC5550 has only 512K for application. Make sure (C# code application + image size) within 512KB.

Step 1

step 2

step 3

step 4

Step 5

Step 6


#11

I have a few hardware questions regarding the UC5550 hardware. I am working with Tom on this project and am a little concerned with 512kb limit (mostly due to amount of images we will likely use on screen).
Capture

The UC5550 has 2 Mbyte of internal flash. What is the other ~1500kb of flash used for? I noticed the G400 spec listed no internal flash but only external flash. Is the external flash used for application on G400?

I assume both the external RAM and Flash on UC5550 are used for parallel screen functionality? Is this correct or what are they primarily used for?

Lastly, a questions on pin multiplexing on UCM standard. There are 12 GPIO pins on the standard and this should be fine for our application. However, can the PWM or ADC pins be used as GPIO pins on UCM standard. Thanks!


#12

What is the other ~1500kb of flash used for?

This is for firmware ( here is the file UC5550 Firmware.glb). The firmware size now is around 350K, but TinyCLR is growing, more features will be added.

can the PWM or ADC pins be used as GPIO pins on UCM standard

Yes.


#13

Thanks for the quick answers. What is external RAM and external Flash used for on the UCM standard? On the G400D is the external Flash used to store the application?


#14

What is external RAM and external Flash used for on the UCM standard

External Ram: for heap, example you need an array size 1MB then internal SRAM isn’t fit (because internal RAM has only 512KB), or an LCD has 800x600 screen size (take 800x600x2 = 960KB). So external RAM 32MB will help you with large buffers.

External Flash: Once day 2MB of flash is not enough this this external flash will help.


#15

Here is the sequence I went thru to add bitmap as a resource.

Here is what I am starting with:

image

image

image

Then I proceeded:

image

image

Then saved it. Here is the results:

image

image

Trying to do a build and got:

image

image

And of course, it did not upload to the UCM.

What did I miss ??


#16

Do you have something like this in your app?

using TinyCLR_UI.Properties; // namespace Needed for Resources

namespace TinyCLR_UI
{
class Program : Application
{
}
}


#17

Yes,
GHIElectronics.TinyCLR.UI;


#18

Keep your application empty and only add the resource, does it deploy? Now try with a very small image? And now with small file that is not an image. Do you see any difference?

I am just getting to narrow it down please.


#19

Are there facilities in libraries/TinyCLR to access the peripheral control registers ?


#20

You can use System.Runtime.InteropServices.Marshal to write/read from any address.

Would you please start your question in a new thread if the question is not related? This will help other users.