Lab1 – Part III CSE 581 Roger Crawfis. To Do We have the basic framework, but need to: 1.Add the ability to open and read an image. 2.Generate pseudo-random.

Slides:



Advertisements
Similar presentations
OpenGL and Windows Windows Forms Programming Roger Crawfis.
Advertisements

Presented by: Benefits Systems Support. Getting Started ê Open Powerpoint, create a blank presentation. ê Select a style for your first slide from the.
EXCEL Spreadsheet Basics
Advanced Microsoft Word Hosted by Jared Hoffman Topics Keyboard Shortcuts Customizing Toolbars and Menus Auto Format & Auto Correct Tabs Inserting Pictures.
1 ADVANCED MICROSOFT POWERPOINT Lesson 5 – Using Advanced Text Features Microsoft Office 2003: Advanced.
Introducing new web content management tools for Priority...
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
1 of 4 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
Macromedia Flash MX 2004 – Design Professional and Interactivity WORKING WITH SYMBOLS.
Work with symbols and instances Work with Libraries Create buttons Assign actions to buttons Unit Lessons.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2006 Microsoft Corporation.
Google Earth How to create a Google Earth Tour and place it in your Wiki.
2. Introduction to the Visual Studio.NET IDE 2. Introduction to the Visual Studio.NET IDE Ch2 – Deitel’s Book.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
Chapter 3 Working with Symbols and Interactivity.
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
Hello World In C++ and Microsoft Visual C++. Directions to begin a project 1. Go to All Programs 2. Open Visual Studio C++ 3. Click on New Project 4.
Microsoft Excel 2000 Adding Visual Elements and Managing Files.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Windows Forms Programming in C# Windows Forms CSE 494R (proposed course for 459 Programming in C#) Prof. Roger Crawfis.
Microsoft Visual Basic 2005 CHAPTER 5 Mobile Applications Using Decision Structures.
5-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
IE 411/511: Visual Programming for Industrial Applications
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Dreamweaver – Dreamweaver Extras Web Design Section 8-4 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Create an Image Map Web Publishing & Design. Hot Spots  hot spot: An area on an object containing a hyperlink. An entire object can be a single hot spot,
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
Lab1 – Part III CSE 581 Roger Crawfis. To Do We have the basic framework, but need to: 1.Add the ability to open and read an image. 2.Generate pseudo-random.
© 2011 Delmar, Cengage Learning Chapter 3 Working with Symbols and Interactivity.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
ECT 250: Survey of E-Commerce Technology FrontPage Publishing pages Unix.
© 2010 Delmar, Cengage Learning Chapter 3: Working with Symbols and Interactivity.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Photo Story 3 Importing Pictures. When you create a new Photo Story, the first thing that you will do is import pictures. You can import pictures from.
Creating Buttons – Lesson 51 Creating Buttons Lesson 5.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
Chapter 1 Creating a Dreamweaver Web Page and Local Site
1 NORMA Lab. 7 Generating Reports More Display Options File: NORMA_Lab6.ppt. Author: T. Halpin. Last updated: 2009 June 9.
Moodle with Style Integrating new technologies to empower learning and transform leadership.
Sports Website Creation. In this project you will design and produce your own website.
Views Revit® Architecture CHAPTER OBJECTIVES Understand and use Floor Plan and Reflected Ceiling Plan (RFC) views. Learn how to create Elevation.
C# GUI - Basics. Objectives.NET supports two types: WinForms, traditional, desktop GUI apps. WebForms – newer, for Web apps. Visual Studio.NET supports.
Layers, Image Maps, and Navigation Bars
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
OpenGL and Windows Windows Forms Programming Roger Crawfis.
Macromedia Flash Design Professional And Interactivity WORKING WITH SYMBOLS.
January 2006Colby College ITS Setting Up Course Pages.
XP Tutorial 8 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Object Linking and Embedding Tutorial 8.
Hubnet Training One Health Network South East Asia Network Overview | Public and Members-only Pages; Communicating and Publishing using Blogs and News.
Inserting Hyperlinks  Purpose : Enables viewers to click the link and move directly to a slide  Directions : Make one link on slide one to move to each.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
CSC 230 (Blum)1 Visual Basic 2005 Hello World Fall 2005 T. Blum.
Microsoft Office 2008 for Mac – Illustrated Unit D: Getting Started with Safari.
Creating New Forms Projects can appear more professional when using different windows for different types of information. Select Add Windows Form from.
CS 281 – Fall 2010 Lab 4 Parametric Query and Forms in MS Access.
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Dreamweaver – Setting up a Site and Page Layouts
Adding Assignments and Learning Units to Your TSS Course
Multi-form applications and dialogs
Chapter 2 – Introduction to the Visual Studio .NET IDE
Presentation transcript:

Lab1 – Part III CSE 581 Roger Crawfis

