Hands-On Lab. Multi-Touch WMTouch - Native. Lab version: Last updated: 12/3/2010

Size: px
Start display at page:

Download "Hands-On Lab. Multi-Touch WMTouch - Native. Lab version: Last updated: 12/3/2010"

Transcription

1 Hands-On Lab Multi-Touch WMTouch - Native Lab version: Last updated: 12/3/2010

2 CONTENTS OVERVIEW... 3 EXERCISE 1: BUILD A MULTI-TOUCH APPLICATION... 5 Task 1 Create the Win32 Application... 5 Task 2 Test the Existence and Readiness of Multi-touch Hardware... 6 Task 3 Add the Stroke Source and Header Files to the Project, and Draw Lines with your Fingers.. 7 SUMMARY

3 Overview Windows 7 gives users the ability to manage applications with the touch of their fingers, using no intermediate device. This expands the stylus-based capabilities of tablet PCs. Unlike other pointing devices, this new capability allows multiple input events at the same time from different pointing locations, and it enables complex scenarios, such as managing applications with ten fingers or with multiple simultaneous users.however, to pull this off, we have to adapt our application's user interface and behavior to support this new input model. Objectives In this Hands-On Lab, you will learn how to manage gesture events, including: Understanding the implications of manipulating multiple touch events simultaneously Checking for multi-touch hardware existence and readiness Extracting information from the WM_TOUCH Windows Message System Requirements You must have the following items to complete this lab: Microsoft Visual Studio 2008 SP1 Windows 7 The Windows 7 SDK A multi-touch hardware device Introduction To have a Multi-Touch driven application you can choose one of three approaches, the Good, The Better and the Best. The Good approach is the easiest between the three. You should design your application user interface with touch ability in mind. Use large and clean Win32 based controls that make a natural interface for better user experience. Touch abilities such as scrolling come from the Win32 controls. There is no need for extra work. For example, try to scroll the document that you are reading now with your fingers! This is the Good approach. The "Better" approach lets the system receives the various low level touch events and get the result of the heuristics that the system does with these events. For 3

4 example the user made a rotation movement on the screen; the system will issue a rotation gesture event with the rotation angle. Although the "Better" approach is easy to use, it has its limitations. Using gesture one cannot get Rotate, Translate and Scale simultaneously. Also you cannot handle many different touch based actions in the same time. For example two users that operate different areas of the Window. The Best approach is to read the low level touch events as the input to the application. Applications like Piano or complex controls like multiple-sliders that can be operate simultaneously are good examples. Run MS Paint, select a drawing tool from the gallery and draw with five of your fingers (if the hardware permits) In this Hands-On Lab you we will mimic the new MS Paint multi-touch painting feature. We will use the Best approach. We will read and use the raw touch events. Enter the Low-level WM_TOUCH Multitouch message decoding. About the Multi-touch Scratchpad Application The Multi-touch Scratchpad application presents a simple window that allows simultaneously drawing of continues lines with your fingers. In the HOL folder you can find a project for each task of the lab. The Starter folder contains files that you will need during the lab. A finished version of the lab is located in the Final folder. 4

5 Exercise 1: Build a Multi-touch Application Task 1 Create the Win32 Application 1. Start Visual Studio 2008 SP1 2. Select new based Win32 application project: 5

6 3. Compile and run! 4. We are going to use APIs and Macros that belong to Windows 7, change the WINVER and _WIN32_WINNT definitions in the targetver.h header file to 0x0601 #ifndef WINVER //Specifies that the minimum required platform is Windows 7 #define WINVER 0x0601 #endif #ifndef _WIN32_WINNT //Specifies that the minimum required platform is Win 7 #define _WIN32_WINNT 0x0601 #endif 5. Compile and run! Task 2 Test the Existence and Readiness of Multi-touch Hardware 6

7 1. The application that we are building requires touch-enable computer, add the following code, before the call to InitInstance() in the _twinmain(), to check the hardware touch ability and readiness: BYTE digitizerstatus = (BYTE)GetSystemMetrics(SM_DIGITIZER); if ((digitizerstatus & (0x80 + 0x40)) == 0) //Stack Ready + MultiTouch MessageBox(0, L"No touch support is currently availible", L"Error", MB_OK); return 1; BYTE ninputs = (BYTE)GetSystemMetrics(SM_MAXIMUMTOUCHES); wsprintf(sztitle, L"%s - %d touch inputs", sztitle, ninputs); 2. You can see that besides checking for touch availability and readiness we also find out the number of touch inputs that the hardware support. 3. Compile and run! Task 3 Add the Stroke Source and Header Files to the Project, and Draw Lines with your Fingers We would like to use our fingers as a multiple mouse device. We want to draw a line with each of our fingers that touches the screen. To do that we are going to use two stroke collections. One collection holds the finished strokes (lines) and another collection holds the on-going currently painting lines. Each finger that touches the screen adds points to a stroke in the g_strkcoldrawing collection. When we 7

8 raise the finger from the screen, we move the finger's stroke from the g_strkcoldrawing to the g_strkcolfinished collection. At WM_PAINT we draw both collections. 1. In the Starter folder you will find two files: Stroke.h and Stroke.cpp. Copy them to the project folder and use Add Existing item to add them to the project. 2. Add an #include "Stroke.h" line at the top of MTScratchpadWMTouch.cpp file #include "Stroke.h" 3. Add global variables definition at the //Global Variables: section at the top of mtgesture.cpp file: CStrokeCollection g_strkcolfinished; // The user finished entering strokes. // The user lifted his or her finger. CStrokeCollection g_strkcoldrawing; // The Strokes collection the user is // currently drawing. 4. Add the following lines in the WndProc(), note that WM_PAINT has been already created by the application wizard: case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // Full redraw: draw complete collection of finished strokes and // also all the strokes that are currently in drawing. g_strkcolfinished.draw(hdc); g_strkcoldrawing.draw(hdc); EndPaint(hWnd, &ps); break; 5. Now it's time to enable WM_TOUCH messages. By default a Window receives WM_GESTURE messages. To switch to the low-level WM_TOUCH messages we need to call to the RegisterTouchWindow() API. Add the following code to the InitInstance() function just before the call to ShowWindow(): // Register the application window for receiving multi-touch input. if (!RegisterTouchWindow(hWnd, 0)) 8

