Skip to Content
Getting Started with .NET Gadgeteer
book

Getting Started with .NET Gadgeteer

by Simon Monk
May 2012
Beginner
88 pages
2h 4m
English
O'Reilly Media, Inc.
Content preview from Getting Started with .NET Gadgeteer

Putting It All Together

We now have everything we need for the project, we just need to combine the “HelloWebServer” and “SketchPad” projects into one, and add some code to serve back the image on the screen rather than just text.

Load the project “WebMessenger” into Visual Studio.

Figure 4-10 shows the arrangements of the modules and as you would expect, we use a combination of all the modules from the “HelloWebServer” and “SketchPad” projects.

One of the first things to notice in the code is that there is a new “using” line at the top. This is to include a utility method that we need to use to convert the bitmap on the screen to a BMP file format:

using GHIElectronics.NETMF.System;

This method is to be found in an assembly that is not automatically included in the project. So, if you were starting your own project that needed to use this, you would have to refer to it from your project.

To do this, right-click over the project, select the option “Add Reference…”, then select “GHIElectronics.NETMF.System” from the list (see Figure 4-9).

Documentation for this method and other useful things can be found here: http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/

We define a WebEvent and call it sketch. The following shows the handler for WebEventReceived for this WebEvent:

void sketch_WebEventReceived(string path, WebServer.HttpMethod method, Responder responder) { Bitmap bitmap = background.Bitmap; byte[] buff = new byte[bitmap.Width * bitmap.Height * 3 + 54]; Util.BitmapToBMPFile(bitmap.GetBitmap(), ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

C# 7 and .NET Core 2.0 High Performance

C# 7 and .NET Core 2.0 High Performance

Ovais Mehboob Ahmed Khan
Microsoft® SQL Server® 2012 Integration Services

Microsoft® SQL Server® 2012 Integration Services

Rakesh Parida Wee-Hyong Tok Matt Masson, Xiaoning Ding, and Kaarthik Sivashanmugam

Publisher Resources

ISBN: 9781449330682Catalog PageErrata