Main Site Documentation

Can't Find References For FEZ Cobra Resources.GetBytes and Resources.BinaryResources.xxxxx


#1

Ok, UNCLE!

I can’t seem to find the references for Resources.GetBytes or Resources.BinaryResource anywhere for my FEZ Cobra. I see all kinds of examples referencing these two methods, but have not found a name space or reference for them. I’ve included the following name spaces:

using System.IO;
using System.Text;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Input;
using Microsoft.SPOT.IO;
using Microsoft.SPOT.Net.NetworkInformation;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using System;

using FastloadMedia.NETMF;
using FastloadMedia.NETMF.Hardware;
using FastloadMedia.NETMF.Net.Http;
//using FastloadMedia.NETMF.Crypto;

using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Hardware;
using GHIElectronics.NETMF.Native;

And all associated references. But nothing works. Where am I missing the boat?


#2

Pretty sure its under .Native?

RLP class.


#3

@ csailor

These methods are generated depending on the types of resources you have.


#4

I’ve included BMP resources so I can load them and VS cannot find any references.


#5

You don’t need to add a reference or a namespace as long as the namespace in your main Program class and in your Resource class match.

Are you getting compiler errors?


#6

Yes, I;m getting the two following errors:

Error 1 ‘FEZ_Cobra_Web_Server.Resources’ does not contain a definition for ‘GetBytes’
Error 2 ‘FEZ_Cobra_Web_Server.Resources’ does not contain a definition for ‘BinaryResources’

I can’t seem to find the definitions


#7

You need to add a binary resource using Resource editor. VS will generate the missing code. I believe there is a whole section in the beginners guide that has more details on that.


#8

I’ve added several BMP image files to the resource editor.


#9

Look in your Resources.Designer.cs file.


#10

Are trying some code example? BMP files are treated differently. Create something like “test.bin” and try to add it.


#11

From Wiki read: http://wiki.tinyclr.com/index.php?title=Loading_Resources