9 MessageBox(hWnd, L"Cannot register application window for touch input", L"Error", MB_OK); return FALSE; 6. We asked Windows to send WM_TOUCH messages. WM_TOUCH message is a special message. Unless you asked the system not to gather multiple touch events in one message (see the TWF_FINETOUCH parameter) you get all of your touch points in one message. This is reasonable since the user touches the screen with many touch points simultaneously. Add the following lines to the WndProc() function: case WM_TOUCH: // A WM_TOUCH message can contain several messages from different contacts // packed together. unsigned int numinputs = (int) wparam; //Number of actual contact messages TOUCHINPUT* ti = new TOUCHINPUT[numInputs]; // Allocate the storage for //the parameters of the per- //contact messages // Unpack message parameters into the array of TOUCHINPUT structures, each // representing a message for one single contact. if (GetTouchInputInfo((HTOUCHINPUT)lParam, numinputs, ti, sizeof(touchinput))) // For each contact, dispatch the message to the appropriate message // handler. for(unsigned int i=0; i<numinputs; ++i) if (ti[i].dwflags & TOUCHEVENTF_DOWN) OnTouchDownHandler(hWnd, ti[i]); else if (ti[i].dwflags & TOUCHEVENTF_MOVE) OnTouchMoveHandler(hWnd, ti[i]); else if (ti[i].dwflags & TOUCHEVENTF_UP) OnTouchUpHandler(hWnd, ti[i]); 9

10 CloseTouchInputHandle((HTOUCHINPUT)lParam); delete [] ti; break; 7. The wparam holds the number of touch input that came with the WM_TOUCH message. The GetTouchInputInfo() API fills a TOUCHINPUT array with touch information for each touch point. After you finish to extract data from the TOUCHINPUT array, you need to call the CloseTouchInputHandle() to free system resources. Here is the definition of the TOUCHINPUT structure: (Extracted from WinUser.h) typedef struct tagtouchinput LONG x; LONG y; HANDLE hsource; DWORD dwid; DWORD dwflags; DWORD dwmask; DWORD dwtime; ULONG_PTR dwextrainfo; DWORD cxcontact; DWORD cycontact; TOUCHINPUT, *PTOUCHINPUT; typedef TOUCHINPUT const * PCTOUCHINPUT; /* * Conversion of touch input coordinates to pixels */ #define TOUCH_COORD_TO_PIXEL(l) ((l) / 100) /* * Touch input flag values (TOUCHINPUT.dwFlags) */ #define TOUCHEVENTF_MOVE 0x0001 #define TOUCHEVENTF_DOWN 0x0002 #define TOUCHEVENTF_UP 0x0004 Four parameters from the TOUCHINPUT structure are in our interest: The x and y are the touch location in screen coordination multiply by a hundred. This means that we need to divide each axis value by hundred (or use the TOUCH_COORD_TO_PIXEL() macro) and call ScreenToClient() to move to the Window coordination system. Be aware that if the screen is 10

11 set to High DPI (more than 96 DPI), you may also need to divide the values by 96 and multiply by the current DPI. For simplicity we skip this step in our application. The other two parameters are the dwid and dwflags. The dwflags tells us the type of the touch input: Down, Move or Up. In our application TOUCHEVENTF_DOWN starts new stroke, TOUCHEVENTF_MOVE adds another point to an existing stroke and TOUCHEVENTF_UP finishes a stroke and move it to the g_strkcolfinished collection. The last parameter is the dwid, this is the touch input identifier. When a finger touches the screen for the first time, a unique touch id is associated with the finger. All farther touch inputs that come from this finger get the same unique id until the last TOUCHEVENTF_UP input. When the finger leaves the screen the id is freed and may be reuse as a unique id for other finger that will touch the screen. It's time to handle the touch inputs, add the following functions before the WndProc() function: // Returns color for the newly started stroke. // in: // bprimarycontact flag, whether the contact is the primary contact // returns: // COLORREF, color of the stroke COLORREF GetTouchColor(bool bprimarycontact) static int s_icurrcolor = 0; // Rotating secondary color index static COLORREF s_arrcolor[] = // Secondary colors array RGB(255, 0, 0), // Red RGB(0, 255, 0), // Green RGB(0, 0, 255), // Blue RGB(0, 255, 255), // Cyan RGB(255, 0, 255), // Magenta RGB(255, 255, 0) // Yellow ; COLORREF color; if (bprimarycontact) // The application renders the primary contact in black. color = RGB(0,0,0); // Black else // Take the current secondary color. color = s_arrcolor[s_icurrcolor]; // Move to the next color in the array. s_icurrcolor = (s_icurrcolor + 1) % (sizeof(s_arrcolor)/sizeof(s_arrcolor[0])); 11