To Do We have the basic framework, but need to: 1.Add the ability to open and read an image. 2.Generate pseudo-random numbers. 3.Add the remaining GUI elements 4.Add the rendering algorithm to provide the impressionistic effect.

Reading Images To read an image, we will use the DevIL library ( Download the DevIL libraries from the links on the course web site.

Set-up the DevIL library Add the reference for the Tao library: –Tao.DevIl –Initialize the library // // Initialize the DevIL library // ilInit(); ilOriginFunc( IL_ORIGIN_LOWER_LEFT ); ilEnable( IL_ORIGIN_SET );

Creating a Texture Map The Ilut library has an advanced feature that will automatically scale an image, build mip-maps (whatever those are), and then create the OpenGL texture maps. Once the ShowDialog for OpenFileDialog1 returns, – Ilut.ilutGLLoadImage(_fileName);

Using the Texture We will go over texture mapping in more detail later in the class, for now, you simply need to turn it on (enable it) and set the texture coordinates for each vertex you draw. Initialization: glEnable(GL_TEXTURE_2D); Texture Coordinates – use the vertex positions: glTexCoord2d( x, y ); glVertex2d( x, y ); …

Random Numbers Go back to the rendering method, DrawLines. Type in Random( and then examine the Intellisense (tooltips) listing of the possible constructor choices. Add a close paren and a semi-colon. Now, click or or move the insert caret over to the Random string and hit the F1 key.

Getting Help in VS Studio The F1 key brings up context sensitive help (help that is cognizant or sensitive to the current insertion point or window). In this case, it should bring up the member methods of the.NET class Random. Browse thru these methods. At the bottom, click on the Random Class hyperlink. Read thru the Remarks section. Under Requirements, note the namespace that Random is included in.

Random What may not be obvious from the documentation is that the Random class does not represent a random number, but a random number generator. You will want to create an instance of Random and then call the NextDouble() method when you need a random number (or more precisely, the next number in the psuedo-random sequence of numbers). Go back to the help on Random and look at the description for NextDouble().

2D Viewport Mapping Recall, that when we implemented the Resize event, we set-up a mapping that would go from zero to one in both the x and the y direction on the screen. Thus, the lower-left corner of our panel is at coordinate (0,0) and the upper-right corner is at (1,1).

More GUI elements Add another TrackBar or NumericUpDown control for the line thickness or point size. Well, this should be the same process as when we added the number of lines GUI element right? Not quite. There is a fundamental difference between our data elements, and the GUI needs to either reflect this or take care of it.

LineWidth control What is this difference? Go back and look at how you declared each of these entities.

Handling Numeric types Number of primitives was an integer, and has a simpler representation and presentation to the user. The line thickness is a floating point value. NumericUpDown control has a properties for Number of Decimal places. This allows for a fixed point representation, which is good enough.

Floating-point TrackBar Since the TrackBar does not display a value, you should really think of it as a percentage from min to max. You can use a TrackBar for the lineWidth by providing a mapping from the trackbar’s value to your min and max values. The NumericUpDown will work as is provided you set the properties to handle your fixed-point numbers.

Color Selection Adding the color picker is very easy, provided you like the built in color dialog. Drag a ColorDialog control from the toolbox onto your form. Like the OpenFileDialog, this will create an instance, but the control will not be visible. One dialog will suffice for determining the two colors we need for the lab.

Color Selection Add two more buttons to you GUI design and set their properties. Add the click event to each of these (double-click in the Form designer) and in the callback code, Show() the colorDialog and then set the button’s BackColor to the dialog’s Color value.

Professional Touches For the dialog’s, we should do two critical things: 1.Initialize the dialog’s settings. 2.Check to see if it returned properly (the user did not hit cancel).

Dialog Initialization For the colorDialog, we should probably set the initial color to the current color. If colorButton1 is clicked, set the value of Color in the dialog to the colorButton1.BackColor. For the OpenFileDialog, you could fill in a recent history, but this seems to be handled automatically, as well as remembering the last directory.

Checking for OK vs. Cancel The dialog returns a value of type DialogResult. This needs to be checked for a value of OK, like this: if( colorDialog1->ShowDialog() == DialogResult::OK ) { //Set the BackColor and update the document. }

Build and Run The button color should change appropriately. The basic GUI is finished!!! Now, add the logic to update the document and hence the rendering.

Invalidate() If you move the number of lines trackBar, and update the document’s value for this, you may not notice any change in your rendering. Upon resize of bringing the window back and forward, it will update and change. We need to invalidate the view whenever we wish to see a change. This is done by calling: this. simpleOpenGlControl1. Invalidate()

Adding the README For the README panel, just drag a Rich Text Box over to the panel and dock it to FILL. Copy and paste your Readme.txt file into here before you submit.

A Grader Panel More on this later (or not).