Exemplu pentru utilizarea metodelor grafice

Size: px
Start display at page:

Download "Exemplu pentru utilizarea metodelor grafice"

Transcription

1 Exemplu pentru utilizarea metodelor grafice In cadrul cursului, metodele grafice vor fi exemplificate folosind programul de mai jos. System::Windows::Forms::Cursor ^cursor_creion; Image ^img_bg,^img,^img_temp; Graphics ^g_bg,^g,^g_temp; int x0,y0; bool apasat; Pen^ creion; Brush^ pensula; Color culoare_transparenta; void nou(){ img_bg=gcnew Bitmap(p->Width,p->Height); g_bg=graphics::fromimage(img_bg); img=gcnew Bitmap(p->Width,p->Height); g=graphics::fromimage(img); img_temp=gcnew Bitmap(p->Width,p->Height); g_temp=graphics::fromimage(img_temp); void salveaza(){ Image^ img1=gcnew Bitmap(p->Width,p->Height); Graphics^ g1=graphics::fromimage(img1); g1->drawimage(img_bg,0,0,p->width,p->height); 1

2 g1->drawimage(img,0,0,p->width,p->height); sf->defaultext="jpeg"; sf->filename="figura.jpeg"; sf->filter = "JPEG files (*.jpeg) *.jpeg All files (*.*) *.*" ; sf->filterindex = 1 ; sf->restoredirectory = true ; sf->showdialog(); img1->save(sf- >FileName,System::Drawing::Imaging::ImageFormat::Jpeg); catch(exception^){ void creaza_creion(){ creion=gcnew Pen(culoare->BackColor,dimensiune- >SelectedIndex*2+1); creion->dashstyle=(drawing::drawing2d::dashstyle)stil- >SelectedIndex; void creaza_penson(){ pensula=gcnew SolidBrush(culoare->BackColor); void deseneaza_instrument(string^ nume_instrument,rectangle r,graphics^ g){ if(nume_instrument=="fundal") g->drawimage(imagelist1->images[0],r); if(nume_instrument=="creion") g->drawimage(imagelist1->images[1],r); if(nume_instrument=="radiera") g->drawimage(imagelist1->images[2],r); if(nume_instrument=="linie") g->drawline(gcnew Pen(Color::Blue,3),r.X+2,r.Y+r.Height-4,r.X+r.Width-4,r.Y+2); if(nume_instrument=="patrat") g->drawrectangle(gcnew Pen(Color::Blue,3),r.X+2,r.Y+2,r.Height-4,r.Height-4); if(nume_instrument=="dreptunghi") g->drawrectangle(gcnew Pen(Color::Blue,3),r.X+2,r.Y+7,r.Height-4,r.Height-14); if(nume_instrument=="cerc") g->drawellipse(gcnew Pen(Color::Blue,3),r.X+2,r.Y+2,r.Height-4,r.Height-4); if(nume_instrument=="elipsa") g->drawellipse(gcnew Pen(Color::Blue,3),r.X+2,r.Y+7,r.Height-4,r.Height-14); if(nume_instrument=="patrat plin") g- >FillRectangle(Brushes::Blue,r.X+2,r.Y+2,r.Height-4,r.Height-4); if(nume_instrument=="dreptunghi plin") g- >FillRectangle(Brushes::Blue,r.X+2,r.Y+7,r.Height-4,r.Height-14); if(nume_instrument=="cerc plin") g->fillellipse(brushes::blue,r.x+2,r.y+2,r.height- 4,r.Height-4); 2

3 4,r.Height-14); if(nume_instrument=="elipsa plina") g->fillellipse(brushes::blue,r.x+2,r.y+7,r.height- void schimba_culoare_fundal(){ g_bg->clear(culoare->backcolor); void schimba_imagine_fundal(){ of->defaultext="jpeg"; of->filename=""; of->filter = "JPEG (*.jpeg) *.jpeg Bitmap Files (*.bmp) *.bmp All files (*.*) *.*"; of->filterindex = 1 ; of->restoredirectory = true ; of->showdialog(); >Height); Image^ img1=image::fromfile(of->filename); g_bg->clear(culoare_transparenta); g_bg->drawimage(img1,0,0,img1->width,img1- catch(exception^){ void instrument_creion(int x,int y){ g->fillellipse(gcnew SolidBrush(creion->Color),x0-creion- >Width/2,y0-creion->Width/2,creion->Width,creion->Width); g->drawline(creion,x0,y0,x,y); x0=x; y0=y; void instrument_linie(int x,int y,bool temporar){ g_temp->drawline(creion,x0,y0,x,y); g->drawline(creion,x0,y0,x,y); void instrument_patrat(int x,int y,bool temporar,bool plin){ int l=math::abs(x-x0); if(math::abs(y-y0)<l)l=math::abs(y-y0); Rectangle r=rectangle(x0-l*(x>x0?0:1),y0- l*(y>y0?0:1),l,l); 3

4 g_temp->fillrectangle(pensula,r); g_temp->drawrectangle(creion,r); g->fillrectangle(pensula,r); g->drawrectangle(creion,r); void instrument_dreptunghi(int x,int y,bool temporar,bool plin){ Rectangle r=rectangle(x0<x?x0:x,y0<y?y0:y,math::abs(xx0),math::abs(y-y0)); g_temp->fillrectangle(pensula,r); g_temp->drawrectangle(creion,r); g->fillrectangle(pensula,r); g->drawrectangle(creion,r); void instrument_cerc(int x,int y,bool temporar,bool plin){ int l=math::abs(x-x0); if(math::abs(y-y0)<l)l=math::abs(y-y0); Rectangle r=rectangle(x0-l*(x>x0?0:1),y0- l*(y>y0?0:1),l,l); g_temp->fillellipse(pensula,r); g_temp->drawellipse(creion,r); g->fillellipse(pensula,r); g->drawellipse(creion,r); void instrument_elipsa(int x,int y,bool temporar,bool plin){ Rectangle r=rectangle(x0<x?x0:x,y0<y?y0:y,math::abs(xx0),math::abs(y-y0)); g_temp->fillellipse(pensula,r); g_temp->drawellipse(creion,r); 4

5 g->fillellipse(pensula,r); g->drawellipse(creion,r); void instrument_radiera(int x,int y,bool mouse_up){ Rectangle r=rectangle(x-creion->width/2,y-creion- >Width/2,creion->Width,creion->Width); if(!mouse_up)g_temp->fillrectangle(brushes::darkgray,r); g->fillrectangle(pensula,r); private: System::Void Form1_Load(System::Object^ sender, culoare_transparenta=color::fromargb(0,0,0,0); cursor_creion=gcnew System::Windows::Forms::Cursor("resurse\\cursor.cur"); apasat=false; nou(); for(int i=0;i<4;i++)stil->items->add((i).tostring()); stil->selectedindex=0; for(int i=0;i<9;i++)dimensiune->items- >Add((i).ToString()); dimensiune->selectedindex=1; instrument->items->add("fundal"); instrument->items->add("creion"); instrument->items->add("linie"); instrument->items->add("patrat"); instrument->items->add("dreptunghi"); instrument->items->add("cerc"); instrument->items->add("elipsa"); instrument->items->add("patrat plin"); instrument->items->add("dreptunghi plin"); instrument->items->add("cerc plin"); instrument->items->add("elipsa plina"); instrument->items->add("radiera"); instrument->selectedindex=0; creaza_creion(); creaza_penson(); private: System::Void picturebox2_click(system::object^ sender, System::Windows::Forms::DialogResult raspuns; 5

6 raspuns = MessageBox::Show( "Creati alt desen?", "???", MessageBoxButtons::YesNo); if ( raspuns == System::Windows::Forms::DialogResult::Yes ) { nou(); private: System::Void picturebox1_click(system::object^ sender, salveaza(); private: System::Void culoare_click(system::object^ sender, cd->showdialog(); culoare->backcolor=cd->color; creaza_creion(); creaza_penson(); private: System::Void stil_selectedindexchanged(system::object^ sender, creaza_creion(); private: System::Void dimensiune_selectedindexchanged(system::object^ sender, creaza_creion(); private: System::Void stil_drawitem(system::object^ sender, System::Windows::Forms::DrawItemEventArgs^ e) { e->drawbackground(); Pen^ creion = gcnew Pen(Color::Black,6); creion- >DashStyle=(System::Drawing::Drawing2D::DashStyle)e->Index; int x=2; int y=e->bounds.top+e->bounds.height/2+3; e->graphics->drawline(creion,x,y,x+e->bounds.width-4,y); e->drawfocusrectangle(); catch (Exception^) { private: System::Void dimensiune_drawitem(system::object^ sender, System::Windows::Forms::DrawItemEventArgs^ e) { e->drawbackground(); Rectangle r = Rectangle((e->Bounds.Width-(e- >Index*2+1))/2,e->Bounds.Top +(e->bounds.height-(e->index*2+1))/2,(e- >Index*2+1),(e->Index*2+1)); e->graphics->fillrectangle(brushes::black, r); e->drawfocusrectangle(); catch (Exception^) { private: System::Void instrument_drawitem(system::object^ sender, System::Windows::Forms::DrawItemEventArgs^ e) { 6

7 e->drawbackground(); Rectangle r1 = Rectangle( 2, e->bounds.top + 2,e- >Bounds.Height-4, e->bounds.height - 4 ); Rectangle r2 = Rectangle( e->bounds.height, e- >Bounds.Top + 2,e->Bounds.Width-e->Bounds.Height-2, e->bounds.height - 4 ); deseneaza_instrument(instrument->items[e->index]- >ToString(),r1,e->Graphics); System::Drawing::Font^ font = gcnew System::Drawing::Font( "Arial", 16, FontStyle::Bold ); StringFormat ^sf=gcnew StringFormat(); sf->linealignment=stringalignment::center; e->graphics->drawstring(instrument->items[e->index]- >ToString(), font,brushes::black, r2,sf); e->drawfocusrectangle(); catch (Exception^) { private: System::Void p_paint(system::object^ sender, System::Windows::Forms::PaintEventArgs^ e) { e->graphics->drawimage(img_bg,0,0,p->width,p->height); e->graphics->drawimage(img,0,0,p->width,p->height); e->graphics->drawimage(img_temp,0,0,p->width,p->height); private: System::Void culoarefundaltoolstripmenuitem_click(system::object^ sender, schimba_culoare_fundal(); private: System::Void imaginefundaltoolstripmenuitem_click(system::object^ sender, schimba_imagine_fundal(); private: System::Void p_mousedown(system::object^ sender, System::Windows::Forms::MouseEventArgs^ e) { apasat=true; x0=e->x; y0=e->y; switch(instrument->selectedindex){ case 1: instrument_creion(e->x,e->y); case 11: instrument_radiera(e->x,e->y,false); private: System::Void p_mousemove(system::object^ sender, System::Windows::Forms::MouseEventArgs^ e) { if(apasat){ switch(instrument->selectedindex){ case 1: instrument_creion(e->x,e->y); case 2: instrument_linie(e->x,e->y,true); 7

8 >Y,true,false); >Y,true,false); >Y,true,false); >Y,true,true); case 3: instrument_patrat(e->x,e- case 4: instrument_dreptunghi(e->x,e- case 5: instrument_cerc(e->x,e->y,true,false); case 6: instrument_elipsa(e->x,e- case 7: instrument_patrat(e->x,e->y,true,true); case 8: instrument_dreptunghi(e->x,e- case 9: instrument_cerc(e->x,e->y,true,true); case 10: instrument_elipsa(e->x,e->y,true,true); case 11: instrument_radiera(e->x,e->y,false); private: System::Void p_mouseup(system::object^ sender, System::Windows::Forms::MouseEventArgs^ e) { apasat=false; switch(instrument->selectedindex){ case 1: instrument_creion(e->x,e->y); case 2: instrument_linie(e->x,e->y,false); case 3: instrument_patrat(e->x,e->y,false,false); case 4: instrument_dreptunghi(e->x,e->y,false,false); case 5: instrument_cerc(e->x,e->y,false,false); case 6: instrument_elipsa(e->x,e->y,false,false); 8

9 case 7: instrument_patrat(e->x,e->y,false,true); case 8: instrument_dreptunghi(e->x,e->y,false,true); case 9: instrument_cerc(e->x,e->y,false,true); case 10: instrument_elipsa(e->x,e->y,false,true); case 11: instrument_radiera(e->x,e->y,true); private: System::Void p_mouseenter(system::object^ sender, if(instrument->selectedindex==1){ p->cursor=cursor_creion; private: System::Void p_mouseleave(system::object^ sender, p->cursor=system::windows::forms::cursors::default; 9

Operatii pop si push-stiva

Operatii pop si push-stiva Operatii pop si push-stiva Aplicatia realizata in Microsoft Visual Studio C++ 2010 permite simularea operatiilor de introducere si extragere a elementelor dintr-o structura de tip stiva.pentru aceasta

More information

Lucrare pentru colocviu de practică

Lucrare pentru colocviu de practică Roman Radu-Alexandru Calculatoare an II Lucrare pentru colocviu de practică Descriere: Aplicatia are ca scop functionalitatea unui decodificator si a unui codificator. Converteste un numar din zecimal

More information

using namespace System::Drawing::Drawing2D; using namespace System::Collections::Generic;

using namespace System::Drawing::Drawing2D; using namespace System::Collections::Generic; using namespace System::Drawing::Drawing2D; using namespace System::Collections::Generic; private: System::Void Form1_Load(System::Object^ System::EventArgs^ e) Text = "Grafika"; tabpage1->text = "2D";

More information

Lucrare pentru colocviul de practica informatica an II calculatoare COTFAS VLAD CALC 2

Lucrare pentru colocviul de practica informatica an II calculatoare COTFAS VLAD CALC 2 Lucrare pentru colocviul de practica informatica an II calculatoare COTFAS VLAD CALC 2 Descriere: Aplicatia este creata cu ajutorul programului Microsoft Visual Studio 2005 CLR form application, si este

More information

Given the C++ declaration statement below, which of the following represents the value of exforsys? e) None of the above. 1K

Given the C++ declaration statement below, which of the following represents the value of exforsys? e) None of the above. 1K Instruction: When specified, you may choose more than one answer; otherwise, choose ONE answer for each question. Choose the answer(s) by circling it/them on the Answer Sheet provided. Questions 1-12 are

More information

EEE-425 Programming Languages (2013) 1

EEE-425 Programming Languages (2013) 1 2 System.Drawing Namespace System.Windows.Forms Namespace Creating forms applications by hand Creating forms applications using Visual Studio designer Windows applications also look different from console

More information

Now it only remains to supply the code. Begin by creating three fonts:

Now it only remains to supply the code. Begin by creating three fonts: Owner-Draw Menus Normal menus are always drawn in the same font and the same size. But sometimes, this may not be enough for your purposes. For example, here is a screen shot from MathXpert: Notice in

More information

Painting your window

Painting your window The Paint event "Painting your window" means to make its appearance correct: it should reflect the current data associated with that window, and any text or images or controls it contains should appear

More information

Capturing the Mouse. Dragging Example

Capturing the Mouse. Dragging Example Capturing the Mouse In order to allow the user to drag something, you need to keep track of whether the mouse is "down" or "up". It is "down" from the MouseDown event to the subsequent MouseUp event. What

More information

EEE-425 Programming Languages (2013) 1

EEE-425 Programming Languages (2013) 1 2 System.Drawing Namespace System.Windows.Forms Namespace Creating forms applications by hand Creating forms applications using Visual Studio designer Windows applications also look different from console

More information

Class Test 5. Create a simple paint program that conforms to the following requirements.

Class Test 5. Create a simple paint program that conforms to the following requirements. Class Test 5 Question 1 Use visual studio 2012 ultimate to create a C# windows forms application. Create a simple paint program that conforms to the following requirements. The control box is disabled

More information

Responding to the Mouse

Responding to the Mouse Responding to the Mouse The mouse has two buttons: left and right. Each button can be depressed and can be released. Here, for reference are the definitions of three common terms for actions performed

More information

Instructor s Notes Programming Logic Printing Reports. Programming Logic. Printing Custom Reports

Instructor s Notes Programming Logic Printing Reports. Programming Logic. Printing Custom Reports Instructor s Programming Logic Printing Reports Programming Logic Quick Links & Text References Printing Custom Reports Printing Overview Page 575 Linking Printing Objects No book reference Creating a

More information

(0,0) (600, 400) CS109. PictureBox and Timer Controls

(0,0) (600, 400) CS109. PictureBox and Timer Controls CS109 PictureBox and Timer Controls Let s take a little diversion and discuss how to draw some simple graphics. Graphics are not covered in the book, so you ll have to use these notes (or the built-in

More information

Chapter 7. Lists, Loops, and Printing The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 7. Lists, Loops, and Printing The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Chapter 7 Lists, Loops, and Printing McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved. Chapter Objectives - 1 Create and use list boxes and combo boxes Differentiate among the available

More information

Last Time: Objects and Abstraction. If it walks like a circle, swims like a circle, and quacks like a circle...!

Last Time: Objects and Abstraction. If it walks like a circle, swims like a circle, and quacks like a circle...! Pointers 02-201 Last Time: Objects and Abstraction If it walks like a circle, swims like a circle, and quacks like a circle...! Bird s Eye View of Object-Oriented Programming http://null-byte.wonderhowto.com!

More information

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;

namespace Tst_Form { private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components; Exercise 9.3 In Form1.h #pragma once #include "Form2.h" Add to the beginning of Form1.h #include #include For srand() s input parameter namespace Tst_Form using namespace System; using

More information

Create your own Meme Maker in C#

Create your own Meme Maker in C# Create your own Meme Maker in C# This tutorial will show how to create a meme maker in visual studio 2010 using C#. Now we are using Visual Studio 2010 version you can use any and still get the same result.

More information

Trace Bitmap. Chapter 7. A. Page Size. Step 1. Click File Menu > New (Ctrl-N).

Trace Bitmap. Chapter 7. A. Page Size. Step 1. Click File Menu > New (Ctrl-N). Chapter 7 Trace Bitmap Riverview Rams Sarasota High Booker High A. Page Size. Step 1. Click File Menu > New (Ctrl-N). Step 2. Set page size in the Property bar: Width to 3.2 Fig. 1 Height to 2 Step 3.

More information

Introduction. Create a New Project. Create the Main Form. Assignment 1 Lights Out! in C# GUI Programming 10 points

Introduction. Create a New Project. Create the Main Form. Assignment 1 Lights Out! in C# GUI Programming 10 points Assignment 1 Lights Out! in C# GUI Programming 10 points Introduction In this lab you will create a simple C# application with a menu, some buttons, and an About dialog box. You will learn how to create

More information

PIC 10A. Lecture 17: Classes III, overloading

PIC 10A. Lecture 17: Classes III, overloading PIC 10A Lecture 17: Classes III, overloading Function overloading Having multiple constructors with same name is example of something called function overloading. You are allowed to have functions with

More information

Lecture 8 Building an MDI Application

Lecture 8 Building an MDI Application Lecture 8 Building an MDI Application Introduction The MDI (Multiple Document Interface) provides a way to display multiple (child) windows forms inside a single main(parent) windows form. In this example

More information

#pragma comment(lib, "irrklang.lib") #include <windows.h> namespace SuperMetroidCraft {

#pragma comment(lib, irrklang.lib) #include <windows.h> namespace SuperMetroidCraft { Downloaded from: justpaste.it/llnu #pragma comment(lib, "irrklang.lib") #include namespace SuperMetroidCraft using namespace System; using namespace System::ComponentModel; using namespace

More information

Lampiran B. Program pengendali

Lampiran B. Program pengendali Lampiran B Program pengendali #pragma once namespace serial using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms;

More information

Fonts, text, and colour on the web. Sourcing, resizing, and inserting web site images MGMT 230 LAB

Fonts, text, and colour on the web. Sourcing, resizing, and inserting web site images MGMT 230 LAB Fonts, text, and colour on the web Sourcing, resizing, and inserting web site images MGMT 230 LAB Fonts and font families Font families are used in web development rather than just the name of one font

More information

LECTURE 11 TEST DESIGN TECHNIQUES IV

LECTURE 11 TEST DESIGN TECHNIQUES IV Code Coverage Testing 1. Statement coverage testing 2. Branch coverage testing 3. Conditional coverage testing LECTURE 11 TEST DESIGN TECHNIQUES IV Code Complexity Testing 1. Cyclomatic Complexity s V

More information

Visual C# Program: Simple Game 3

Visual C# Program: Simple Game 3 C h a p t e r 6C Visual C# Program: Simple Game 3 In this chapter, you will learn how to use the following Visual C# Application functions to World Class standards: Opening Visual C# Editor Beginning a

More information

float[][] myfloats = new float[10][20]; All elements of a 2D array can be accessed using nested loops

float[][] myfloats = new float[10][20]; All elements of a 2D array can be accessed using nested loops Review We can declare an array of any type, even other arrays A 2D array is an array of arrays float[][] myfloats = new float[10][20]; All elements of a 2D array can be accessed using nested loops for

More information

Read every line of the exam sheet before programming!

Read every line of the exam sheet before programming! Final Exam, CS130 Fall 2006 Instructions. This exam is similar to the midterms, except that you have two hours and fifteen minutes to work. The executable file to submit is Final.exe. Don t forget to put

More information

Mobile Application Programming. Layout Techniques

Mobile Application Programming. Layout Techniques Mobile Application Programming Layout Techniques Legend View Controller Containers & Content Window Container View Content View View Property View Controller Reference Delegate Root View Header View Add

More information

Question: How can we compare two objects of a given class to see if they are the same? Is it legal to do: Rectangle r(0,0,3,3);,, Rectangle s(0,0,4,4)

Question: How can we compare two objects of a given class to see if they are the same? Is it legal to do: Rectangle r(0,0,3,3);,, Rectangle s(0,0,4,4) Classes and Objects in C++: Operator Overloading CSC 112 Fall 2009 Question: How can we compare two objects of a given class to see if they are the same? Is it legal to do: Rectangle r(0,0,3,3);,, Rectangle

More information

Visual Studio.NET enables quick, drag-and-drop construction of form-based applications

Visual Studio.NET enables quick, drag-and-drop construction of form-based applications Visual Studio.NET enables quick, drag-and-drop construction of form-based applications Event-driven, code-behind programming Visual Studio.NET WinForms Controls Part 1 Event-driven, code-behind programming

More information

Chapter 6: Inheritance

Chapter 6: Inheritance Chapter 6: Inheritance EECS 1030 moodle.yorku.ca State of an object final int WIDTH = 3; final int HEIGTH = 4; final int WEIGHT = 80; GoldenRectangle rectangle = new GoldenRectangle(WIDTH, HEIGHT, WEIGHT);

More information

In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics.

In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics. Additional Controls, Scope, Random Numbers, and Graphics CS109 In this lecture we will briefly examine a few new controls, introduce the concept of scope, random numbers, and drawing simple graphics. Combo

More information

1 #include <iostream > 3 using std::cout; 4 using std::cin; 5 using std::endl; 7 int main(){ 8 int x=21; 9 int y=22; 10 int z=5; 12 cout << (x/y%z+4);

1 #include <iostream > 3 using std::cout; 4 using std::cin; 5 using std::endl; 7 int main(){ 8 int x=21; 9 int y=22; 10 int z=5; 12 cout << (x/y%z+4); 2 3 using std::cout; 4 using std::cin; using std::endl; 6 7 int main(){ 8 int x=21; 9 int y=22; int z=; 11 12 cout

More information

TA office hours are over after this week, but Dan and Maja will still be around for the next month

TA office hours are over after this week, but Dan and Maja will still be around for the next month TA office hours are over after this week, but Dan and Maja will still be around for the next month Feel free to e-mail me to request an appointment. My schedule is flexible. We will have more office hours

More information

Drawing Geometrical Objects. Graphic courtesy of Eric Roberts

Drawing Geometrical Objects. Graphic courtesy of Eric Roberts Methods Drawing Geometrical Objects Graphic courtesy of Eric Roberts Drawing Geometrical Objects Constructors new GRect( x, y, width, height) Creates a rectangle whose upper left corner is at (x, y) of

More information

Chapter 8 Advanced GUI Features

Chapter 8 Advanced GUI Features 159 Chapter 8 Advanced GUI Features There are many other features we can easily add to a Windows C# application. We must be able to have menus and dialogs along with many other controls. One workhorse

More information

Programming with Microsoft Visual Basic.NET. Array. What have we learnt in last lesson? What is Array?

Programming with Microsoft Visual Basic.NET. Array. What have we learnt in last lesson? What is Array? What have we learnt in last lesson? Programming with Microsoft Visual Basic.NET Using Toolbar in Windows Form. Using Tab Control to separate information into different tab page Storage hierarchy information

More information

The Microsoft.NET Framework

The Microsoft.NET Framework Microsoft Visual Studio 2005/2008 and the.net Framework The Microsoft.NET Framework The Common Language Runtime Common Language Specification Programming Languages C#, Visual Basic, C++, lots of others

More information

Advanced Internet Programming CSY3020

Advanced Internet Programming CSY3020 Advanced Internet Programming CSY3020 Java Applets The three Java Applet examples produce a very rudimentary drawing applet. An Applet is compiled Java which is normally run within a browser. Java applets

More information

XNA 4.0 RPG Tutorials. Part 25. Level Editor Continued

XNA 4.0 RPG Tutorials. Part 25. Level Editor Continued XNA 4.0 RPG Tutorials Part 25 Level Editor Continued I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials

More information

Object- Oriented Analysis, Design and Programming. Instructions. Medialogy, 4 th Semester, Aalborg. Tuesday 30 August 2011,

Object- Oriented Analysis, Design and Programming. Instructions. Medialogy, 4 th Semester, Aalborg. Tuesday 30 August 2011, Object- Oriented Analysis, Design and Programming Medialogy, 4 th Semester, Aalborg Tuesday 30 August 2011, 10.00-13.00 Instructions You have 3 hours to complete this examination. Neither written material

More information

CHAPTER 3. Writing Windows C# Programs. Objects in C#

CHAPTER 3. Writing Windows C# Programs. Objects in C# 90 01 pp. 001-09 r5ah.ps 8/1/0 :5 PM Page 9 CHAPTER 3 Writing Windows C# Programs 5 9 Objects in C# The C# language has its roots in C++, Visual Basic, and Java. Both C# and VB.Net use the same libraries

More information

Graphics object Graphics Device Interface (GDI) in op sys Display adapter Monitor

Graphics object Graphics Device Interface (GDI) in op sys Display adapter Monitor EE 356 August 29, 2014 Notes on Graphics Pixel A pixel is a single dot on a screen. Since 1985 when IBM introduced the Video Graphics Array pixels have been mostly square although there may be some displays

More information

CISC 1600 Lecture 3.1 Introduction to Processing

CISC 1600 Lecture 3.1 Introduction to Processing CISC 1600 Lecture 3.1 Introduction to Processing Topics: Example sketches Drawing functions in Processing Colors in Processing General Processing syntax Processing is for sketching Designed to allow artists

More information

Skinning Manual v1.0. Skinning Example

Skinning Manual v1.0. Skinning Example Skinning Manual v1.0 Introduction Centroid Skinning, available in CNC11 v3.15 r24+ for Mill and Lathe, allows developers to create their own front-end or skin for their application. Skinning allows developers

More information

EECS 1001 and EECS 1030M, lab 01 conflict

EECS 1001 and EECS 1030M, lab 01 conflict EECS 1001 and EECS 1030M, lab 01 conflict Those students who are taking EECS 1001 and who are enrolled in lab 01 of EECS 1030M should switch to lab 02. If you need my help with switching lab sections,

More information

NAME gdtclft render images in various bitmap formats (GD, GD2, GIF, JPEG, PNG, WBMP, XBM)

NAME gdtclft render images in various bitmap formats (GD, GD2, GIF, JPEG, PNG, WBMP, XBM) NAME gdtclft render images in various bitmap formats (GD, GD2, GIF, JPEG, PNG, WBMP, XBM) DESCRIPTION TCL GD EXTENSION Thomas Boutell s Gdpackage provides a convenient way to generate bitmap images with

More information

Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010

Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010 Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010 NAME (Printed) NAME (Signed) E-mail Exam Rules Show all your work. Your grade will

More information

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued

XNA 4.0 RPG Tutorials. Part 24. Level Editor Continued XNA 4.0 RPG Tutorials Part 24 Level Editor Continued I'm writing these tutorials for the new XNA 4.0 framework. The tutorials will make more sense if they are read in order. You can find the list of tutorials

More information

Introduction to Programming Written Examination

Introduction to Programming Written Examination Introduction to Programming Written Examination 23.9.2016 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where indicated.

More information

Using Template Bookmarks for Automating Microsoft Word Reports

Using Template Bookmarks for Automating Microsoft Word Reports Using Template Bookmarks for Automating Microsoft Word Reports Darryl Bryk U.S. Army RDECOM-TARDEC Warren, MI 48397 Disclaimer: Reference herein to any specific commercial company, product, process, or

More information

Chapter 12: Using Controls

Chapter 12: Using Controls Chapter 12: Using Controls Examining the IDE s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton A Label has been dragged onto Form1

More information

Functional Logic Programming Language Curry

Functional Logic Programming Language Curry Functional Logic Programming Language Curry Xiang Yin Department of Computer Science McMaster University November 9, 2010 Outline Functional Logic Programming Language 1 Functional Logic Programming Language

More information

Topic 7: Algebraic Data Types

Topic 7: Algebraic Data Types Topic 7: Algebraic Data Types 1 Recommended Exercises and Readings From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 5.5, 5.7, 5.8, 5.10, 5.11, 5.12, 5.14 14.4, 14.5, 14.6 14.9, 14.11,

More information

Ingineria Sistemelor de Programare

Ingineria Sistemelor de Programare Ingineria Sistemelor de Programare Interfete grafice (Swing) mihai.hulea@aut.utcluj.ro 2017 Scurt istoric AWT: Abstract Windowing Toolkit import java.awt.* Swing Java FX Swing Demo Libraria Swing Swing

More information

Outline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism.

Outline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism. Outline Inheritance Class Extension Overriding Methods Inheritance and Constructors Polymorphism Abstract Classes Interfaces 1 OOP Principles Encapsulation Methods and data are combined in classes Not

More information

Visual Applications Graphics Lecture Nine. Graphics

Visual Applications Graphics Lecture Nine. Graphics Graphics You can use graphics to enhance the user interface of your applications, generate graphical charts and reports, and edit or create images. The.NET Framework includes tools that allow you to draw

More information

Instructions for Crossword Assignment CS130

Instructions for Crossword Assignment CS130 Instructions for Crossword Assignment CS130 Purposes: Implement a keyboard interface. 1. The program you will build is meant to assist a person in preparing a crossword puzzle for publication. You have

More information

FIVE YEARS OLD. P r o f e s s o r ikobbins B. Stoeckei ol is s h o w n b y the J u n e 1 pig c r o p

FIVE YEARS OLD. P r o f e s s o r ikobbins B. Stoeckei ol is s h o w n b y the J u n e 1 pig c r o p / K j Y- Y -K Y X Y K K Y Y 5 9-7 j < - 8 X Y Z Q X 9 K Y - K Y X K Y Z Y - x - - - - x - - - - 5 -j - - x K K j 9 x - - q z K K - - K & -«x x - q j? x z Q - 8 - x q - - 5 - K K Q Y - - x \ - x j Y 5 x

More information

Working with images and scenes

Working with images and scenes Working with images and scenes CS 5010 Program Design Paradigms Bootcamp Mitchell Wand, 2012-2014 This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. 1 Lesson

More information

DRAWING AND MOVING IMAGES

DRAWING AND MOVING IMAGES DRAWING AND MOVING IMAGES Moving images and shapes in a Visual Basic application simply requires the user of a Timer that changes the x- and y-positions every time the Timer ticks. In our first example,

More information

Tehnici avansate de programare

Tehnici avansate de programare Tehnici avansate de programare Curs - Cristian Frăsinaru acf@infoiasi.ro Facultatea de Informatică Universitatea Al. I. Cuza Iaşi Adnotarea elementelor Tehnici avansate de programare p.1/1 Cuprins Ce sunt

More information

COMP 249: Object Oriented Programming II. Tutorial 11: Generics

COMP 249: Object Oriented Programming II. Tutorial 11: Generics COMP 249: Object Oriented Programming II Tutorial 11: Generics What are generics and why use them? Generics enable types (Classes and interfaces) to be parameters when defining classes, interfaces and

More information

Course 3D_MDX: 3D-Graphics with Managed DirectX 9.0 Chapter 6: Mesh Viewer

Course 3D_MDX: 3D-Graphics with Managed DirectX 9.0 Chapter 6: Mesh Viewer 1 Course 3D_MDX: 3D-Graphics with Managed DirectX 9.0 Chapter 6: Mesh Viewer Project mesh_viewer1 Complete Program Exercises Copyright by V. Miszalok, last update: 30-08-2007 Project mesh_viewer1 Main

More information

Yes, this is still a listbox!

Yes, this is still a listbox! Yes, this is still a listbox! Step 1: create a new project I use the beta 2 of Visual Studio 2008 ( codename Orcas ) and Expression Blend 2.0 September preview for this tutorial. You can download the beta2

More information

Cudacountry Radial. Fig. 2. Point. Fig. 4. Mastercam 2017 Cudacountry Radial Page 19-1

Cudacountry Radial. Fig. 2. Point. Fig. 4. Mastercam 2017 Cudacountry Radial Page 19-1 Mastercam 2017 Chapter 19 Cudacountry Radial A. Create Rectangle. Step 1. If necessary start a new Mastercam file, click New QAT. (Ctrl-N) on the Quick Access Toolbar Step 2. On the Wireframe tab click

More information

2019 Graduate Scholars Symposium Poster Guidelines

2019 Graduate Scholars Symposium Poster Guidelines 2019 Graduate Scholars Symposium Poster Guidelines Create your poster using Microsoft PowerPoint, using a single slide. You must resize your slide (see page 2) according to the guidelines below. Software:

More information

Object Oriented Programming 2015/16. Final Exam June 28, 2016

Object Oriented Programming 2015/16. Final Exam June 28, 2016 Object Oriented Programming 2015/16 Final Exam June 28, 2016 Directions (read carefully): CLEARLY print your name and ID on every page. The exam contains 8 pages divided into 4 parts. Make sure you have

More information

Visual Programming (761220) First Exam First Semester of Date: I Time: 60 minutes

Visual Programming (761220) First Exam First Semester of Date: I Time: 60 minutes Philadelphia University Lecturer : Mrs. Eman Alnaji Coordinator : Miss. Reem AlQaqa Internal Examiner: Dr. Nameer Al Emam Faculty of Information Technology Department of CIS Examination Paper Visual Programming

More information

Chapter Perspective Transformations

Chapter Perspective Transformations Chapter 13.9. Perspective Transformations Java supports the well-known affine operations translation, scaling, and rotation, so named because parallel lines in the image stay parallel after a transformation,

More information

You can call the project anything you like I will be calling this one project slide show.

You can call the project anything you like I will be calling this one project slide show. C# Tutorial Load all images from a folder Slide Show In this tutorial we will see how to create a C# slide show where you load everything from a single folder and view them through a timer. This exercise

More information

Abstract and final classes [Horstmann, pp ] An abstract class is kind of a cross between a class and an interface.

Abstract and final classes [Horstmann, pp ] An abstract class is kind of a cross between a class and an interface. Abstract and final classes [Horstmann, pp. 490 491] An abstract class is kind of a cross between a class and an interface. In a class, all methods are defined. In an interface, methods are declared rather

More information

AplusBug dude = new AplusBug(); A+ Computer Science -

AplusBug dude = new AplusBug(); A+ Computer Science - AplusBug dude = new AplusBug(); AplusBug dude = new AplusBug(); dude 0x234 AplusBug 0x234 dude is a reference variable that refers to an AplusBug object. A method is a storage location for related program

More information

Table of Contents. Part I Introduction 3 Part II Installation 3. Part III How to Distribute It? 3 Part IV Office 2007 &

Table of Contents. Part I Introduction 3 Part II Installation 3. Part III How to Distribute It? 3 Part IV Office 2007 & Contents 1 Table of Contents Foreword 0 Part I Introduction 3 Part II Installation 3 1 Trial Version... 3 2 Full Version... 3 Part III How to Distribute It? 3 Part IV Office 2007 & 2010 4 1 Word... 4 Run

More information

CS 315 Data Structures Fall Figure 1

CS 315 Data Structures Fall Figure 1 CS 315 Data Structures Fall 2012 Lab # 3 Image synthesis with EasyBMP Due: Sept 18, 2012 (by 23:55 PM) EasyBMP is a simple c++ package created with the following goals: easy inclusion in C++ projects,

More information

Chapter 13. Graphics, Animation, Sound, and Drag-and-Drop. McGraw-Hill. Copyright 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.

Chapter 13. Graphics, Animation, Sound, and Drag-and-Drop. McGraw-Hill. Copyright 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. Chapter 13 Graphics, Animation, Sound, and Drag-and-Drop McGraw-Hill Copyright 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. Objectives (1 of 2) Use Graphics methods to draw shapes, lines,

More information

enum: Enumerated Type An "enum" is a type with a fixed set of elements.

enum: Enumerated Type An enum is a type with a fixed set of elements. enum: Enumerated Type An "enum" is a type with a fixed set of elements. What is "enum" "enum" (enumeration) defines a new data type that has a fixed set of values. Example: an enum named Size with 3 fixed

More information

Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un

Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un Convertor Binar -> Zecimal Rosu Alin, Calculatoare, An2 Mod de Functionare: Am creat un program, in Windows Form Application, care converteste un numar binar, in numar zecimal. Acest program are 4 numericupdown-uri

More information

F I N A L E X A M I N A T I O N

F I N A L E X A M I N A T I O N Faculty Of Computer Studies M257 Putting Java to Work F I N A L E X A M I N A T I O N Number of Exam Pages: (including this cover sheet( Spring 2011 April 4, 2011 ( 5 ) Time Allowed: ( 1.5 ) Hours Student

More information

CSC330 Object Oriented Programming. Inheritance

CSC330 Object Oriented Programming. Inheritance CSC330 Object Oriented Programming Inheritance Software Engineering with Inheritance Can customize derived classes to meet needs by: Creating new member variables Creating new methods Override base-class

More information

PLoT: Graph Plotting

PLoT: Graph Plotting PLoT: Graph Plotting Version 5.2 Neil Toronto November 8, 2011 (require plot) PLoT provides a flexible interface for producing nearly any kind of plot. It includes many common

More information

.NET Developer Manual

.NET Developer Manual .NET Developer Manual Copyright 2003-2006 by WPCubed GmbH, Munich www.pdfcontrol.com 07.02.2007 I PDFControl.NET Wrapper Table of Contents Foreword 0 Part I Introduction 1 1 License... 1 Part II wpdfcontrol.net

More information

Course 3D_MDX: 3D-Graphics with Managed DirectX 9.0Chapter C5: Comments to the "Mesh Viewer" Project

Course 3D_MDX: 3D-Graphics with Managed DirectX 9.0Chapter C5: Comments to the Mesh Viewer Project Course 3D_MDX: 3D-Graphics with Managed DirectX 9.0Chapter C5: Comments to the "Mesh Viewer" Project Copyright by V. Miszalok, last update: 05-06-2007 1 Start and Global Variables Constructor Form1() 1

More information

ComponentOne. Word for WinForms

ComponentOne. Word for WinForms ComponentOne Word for WinForms ComponentOne, a division of GrapeCity 201 South Highland Avenue, Third Floor Pittsburgh, PA 15206 USA Website: http://www.componentone.com Sales: sales@componentone.com Telephone:

More information

Version 2 Users Manual

Version 2 Users Manual Version 2 Users Manual Copyright 1999-2002 Thermopatch Corporation Syracuse, NY Overview 1 Overview 3 Printer Modes 3 Concepts 3 Selecting the Printer Mode 4 Printer Settings 4 Barcodes 5 Counter 5 Label

More information

In this exercise you will be creating the graphics for the index page of a Website for children about reptiles.

In this exercise you will be creating the graphics for the index page of a Website for children about reptiles. LESSON 2: CREATING AND MANIPULATING IMAGES OBJECTIVES By the end of this lesson, you will be able to: create and import graphics use the text tool attach text to a path create shapes create curved and

More information

typedef Labeling<unsigned char,short> LabelingBS; typedef Labeling<unsigned char,short>::regioninfo RegionInfoBS;

typedef Labeling<unsigned char,short> LabelingBS; typedef Labeling<unsigned char,short>::regioninfo RegionInfoBS; 2005 7 19 1 ( ) Labeling 2 C++ STL(Standard Template Library) g++ (GCC) 3.3.2 3 3.1 Labeling SrcT DstT SrcT: unsigned char, shoft DstT: short typedef 1. unsigned char, short typedef Labeling

More information

Lesson11-Inheritance-Abstract-Classes. The GeometricObject case

Lesson11-Inheritance-Abstract-Classes. The GeometricObject case Lesson11-Inheritance-Abstract-Classes The GeometricObject case GeometricObject class public abstract class GeometricObject private string color = "White"; private DateTime datecreated = new DateTime(2017,

More information

JAVA PROGRAMMING LAB. ABSTRACT In this Lab you will learn how to describe objects and classes and how to define classes and create objects

JAVA PROGRAMMING LAB. ABSTRACT In this Lab you will learn how to describe objects and classes and how to define classes and create objects Islamic University of Gaza Faculty of Engineering Computer Engineering Dept Computer Programming Lab (ECOM 2114) ABSTRACT In this Lab you will learn how to describe objects and classes and how to define

More information

Events. Event Handler Arguments 12/12/2017. EEE-425 Programming Languages (2016) 1

Events. Event Handler Arguments 12/12/2017. EEE-425 Programming Languages (2016) 1 Events Events Single Event Handlers Click Event Mouse Events Key Board Events Create and handle controls in runtime An event is something that happens. Your birthday is an event. An event in programming

More information

Unit 21 - Creating a Button in Macromedia Flash (simplified)

Unit 21 - Creating a Button in Macromedia Flash (simplified) Unit 21 - Creating a Button in Macromedia Flash (simplified) Items needed to complete the Navigation Bar: Unit 21 - House Style Unit 21 - Graphics Sketch Diagrams Document ------------------------------------------------------------------------------------------------

More information

THE HONG KONG POLYTECHNIC UNIVERSITY Faculty of Engineering. Computer Programming Closed-book Written Test 3 Date: 28 March 2009 Time: 2:30 3:30 pm

THE HONG KONG POLYTECHNIC UNIVERSITY Faculty of Engineering. Computer Programming Closed-book Written Test 3 Date: 28 March 2009 Time: 2:30 3:30 pm THE HONG KONG POLYTECHNIC UNIVERSITY Faculty of Engineering Computer Programming Closed-book Written Test 3 Date: 28 March 2009 Time: 2:30 3:30 pm Name: Programme Code: Student No. This test aims at assessing

More information

CST242 Windows Forms with C# Page 1

CST242 Windows Forms with C# Page 1 CST242 Windows Forms with C# Page 1 1 2 4 5 6 7 9 10 Windows Forms with C# CST242 Visual C# Windows Forms Applications A user interface that is designed for running Windows-based Desktop applications A

More information

Student Name and ID CS 32, WINTER 2015, PRACTICE MIDTERM I.

Student Name and ID CS 32, WINTER 2015, PRACTICE MIDTERM I. UCLA Computer Science Department TA: Kung-Hua Chang Student Name and ID CS 32, WINTER 2015, PRACTICE MIDTERM I. Problem # Maximal Possible Points Received 1.1 3 1.2 5 1.3 5 1.4 5 1.5 5 2 3 3.1 4 3.2 5

More information

Computer measurement and control

Computer measurement and control Computer measurement and control Instructors: András Magyarkuti, Zoltán Kovács-Krausz BME TTK, Department of Physics 2017/2018 spring semester Copyright 2008-2018 András Magyarkuti, Attila Geresdi, András

More information

CSE143 - Project 3A Turn-in Receipt

CSE143 - Project 3A Turn-in Receipt 1 of 9 11/24/2003 4:24 PM CSE143 - Project 3A Turn-in Receipt Prins, Ryan Michael (rprins@u.washington.edu) Section AD Daniel Wyatt Turn-in logged at 16:24:36 PST, Monday, Nov 24, 2003 Your program compiled

More information

Abstract Class. Lecture 21. Based on Slides of Dr. Norazah Yusof

Abstract Class. Lecture 21. Based on Slides of Dr. Norazah Yusof Abstract Class Lecture 21 Based on Slides of Dr. Norazah Yusof 1 Abstract Class Abstract class is a class with one or more abstract methods. The abstract method Method signature without implementation

More information