12 return color; // Extracts contact point in client area coordinates (pixels) from a // TOUCHINPUT structure. // in: // hwnd window handle // ti TOUCHINPUT structure (info about contact) // returns: // POINT with contact coordinates POINT GetTouchPoint(HWND hwnd, const TOUCHINPUT& ti) POINT pt; pt.x = TOUCH_COORD_TO_PIXEL(ti.x); pt.y = TOUCH_COORD_TO_PIXEL(ti.y); ScreenToClient(hWnd, &pt); return pt; // Handler for touch-down input. // in: // hwnd window handle // ti TOUCHINPUT structure (info about contact) void OnTouchDownHandler(HWND hwnd, const TOUCHINPUT& ti) // Create a new stroke, add a point, and assign a color to it. CStroke strknew; POINT p = GetTouchPoint(hWnd, ti); strknew.addpoint(p); strknew.setcolor(gettouchcolor((ti.dwflags & TOUCHEVENTF_PRIMARY)!= 0)); strknew.setid(ti.dwid); // Add the new stroke to the collection of strokes being drawn. g_strkcoldrawing.addstroke(strknew); // Handler for touch-move input. // in: // hwnd window handle // ti TOUCHINPUT structure (info about contact) void OnTouchMoveHandler(HWND hwnd, const TOUCHINPUT& ti) // Find the stroke in the collection of the strokes being drawn. int istrk = g_strkcoldrawing.findstrokebyid(ti.dwid); POINT p = GetTouchPoint(hWnd, ti); 12

13 // Add the contact point to the stroke. g_strkcoldrawing[istrk].addpoint(p); // Partial redraw: redraw only the last line segment. HDC hdc = GetDC(hWnd); g_strkcoldrawing[istrk].drawlast(hdc); ReleaseDC(hWnd, hdc); // Handler for touch-up message. // in: // hwnd window handle // ti TOUCHINPUT structure (info about contact) void OnTouchUpHandler(HWND hwnd, const TOUCHINPUT& ti) // Find the stroke in the collection of the strokes being drawn. int istrk = g_strkcoldrawing.findstrokebyid(ti.dwid); // Add the finished stroke to the collection of finished strokes. g_strkcolfinished.addstroke(g_strkcoldrawing[istrk]); // Remove finished stroke from the collection of strokes being drawn. g_strkcoldrawing.removestroke(istrk); // Redraw the window. InvalidateRect(hWnd, NULL, FALSE); 8. To make the drawing a little bit more interesting we pick a different color for each unique id. The primary touch is the first finger that touched the screen. It is special inout since it act as the mouse pointer. We chose to give it a black color. Compile the application and run! You can touch it now! 13

14 Summary In this lab, you have learned how to consume the low level WM_TOUCH messages. You ve seen how to test for the existence of multi-touch hardware. How to configure a Window to get the WM_TOUCH message, how to extract the inputs from the message and how the system correlate touch id to a touch input. Enjoy and keep in touch! 14

Hands-On Lab. Multitouch Gestures - Native. Lab version: Last updated: 12/3/2010

Hands-On Lab. Multitouch Gestures - Native. Lab version: Last updated: 12/3/2010 Hands-On Lab Multitouch Gestures - Native Lab version: 1.0.0 Last updated: 12/3/2010 CONTENTS OVERVIEW... 3 EXERCISE 1: BUILD A MULTITOUCH APPLICATION... 7 Task 1 Create the Win32 Application... 7 Task

More information

Windows Touch 程式開發入門 許煜坤 台灣微軟研究開發處 2010/1/20

Windows Touch 程式開發入門 許煜坤 台灣微軟研究開發處 2010/1/20 Windows Touch 程式開發入門 許煜坤 台灣微軟研究開發處 2010/1/20 Agendas Good, Better, Best model Platforms details Native Win32 APIs MS Windows SDK 7.0 Windows 7 Multi-Touch.Net Interop Sample Library VS2008 (Windows Form,

More information

Comparing Touch Coding Techniques - Windows 8 Desktop Touch Sample

Comparing Touch Coding Techniques - Windows 8 Desktop Touch Sample Comparing Touch Coding Techniques - Windows 8 Desktop Touch Sample Abstract There are three ways to support touch input and gestures in Microsoft Windows 8* Desktop apps: Using the WM_POINTER, WM_GESTURE,

More information

Programming in graphical environment. Introduction

Programming in graphical environment. Introduction Programming in graphical environment Introduction The lecture Additional resources available at: http://www.mini.pw.edu.pl/~maczewsk/windows_2004 Recommended books: Programming Windows - Charles Petzold

More information

Advantech Windows CE.net Application Hand on Lab

Advantech Windows CE.net Application Hand on Lab Advantech Windows CE.net Application Hand on Lab Lab : Serial Port Communication Objectives After completing this lab, you will be able to: Create an application to open, initialize the serial port, and

More information

We display some text in the middle of a window, and see how the text remains there whenever the window is re-sized or moved.

We display some text in the middle of a window, and see how the text remains there whenever the window is re-sized or moved. 1 Programming Windows Terry Marris January 2013 2 Hello Windows We display some text in the middle of a window, and see how the text remains there whenever the window is re-sized or moved. 2.1 Hello Windows

More information

Different Ways of Writing Windows Programs

Different Ways of Writing Windows Programs How Windows Works Notes for CS130 Dr. Beeson Event-Driven Programming. In Windows, and also in Java applets and Mac programs, the program responds to user-initiated events: mouse clicks and key presses.

More information

Windows and Messages. Creating the Window

Windows and Messages. Creating the Window Windows and Messages In the first two chapters, the sample programs used the MessageBox function to deliver text output to the user. The MessageBox function creates a "window." In Windows, the word "window"

More information

Edupen Pro User Manual

Edupen Pro User Manual Edupen Pro User Manual (software for interactive LCD/LED displays and monitors) Ver. 3 www.ahatouch.com Some services in Edupen Pro require dual touch capability. In order to use dual touch, your computer

More information

Aspect-Oriented Programming with C++ and AspectC++ AOSD 2007 Tutorial. Part V Examples. Examples V/1

Aspect-Oriented Programming with C++ and AspectC++ AOSD 2007 Tutorial. Part V Examples. Examples V/1 Aspect-Oriented Programming with C++ and AspectC++ AOSD 2007 Tutorial Part V V/1 AspectC++ in Practice - Applying the observer protocol Example: a typical scenario for the widely used observer pattern

More information

TDDE18 & 726G77. Functions

TDDE18 & 726G77. Functions TDDE18 & 726G77 Functions Labs update No more one time password. We will note who have demonstrated during the lab and register this in webreg. Use the terminal to send in your lab! Dont use Visual studio

More information

Windows Programming. 1 st Week, 2011

Windows Programming. 1 st Week, 2011 Windows Programming 1 st Week, 2011 시작하기 Visual Studio 2008 새프로젝트 파일 새로만들기 프로젝트 Visual C++ 프로젝트 Win32 프로젝트 빈프로젝트 응용프로그램설정 Prac01 솔루션 새항목추가 C++ 파일 main.cpp main0.cpp cpp 다운로드 솔루션빌드 오류 Unicode vs. Multi-Byte

More information

Computer Programming Lecture 11 이윤진서울대학교

Computer Programming Lecture 11 이윤진서울대학교 Computer Programming Lecture 11 이윤진서울대학교 2007.1.24. 24 Slide Credits 엄현상교수님 서울대학교컴퓨터공학부 Computer Programming, g, 2007 봄학기 Object-Oriented Programming (2) 순서 Java Q&A Java 개요 Object-Oriented Oriented Programming

More information

Chapter 3. Texture mapping. Learning Goals: Assignment Lab 3: Implement a single program, which fulfills the requirements:

Chapter 3. Texture mapping. Learning Goals: Assignment Lab 3: Implement a single program, which fulfills the requirements: Chapter 3 Texture mapping Learning Goals: 1. To understand texture mapping mechanisms in VRT 2. To import external textures and to create new textures 3. To manipulate and interact with textures 4. To

More information

Foxit Reader SDK. Programming Guide

Foxit Reader SDK. Programming Guide Foxit Reader SDK For Windows and Linux Programming Guide Revision 1.4 Foxit Software Company 2005.12 Overview Features Tutorials Calling from Different Programming Languages Reference Redistribution Overview

More information

int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4

int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4 RP-VL-UTIL-V1 Developer s Guide [ Contents ] 1. Introduction... 1 2. Building Environment... 1 3. Operating Environment... 1 4. Function Explanation... 2 4.1. Common API for Transmitting and Receiving...

More information

MOBILE COMPUTING Practical 1: Graphic representation

MOBILE COMPUTING Practical 1: Graphic representation MOBILE COMPUTING Practical 1: Graphic representation Steps 2) Then in class view select the Global, in global select the WINMAIN. 3) Then write the below code below #define MAX_LOADSTRING 100 enum Shapes

More information

Window programming. Programming

Window programming. Programming Window programming 1 Objectives Understand the mechanism of window programming Understand the concept and usage of of callback functions Create a simple application 2 Overview Windows system Hello world!

More information

Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm

Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm 15-123 Effective Programming in C and UNIX Lab 6 Image Manipulation with BMP Images Due Date: Sunday April 3rd, 2011 by 11:59pm The Assignment Summary: In this assignment we are planning to manipulate

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

Lab 2: ADT Design & Implementation

Lab 2: ADT Design & Implementation Lab 2: ADT Design & Implementation By Dr. Yingwu Zhu, Seattle University 1. Goals In this lab, you are required to use a dynamic array to design and implement an ADT SortedList that maintains a sorted

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam Three 10 April 2013

ECE 2035 Programming HW/SW Systems Spring problems, 6 pages Exam Three 10 April 2013 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

More information

User Guide pdoc Signer for Apple ipad

User Guide pdoc Signer for Apple ipad User Guide pdoc Signer for Apple ipad Version 1.4 July 18, 2017 Copyright 2017 Topaz Systems Inc. All rights reserved. For Topaz Systems, Inc. trademarks and patents, visit www.topazsystems.com/legal.

More information

LSN 4 GUI Programming Using The WIN32 API

LSN 4 GUI Programming Using The WIN32 API LSN 4 GUI Programming Using The WIN32 API ECT362 Operating Systems Department of Engineering Technology LSN 4 Why program GUIs? This application will help introduce you to using the Win32 API Gain familiarity

More information

EXAMINATIONS 2016 TRIMESTER 2

EXAMINATIONS 2016 TRIMESTER 2 EXAMINATIONS 2016 TRIMESTER 2 CGRA 151 INTRODUCTION TO COMPUTER GRAPHICS Time Allowed: TWO HOURS CLOSED BOOK Permitted materials: Silent non-programmable calculators or silent programmable calculators

More information

Detecting USB Device Insertion and Removal Using Windows API

Detecting USB Device Insertion and Removal Using Windows API Written by Tom Bell Detecting USB Device Insertion and Removal Using Windows API When I needed to know how to detect USB device insertion and removal, I was developing an application for backing up USB

More information

Chapter 15 Programming Paradigm

Chapter 15 Programming Paradigm Chapter 15 Programming Paradigm A Windows program, like any other interactive program, is for the most part inputdriven. However, the input of a Windows program is conveniently predigested by the operating

More information

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW

IMPORTANT QUESTIONS IN C FOR THE INTERVIEW IMPORTANT QUESTIONS IN C FOR THE INTERVIEW 1. What is a header file? Header file is a simple text file which contains prototypes of all in-built functions, predefined variables and symbolic constants.

More information

Multi-Touch Screen SDK Reference

Multi-Touch Screen SDK Reference Multi-Touch Screen SDK Reference PQ Multi-Touch SDK Reference Revisions v1.1 2009-06-16 v1.2 2009-07-22 Attention that client of version 1.2 is not compatible with that of v1.1, you need to recompile the

More information

PusleIR Multitouch Screen Software SDK Specification. Revision 4.0

PusleIR Multitouch Screen Software SDK Specification. Revision 4.0 PusleIR Multitouch Screen Software SDK Specification Revision 4.0 Table of Contents 1. Overview... 3 1.1. Diagram... 3 1.1. PulseIR API Hierarchy... 3 1.2. DLL File... 4 2. Data Structure... 5 2.1 Point

More information

NVJPEG. DA _v0.2.0 October nvjpeg Libary Guide

NVJPEG. DA _v0.2.0 October nvjpeg Libary Guide NVJPEG DA-06762-001_v0.2.0 October 2018 Libary Guide TABLE OF CONTENTS Chapter 1. Introduction...1 Chapter 2. Using the Library... 3 2.1. Single Image Decoding... 3 2.3. Batched Image Decoding... 6 2.4.

More information

COMP26120: Linked List in C (2018/19) Lucas Cordeiro

COMP26120: Linked List in C (2018/19) Lucas Cordeiro COMP26120: Linked List in C (2018/19) Lucas Cordeiro lucas.cordeiro@manchester.ac.uk Linked List Lucas Cordeiro (Formal Methods Group) lucas.cordeiro@manchester.ac.uk Office: 2.28 Office hours: 10-11 Tuesday,

More information

IFE: Course in Low Level Programing. Lecture 5

IFE: Course in Low Level Programing. Lecture 5 Lecture 5 Windows API Windows Application Programming Interface (API) is a set of Windows OS service routines that enable applications to exploit the power of Windows operating systems. The functional

More information

Call DLL from Limnor Applications

Call DLL from Limnor Applications Call DLL from Limnor Applications There is a lot of computer software in the format of dynamic link libraries (DLL). DLLCaller performer allows your applications to call DLL functions directly. Here we

More information

C PROGRAMMING LANGUAGE. POINTERS, ARRAYS, OPERATORS AND LOOP. CAAM 519, CHAPTER5

C PROGRAMMING LANGUAGE. POINTERS, ARRAYS, OPERATORS AND LOOP. CAAM 519, CHAPTER5 C PROGRAMMING LANGUAGE. POINTERS, ARRAYS, OPERATORS AND LOOP. CAAM 519, CHAPTER5 1. Pointers As Kernighan and Ritchie state, a pointer is a variable that contains the address of a variable. They have been

More information

Nisca Print Drivers for Windows

Nisca Print Drivers for Windows Nisca Print Drivers for Windows Programmer s Reference Version 4.15 Revised March 17, 2005 Copyright This manual is copyrighted by TAB Software Corp. with all rights reserved. Under the copyright laws,

More information

UniFinger Engine SFR300 SDK Reference Manual

UniFinger Engine SFR300 SDK Reference Manual UniFinger Engine SFR300 SDK Reference Manual Version 2.5 2005 by Suprema Inc. Contents SF_Initialize...3 SF_Uninitialize...4 SF_SetFastMode...5 SF_GetDeviceNumber...6 SF_GetDevice...7 SF_SetDevice...8

More information

P.G.TRB - COMPUTER SCIENCE. c) data processing language d) none of the above

P.G.TRB - COMPUTER SCIENCE. c) data processing language d) none of the above P.G.TRB - COMPUTER SCIENCE Total Marks : 50 Time : 30 Minutes 1. C was primarily developed as a a)systems programming language b) general purpose language c) data processing language d) none of the above

More information

CS 380 Introduction to Computer Graphics. LAB (1) : OpenGL Tutorial Reference : Foundations of 3D Computer Graphics, Steven J.

CS 380 Introduction to Computer Graphics. LAB (1) : OpenGL Tutorial Reference : Foundations of 3D Computer Graphics, Steven J. CS 380 Introduction to Computer Graphics LAB (1) : OpenGL Tutorial 2018. 03. 05 Reference : Foundations of 3D Computer Graphics, Steven J. Gortler Goals Understand OpenGL pipeline Practice basic OpenGL

More information

Sparklet Embedded GUI Library User Manual

Sparklet Embedded GUI Library User Manual 1 E M B I E N T E C H N O L O G I E S Sparklet Embedded GUI Library User Manual Embien Technologies No 3, Sankarapandian Street, Madurai, India 625017 www.embien.com 2 3 Table of Contents 1 Introduction...

More information

QNX Software Development Platform 6.6. Input Events Library Reference

QNX Software Development Platform 6.6. Input Events Library Reference QNX Software Development Platform 6.6 QNX Software Development Platform 6.6 Input Events Library Reference 2011 2014, QNX Software Systems Limited, a subsidiary of BlackBerry Limited. All rights reserved.

More information

Visual Profiler. User Guide

Visual Profiler. User Guide Visual Profiler User Guide Version 3.0 Document No. 06-RM-1136 Revision: 4.B February 2008 Visual Profiler User Guide Table of contents Table of contents 1 Introduction................................................

More information

Porting 32-bit Applications to the Itanium Architecture - Lab 3: Managing Data Size

Porting 32-bit Applications to the Itanium Architecture - Lab 3: Managing Data Size Porting 32-bit Applications to the Itanium Architecture - Lab 3: Managing Data Size Introduction Overview Migrating your application from 32-bit to 64-bit will impact your data size in a number of ways.

More information

Line Drawing Algorithms

Line Drawing Algorithms Chapter 3 " Line Drawing Algorithms ~: Learning Objectives :~ The objectives of this chapter are to acquaint you with: + Scan conversion line drawing + Bresenham s line drawing + Drawing bar chart + Problems

More information

Overview of today s lecture. Quick recap of previous C lectures. Introduction to C programming, lecture 2. Abstract data type - Stack example

Overview of today s lecture. Quick recap of previous C lectures. Introduction to C programming, lecture 2. Abstract data type - Stack example Overview of today s lecture Introduction to C programming, lecture 2 -Dynamic data structures in C Quick recap of previous C lectures Abstract data type - Stack example Make Refresher: pointers Pointers

More information

BLM2031 Structured Programming. Zeyneb KURT

BLM2031 Structured Programming. Zeyneb KURT BLM2031 Structured Programming Zeyneb KURT 1 Contact Contact info office : D-219 e-mail zeynebkurt@gmail.com, zeyneb@ce.yildiz.edu.tr When to contact e-mail first, take an appointment What to expect help

More information

Problem 1. Multiple Choice (choose only one answer)

Problem 1. Multiple Choice (choose only one answer) Practice problems for the Final (Tuesday, May 14 4:30-6:30pm MHP 101). The Final Exam will cover all course material. You will be expected to know the material from the assigned readings in the book, the

More information

CISC 1600, Lab 2.1: Processing

CISC 1600, Lab 2.1: Processing CISC 1600, Lab 2.1: Processing Prof Michael Mandel 1 Getting set up For this lab, we will be using Sketchpad, a site for building processing sketches online using processing.js. 1.1. Go to http://cisc1600.sketchpad.cc

More information

#ifndef DOUBLE_LIST /* this string SHOULD NOT previously exist */ #define DOUBLE_LIST

#ifndef DOUBLE_LIST /* this string SHOULD NOT previously exist */ #define DOUBLE_LIST /* This is a personal header file. Call it double_list.h * Its name should be reflected into the macro definition (#define). * For instance, here I should say something like: * #define DOUBLE_LIST #ifndef

More information

Due Date: See Blackboard

Due Date: See Blackboard Source File: ~/2315/45/lab45.(C CPP cpp c++ cc cxx cp) Input: under control of main function Output: under control of main function Value: 4 Integer data is usually represented in a single word on a computer.

More information

Live2D Cubism Native Core API Reference. Version r3 Last Update 2018/07/20

Live2D Cubism Native Core API Reference. Version r3 Last Update 2018/07/20 Live2D Cubism Native Core API Reference Version r3 Last Update 2018/07/20 Changelog Update day Version Update Type Content 2018/06/14 r2 translation translation to English from Japanese 2018/07/20 r3 Corrected

More information

SWARMATHON 1 INTRO TO BIO-INSPIRED SEARCH

SWARMATHON 1 INTRO TO BIO-INSPIRED SEARCH SWARMATHON 1 INTRO TO BIO-INSPIRED SEARCH 1 SWARM ROBOTS ON MARS nasa.gov 1.1 BACKGROUND The Moses Biological Computation Lab at the University of New Mexico builds and does research with robots. The robots

More information

CSCI-243 Exam 1 Review February 22, 2015 Presented by the RIT Computer Science Community

CSCI-243 Exam 1 Review February 22, 2015 Presented by the RIT Computer Science Community CSCI-243 Exam 1 Review February 22, 2015 Presented by the RIT Computer Science Community http://csc.cs.rit.edu History and Evolution of Programming Languages 1. Explain the relationship between machine

More information

Introduction to Flash - Creating a Motion Tween

Introduction to Flash - Creating a Motion Tween Introduction to Flash - Creating a Motion Tween This tutorial will show you how to create basic motion with Flash, referred to as a motion tween. Download the files to see working examples or start by

More information

FPGA Device Driver Design Guide on Windows 7 Embedded

FPGA Device Driver Design Guide on Windows 7 Embedded FPGA Device Driver Design Guide on Windows 7 Embedded Yunrui Zhang Guangzhou ZHIYUAN Electronics Co.,LTD Contents 1 Driver Installation 2 Driver Library 3 Driver Design Guide 1. Driver Installation 1 Open

More information

Introduction to Computers By Jennifer King, YA and Marketing Librarian, Great Bend Public Library

Introduction to Computers By Jennifer King, YA and Marketing Librarian, Great Bend Public Library Introduction to Computers By Jennifer King, YA and Marketing Librarian, Great Bend Public Library Welcome and Introduction To better understand how to use computers, this course will teach you some basic

More information

Qno.2 Write a complete syantax of "Getparents" functions? What kind of value it return and when this function is use? Answer:-

Qno.2 Write a complete syantax of Getparents functions? What kind of value it return and when this function is use? Answer:- CS410 Visual Programming Solved Subjective Midterm Papers For Preparation of Midterm Exam Qno.1 How can I use the CopyTo method of the Windows Forms controls collection to copy controls into an array?

More information

GRAPHICS PROGRAMMING. LAB #3 Starting a Simple Vector Animation

GRAPHICS PROGRAMMING. LAB #3 Starting a Simple Vector Animation GRAPHICS PROGRAMMING LAB #3 Starting a Simple Vector Animation Introduction: In previous classes we have talked about the difference between vector and bitmap images and vector and bitmap animations. In

More information

EL6483: Brief Overview of C Programming Language

EL6483: Brief Overview of C Programming Language EL6483: Brief Overview of C Programming Language EL6483 Spring 2016 EL6483 EL6483: Brief Overview of C Programming Language Spring 2016 1 / 30 Preprocessor macros, Syntax for comments Macro definitions

More information

Creating a basic GUI application with Synergy and GUIX SK-S7G2

Creating a basic GUI application with Synergy and GUIX SK-S7G2 Creating a basic GUI application with Synergy and GUIX SK-S7G2 LAB PROCEDURE Description: The objective of this lab session is to detail the process of creating an embedded graphics user interface, starting

More information

Vision Cam PS / SM2-D

Vision Cam PS / SM2-D Vision Cam PS / SM2-D1024-80 Tutorial Version 1.2 (August 2008) TUT001 08/2008 V1.2 Strampe Systemelektronik GmbH & Co KG and Photonfocus AG reserve the right to make changes, without notice to the VisionCam

More information

Input and Interaction

Input and Interaction Input and Interaction 5 th Week, 2011 Graphical Input Devices Mouse Trackball Light Pen Data Tablet Joy Stick Space Ball Input Modes Input devices contain a trigger which can be used to send a signal to

More information

CS 61c: Great Ideas in Computer Architecture

CS 61c: Great Ideas in Computer Architecture Arrays, Strings, and Some More Pointers June 24, 2014 Review of Last Lecture C Basics Variables, functioss, control flow, types, structs Only 0 and NULL evaluate to false Pointers hold addresses Address

More information

User Interaction. User Interaction. Input devices. Input devices. Input devices GUIs and GUI design Event-driven programming 3D interaction

User Interaction. User Interaction. Input devices. Input devices. Input devices GUIs and GUI design Event-driven programming 3D interaction User Interaction User Interaction Input devices GUIs and GUI design Event-driven programming 3D interaction CS 465 lecture 19 2003 Steve Marschner 1 2003 Steve Marschner 2 Input devices Input devices Discrete

More information

Tokens, Expressions and Control Structures

Tokens, Expressions and Control Structures 3 Tokens, Expressions and Control Structures Tokens Keywords Identifiers Data types User-defined types Derived types Symbolic constants Declaration of variables Initialization Reference variables Type

More information

Contents. Chapter 1 Overview of the JavaScript C Engine...1. Chapter 2 JavaScript API Reference...23

Contents. Chapter 1 Overview of the JavaScript C Engine...1. Chapter 2 JavaScript API Reference...23 Contents Chapter 1 Overview of the JavaScript C Engine...1 Supported Versions of JavaScript...1 How Do You Use the Engine?...2 How Does the Engine Relate to Applications?...2 Building the Engine...6 What

More information

TacticalPad Table of Contents

TacticalPad Table of Contents User Guide TacticalPad Table of Contents Chalkboard Creating, Opening and Saving Projects... 5 Creating Tactical Formations... 6 Tactical Formations List... 8 Creating Animated Plays... 9 Animated Plays

More information

Micrium OS Kernel Labs

Micrium OS Kernel Labs Micrium OS Kernel Labs 2018.04.16 Micrium OS is a flexible, highly configurable collection of software components that provides a powerful embedded software framework for developers to build their application

More information

Creating a New USB project with KSDK and Processor Expert support in KDS

Creating a New USB project with KSDK and Processor Expert support in KDS Freescale Semiconductor Creating a New USB project with KSDK and Processor Expert support in KDS By: Technical Information Center Developing an USB application can involve to include some extra features

More information

Graphics and Java 2D Introduction OBJECTIVES. One picture is worth ten thousand words.

Graphics and Java 2D Introduction OBJECTIVES. One picture is worth ten thousand words. 1 2 12 Graphics and Java 2D One picture is worth ten thousand words. Chinese proverb Treat nature in terms of the cylinder, the sphere, the cone, all in perspective. Paul Cézanne Colors, like features,

More information

ECE 2035 A Programming Hw/Sw Systems Fall problems, 8 pages Final Exam 8 December 2014

ECE 2035 A Programming Hw/Sw Systems Fall problems, 8 pages Final Exam 8 December 2014 Instructions: This is a closed book, closed note exam. Calculators are not permitted. If you have a question, raise your hand and I will come to you. Please work the exam in pencil and do not separate

More information

I-Carver CNC Project Computer Directions. Rob MacIlreith Last Update Oct 2017

I-Carver CNC Project Computer Directions. Rob MacIlreith Last Update Oct 2017 I-Carver CNC Project Computer Directions Rob MacIlreith Last Update Oct 2017 READ THIS ENTIRE SLIDE FIRST Make sure you follow all the directions carefully. Mistakes in programming your design can be disastrous

More information

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable

Basic program The following is a basic program in C++; Basic C++ Source Code Compiler Object Code Linker (with libraries) Executable Basic C++ Overview C++ is a version of the older C programming language. This is a language that is used for a wide variety of applications and which has a mature base of compilers and libraries. C++ is

More information

PESIT-BSC Department of Science & Humanities

PESIT-BSC Department of Science & Humanities LESSON PLAN 15PCD13/23 PROGRAMMING IN C AND DATA Course objectives: STRUCTURES The objective of this course is to make students to learn basic principles of Problem solving, implementing through C programming

More information

Tutorial 7: Mouse Input

Tutorial 7: Mouse Input Tutorial 7: Mouse Input This win32 tutorial was created and written by Iczelion for MASM32. It was translated for use by HLA (High Level Assembly) users by Randall Hyde. All original copyrights and other

More information

Lab 3-2: Exploring the Heap

Lab 3-2: Exploring the Heap Lab 3-2: Exploring the Heap Objectives Become familiar with the Windows Embedded CE 6.0 heap Prerequisites Completed Lab 2-1 Estimated time to complete this lab: 30 minutes Lab Setup To complete this lab,

More information

ENCM 369 Winter 2017 Lab 3 for the Week of January 30

ENCM 369 Winter 2017 Lab 3 for the Week of January 30 page 1 of 11 ENCM 369 Winter 2017 Lab 3 for the Week of January 30 Steve Norman Department of Electrical & Computer Engineering University of Calgary January 2017 Lab instructions and other documents for

More information

CSE 333 Midterm Exam 5/9/14 Sample Solution

CSE 333 Midterm Exam 5/9/14 Sample Solution Question 1. (20 points) C programming. Implement the C library function strncpy. The specification of srncpy is as follows: Copy characters (bytes) from src to dst until either a '\0' character is found

More information

Stellaris Graphics Library Display Drivers

Stellaris Graphics Library Display Drivers Application Report AN01287 October 2011 Stellaris Graphics Library Display Drivers ABSTRACT The Stellaris Graphics Library (grlib) offers a compact yet powerful collection of graphics functions allowing

More information

Coursework Lab A. Open the coursework project

Coursework Lab A. Open the coursework project Coursework Lab A The aim of this lab session is for you to learn the basics of how the coursework framework works. In this first of two lab sessions you will learn about drawing backgrounds and handling

More information

SIGMA SIGMAP02 Plugin Developer's Manual

SIGMA SIGMAP02 Plugin Developer's Manual SIGMA SIGMAP02 Plugin Developer's Manual Application Note Address: ASIX s.r.o. Staropramenna 4 150 00 Prague Czech Republic E-Mail: WWW: sales@asix.net (sales inquiries, ordering) support@asix.net (technical

More information

CS 160: Interactive Programming

CS 160: Interactive Programming CS 160: Interactive Programming Professor John Canny 3/8/2006 1 Outline Callbacks and Delegates Multi-threaded programming Model-view controller 3/8/2006 2 Callbacks Your code Myclass data method1 method2

More information

Exercise Session 2 Simon Gerber

Exercise Session 2 Simon Gerber Exercise Session 2 Simon Gerber CASP 2014 Exercise 2: Binary search tree Implement and test a binary search tree in C: Implement key insert() and lookup() functions Implement as C module: bst.c, bst.h

More information

Graphics Overview ECE2893. Lecture 19. ECE2893 Graphics Overview Spring / 15

Graphics Overview ECE2893. Lecture 19. ECE2893 Graphics Overview Spring / 15 Graphics Overview ECE2893 Lecture 19 ECE2893 Graphics Overview Spring 2011 1 / 15 Graphical Displays 1 Virtually all modern computers use a full color Graphical Display device. 2 It displays images, text,

More information

EL2310 Scientific Programming

EL2310 Scientific Programming Lecture 12: Memory, Files and Bitoperations (pronobis@kth.se) Overview Overview Lecture 12: Memory, Files and Bit operations Wrap Up Main function; reading and writing Bitwise Operations Wrap Up Lecture

More information

Chapter 15. Drawing in a Window

Chapter 15. Drawing in a Window Chapter 15 Drawing in a Window 1 The Window Client Area A coordinate system that is local to the window. It always uses the upper-left corner of the client area as its reference point. 2 Graphical Device

More information

Introduction to Computer Graphics (CS602) Lecture No 04 Point

Introduction to Computer Graphics (CS602) Lecture No 04 Point Introduction to Computer Graphics (CS602) Lecture No 04 Point 4.1 Pixel The smallest dot illuminated that can be seen on screen. 4.2 Picture Composition of pixels makes picture that forms on whole screen

More information

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco CS 326 Operating Systems C Programming Greg Benson Department of Computer Science University of San Francisco Why C? Fast (good optimizing compilers) Not too high-level (Java, Python, Lisp) Not too low-level

More information

CS 237 Meeting 19 10/24/12

CS 237 Meeting 19 10/24/12 CS 237 Meeting 19 10/24/12 Announcements 1. Midterm: New date: Oct 29th. In class open book/notes. 2. Try to complete the linear feedback shift register lab in one sitting (and please put all the equipment

More information

CISC 110 Week 1. An Introduction to Computer Graphics and Scripting

CISC 110 Week 1. An Introduction to Computer Graphics and Scripting CISC 110 Week 1 An Introduction to Computer Graphics and Scripting Emese Somogyvari Office: Goodwin 235 E-mail: somogyva@cs.queensu.ca Please use proper email etiquette! Office hours: TBD Course website:

More information

Getting Started. 1 st Week, Sun-Jeong Kim. Computer Graphics Applications

Getting Started. 1 st Week, Sun-Jeong Kim. Computer Graphics Applications OpenGL Programming Getting Started 1 st Week, 2008 Sun-Jeong Kim Visual Studio 2005 Windows Programming 2 Visual C++ Win32 Application New Project 3 Empty project Application Settings 4 Solution Prac01

More information

Views, Drawing, and Events. Lecture 5

Views, Drawing, and Events. Lecture 5 Views, Drawing, and Events Lecture 5 First - Representing Points and Areas NSPoint // Represents a point in a Cartesian coordinate system. typedef struct _NSPoint { CGFloat x; CGFloat y; } NSPoint Pair

More information

Math 1525 Excel Lab 1 Introduction to Excel Spring, 2001

Math 1525 Excel Lab 1 Introduction to Excel Spring, 2001 Math 1525 Excel Lab 1 Introduction to Excel Spring, 2001 Goal: The goal of Lab 1 is to introduce you to Microsoft Excel, to show you how to graph data and functions, and to practice solving problems with

More information

SketchUp Tool Basics

SketchUp Tool Basics SketchUp Tool Basics Open SketchUp Click the Start Button Click All Programs Open SketchUp Scroll Down to the SketchUp 2013 folder Click on the folder to open. Click on SketchUp. Set Up SketchUp (look

More information

CSci 4061 Introduction to Operating Systems. Programs in C/Unix

CSci 4061 Introduction to Operating Systems. Programs in C/Unix CSci 4061 Introduction to Operating Systems Programs in C/Unix Today Basic C programming Follow on to recitation Structure of a C program A C program consists of a collection of C functions, structs, arrays,

More information

COMP322 - Introduction to C++ Lecture 02 - Basics of C++

COMP322 - Introduction to C++ Lecture 02 - Basics of C++ COMP322 - Introduction to C++ Lecture 02 - Basics of C++ School of Computer Science 16 January 2012 C++ basics - Arithmetic operators Where possible, C++ will automatically convert among the basic types.

More information

CISC 1115 (Science Section) Brooklyn College Professor Langsam. Assignment #5

CISC 1115 (Science Section) Brooklyn College Professor Langsam. Assignment #5 CISC 1115 (Science Section) Brooklyn College Professor Langsam Assignment #5 An image is made up of individual points, known as pixels. Thus if we have an image with a resolution of 100 x 100, each pixel

More information

Tutorial 1: Introduction to C Computer Architecture and Systems Programming ( )

Tutorial 1: Introduction to C Computer Architecture and Systems Programming ( ) Systems Group Department of Computer Science ETH Zürich Tutorial 1: Introduction to C Computer Architecture and Systems Programming (252-0061-00) Herbstsemester 2012 Goal Quick introduction to C Enough

More information

Model Viva Questions for Programming in C lab

Model Viva Questions for Programming in C lab Model Viva Questions for Programming in C lab Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart is a diagram that shows a continuous

More information