SlideShare a Scribd company logo
Nico Ludwig (@ersatzteilchen)
(2) GUI – Drawing
2
TOC
● (2) GUI – Drawing
– Vector- and Raster-based Graphics
● Idea behind Vector- and Raster-based Graphics
● Crispness
● Overview of Raster-based Drawing APIs
– Platform independent Graphics and GUIs in the Web Browser
● Bare HTML Pages
● Plugins and Problems
● From rich Content to HTML 5
– Drawing with HTML 5 Canvas
● Continuous, Event driven and free Drawing
● Basic Drawing "How does Drawing work with JavaScript?"
● Interaction with Controls
● Sources:
– http://channel9.msdn.com/Niners/rbarraza
– web.archive.org, Bare_HTML_Page (www.yahoo.com, 1996)
3
Vector and Raster-based Graphics
● We already discussed vector and raster displays, which bring graphics to a screen with different hardware respectively.
● Apart from how graphics are brought to screen by hardware, there are also different ways to render graphics by software.
– (The term "rendering" is a more general term for "bringing graphics (incl. video) to the screen or to paper".)
● From a software perspective there exist vector-based and raster-based graphics.
4
Raster-based Graphics
● In this lecture we'll only discuss raster-based graphics in depth.
● Graphics that is rendered on a screen, whereby software handles pixels individually, is called raster-based.
– (Raster-based graphics are also called pixel-based graphics.)
● For example Java's "Java 2D" software provides the function setRGB() to set one pixel to a certain value/color:
● Often, only raster-based graphics are associated with the word "drawing".
● Raster-based graphics are also used for photographs.
// Java: Set the pixel at (0; 0) to white color:
image.setRGB(0, 0, Color.WHITE.getRGB());
5
Basics on Raster-based Drawing
● Let's recapitulate, what a picture on a screen is: a big two-dimensional array of pixels, in other words it is a matrix.
– Mind that we already discussed the needed memory depending on spatial dimension and color resolution: a picture is an array!
● To have graphics on the screen we could use functions, which draw pixels of a specific color at specific coordinates, e.g.:
● But there are some problems with this pixel-oriented approach:
– It is relatively hard to use these functions to draw more complicated shapes like circles (e.g. with trigonometric functions).
– Drawing individual pixels would be very inefficient and slow, at least not very interactive.
● Therefor graphics libraries provide special functions to draw graphic primitives (rectangle, ellipse, line, bezier and text):
– This approach is very much faster than pixel-oriented drawing! Often the graphics adapter provides hardware acceleration.
● I.e. the calculation of coordinates of individual pixels to draw a circle (with trigonometry) can be done on the graphics adapter without using the CPU!
● The term graphics adapter can be reduced to the term Graphics Processing Unit (GPU).
– A set of functions and objects controlling specific aspects on a computer is called Application Programming Interface (API).
● For operating systems (OS) providing a GUI, it is mandatory to have an API for graphics programming.
// Java: Draw an ellipse of width and height at (0; 0):
graphics.setColor(Color.WHITE);
graphics.drawOval(0, 0, width, height);
// Java: Set the pixel at (0; 0) to white color:
image.setRGB(0, 0, Color.WHITE.getRGB());
6
Crispness
● We should have a look at the result of drawing a circle with a raster-based API, we'll continue using Java 2D:
● Welcome the alias-effect: It looks crisp, but...
– …when we zoom the drawn image, the pixels become visible and we see how the circle is plotted by pixels mimicking an arc:
● For raster-based graphics there are two ways to get at least a bit of the crispness back:
– (1) By the application of anti-aliasing, which smoothes a raster-graphics' edges with the background with colored extra pixels.
– (2) By the application of subpixel rendering (e.g. ClearType on Windows).
Zoom ZoomZoom
Zoom ZoomZoom
Subpixel
rendering
// Java: Draw a circle with the diameter 100 at (0; 0):
graphics.setColor(Color.WHITE);
graphics.drawOval(0, 0, 100, 100);
7
Excursion – Vector-based Graphics – Part I
● There are problems with raster-based graphics in general:
– When parts of the graphics are zoomed, the crispness of details gets lost. It results in pixilated graphics, not recognizable as detail.
– When the resolution increases, graphics get smaller. When the resolution decreases, graphics get larger.
● Is that a problem? Well, when we have a premium 4K display do we like smaller graphics or crisper graphics?
● These effects emerge because the rendering of raster-based graphics is dependent on the resolution.
– The shown problems are esp. visible on arcs and circles and they are very annoying on text.
increase resolution
8
Excursion – Vector-based Graphics – Part II
● To solve these problems, there needs to be a way to make the rendering of graphics independent from the resolution.
– The logical resolution was made independent from the physical resolution.
● E.g. this idea was put into effect with Microsoft's Windows Presentation Foundation (WPF):
– WPF introduced Device Independent Units (DIUs). DIUs are independent of a device's pixel raster, a DIU is defined as 1/96 of an inch.
● On a device having 96ppi (pixels per inch), 96 pixels would consume 1 inch; on a device having 120ppi, 96DIUs would be represented by 120 pixels...
● (If logical DIUs do not exactly match to physical pixels WPF will use anti-aliasing.)
● Vector-based graphics are described as formula, which is parameterized by the physical resolution.
– It means that vector-based graphics are not described as an array of pixels!
– Raster-based graphics get smaller with higher resolution and zooming leads to pixelation:
– Vector-based graphics get crisper with higher resolution and zooming, em, just zooms! Vector-based graphics are scalable!
raster-based
zoom
raster-based
zoom
raster-based
zoom
vector-based
zoom
vector-based
zoom
vector-based
zoom
9
Excursion – Vector-based Graphics – Part III
● The application of vector-based graphics allowed the development some very important applications:
– crisp and scalable texts to allow WYSIWYG editing of documents,
– a new category of software for Computer Aided Design (CAD) to construct structures on a computer instead of pencil and paper,
– a new category of software for Desktop Publishing (DTP) to layout high quality documents for printout.
– => Graphics and print results of excellent quality on any scale.
– (Vector-based graphics are not suited for photographs.)
● Besides these applications, which more or less deal with design, also the desktop was influenced meanwhile:
– The scalability and crispness of vector-based graphics was applied to controls, windows and the desktop.
– This was required, because of:
● (1) the availability of higher and higher physical resolutions (high definition, 4K, 8K) and
● (2) the availability of different screen sizes for the same applications (watch, mp3-player, automotive, mobile, tablet, notebook, PC screen, tv, projector).
– Examples:
● Desktop: WPF, (Graphics Device Interface+ (GDI+)), Quartz, PostScript, Cairo
● Browser: Silverlight (WPF/E), Scalable Vector Graphics (SVG)
● Printer: PostScript
10
Overview of raster-based Drawing APIs
● In this presentation we'll only discuss raster-based drawing in more depth.
● Up to now we used the Java 2D API for the examples, but there exist more APIs:
● Windows
– Graphics Device Interface (GDI)
● Linux
– GTK+ drawing (GTK for GIMP Toolkit; GIMP for GNU Image Manipulation Program; GNU for GNU is not Unix)
● OS X
– Quartz, Cocoa drawing
11
Native and platform independent Drawing APIs
● The drawing APIs we've enumerated are so called native APIs. What does that mean?
– Native APIs are only usable on/compatible with a certain platform. E.g. Windows GDI code won't run on OS X.
– I.e. code written in native APIs is not portable! → Native API vs. platform independent API.
– On the other hand native APIs are fast, because they can exploit the power of the platform, e.g. directly use Windows functions.
● From a 20K miles perspective there are two ways to have platform independent (drawing) APIs:
– Create and establish a common platform.
● Establish and use a common graphics API, which is translated into native graphics API calls at run time.
● E.g. Java 2D, QT
– Use a present common platform.
● Find a platform, which is existent on most OS' and implement graphics on that platform.
● E.g. web browsers
Operation System
Graphics Adapter
Native graphics API
Platform independent graphics API
Application
Operation System
Graphics Adapter
Native graphics API
Browser, interprets HTML
Website
12
Platform independent Graphics in the Web Browser
● The following discussion deals with platform independent graphics via the web browser (browser).
● Browsers are an interesting platform, because they are available on all important operating systems!
● The first approach to put "graphical content" into effect on the browser was bare HTML with forms and controls.
– ~mid 1990s
13
Bare HTML Pages
● Bare HTML pages do of course work very good in a browser, but using them didn't feel like using an application.
– HTML pages basically look like a pages of text containing some links, form elements (controls) and images.
– Using HTML pages is more or less navigation in the browser with links and the browser history.
– HTML pages seem to have no togetherness: somehow the contents of the same web address seem to belong together somehow.
● In other words: togetherness is primarily defined by how the session with the HTML "site" is defined.
● Yes, it works, but the result is not very appealing. It is just "navigation in the browser".
– When this approach was used, network throughput was low and the performance of clients was not very good.
– On the client the browser just needed to store and render pages. The web server had to handle many requests.
–
HTML
page 1
the "application"
HTML
page 2
HTML
page 3
HTML page 4
Form
Control 1
Control 2
Image
Link
One page in the browser
browser history
link
link
link
web
server
Client
Server
delivers HTML pages
14
Rich content with Plugins
● The next incarnation of "graphical content" in the browser was the usage of additional browser plugins.
– E.g. Java Applets, Adobe Flash, Apple QuickTime etc.
● The idea is to use a special control, which has very rich interactive features:
– The functionality of these controls is provided by plugins, which are installed on the browser's OS.
● Typically the "object"- or "embed"-HTML-element is used.
– With plugins the browser is able to execute mini-applications, often called applets, in instances of plugin controls.
● The browser does indeed start an embedded runtime (e.g. the Java runtime) to execute applets.
– The web server delivers binary components (and HTML pages) that contain the code to be run in the plugin controls.
– (Adobe Flash and Apple QuickTime were the most important plugins in order to play video material in the browser at all!)
HTML page
Plugin
component
One page in the browser
15
Rich content with Plugins
● Browser plugin technologies allowed "web-applications" consisting of only one site without the need for navigation.
– It should be clarified that each type of plugin provides its own event system, apart from the browser's event system.
– Because events are an intrinsic part of genuine GUIs, we can say that a web-application provides a genuine GUI.
– Pages could be designed as a mosaic of plugin controls, such web-applications are called Single Page web-Applications (SPAs).
● A new aspect of SPAs is that no navigation/reloading of sites is needed. Only parts of the sites are reloaded.
● After SPAs with plugins established, another kind of SPAs emerged: those using AJAX.
– AJAX (Asynchronous JavaScript And XML) uses JavaScript to load content dynamically without plugin components.
● The important point: AJAX allows to load parts of a currently displayed page w/o reloading the whole page!
– The mix of those technologies is sometimes called "Web 2.0" to have a nice marketing term.
– A web-application using Web 2.0 is sometimes called Rich Internet Application (RIA).
● It can be said that the last incarnation of RIAs were sites that consisted of one huge control making up the whole content.
– E.g. JavaFX and Silverlight.
● Yes, this approach also worked and the results were appealing, but there are problems with the application of plugins!
16
Problems with Browser Plugins
● The problem lies in the place where plugins are executed: in the browser and on the client side.
– Different browsers on different clients may behave differently. This also influences the effort for quality assurance!
– The required runtimes (and correct versions thereof) need to be installed on the client side.
– Because plugin components are loaded from a foreign source and executed on the client side, there is a certain security problem.
● To shield the client from vicious plugin code, plugin runtimes are executed in a so called sandbox having strong security constraints.
● The problem is that there could be a leak in the sandbox, which still allows vicious plugin code to be executed!
● => As a result the execution of plugins is often blocked, and many users don't trust these technologies (esp. Java applets).
– Running plugin code requires a lot of resources: computing time as well as battery lifetime!
17
The Solution: HTML 5
● However, in the end there are still many problems with GUIs in the browser:
– With bare HTML the interaction is not appealing, e.g. navigation among HTML pages.
– Plugins need a lot of resources: computing time and battery lifetime.
– Plugin runtimes are not necessarily installed and activated on the client-side.
– Plugins provide potential security problems.
● It took years until industry addressed these problems. In the end the answer was "HTML 5", providing important updates:
– (HTML 5 is not strictly the successor of HTML 4, instead it is a set of new features running in the browser.)
– New clever input controls: date pickers, email and web address controls, sliders and spinboxes etc.
– Support for offline web-applications, HTML 5 storage and support for data mapping and annotation with microdata.
– Support for mobile web-applications: geo location APIs.
– Support for playing video material without third party components like Apple QuickTime or Adobe Flash.
– Support for appealing/more desktop-like usage, e.g. with web workers for doing things in the background.
– But, potentially the most powerful new feature is the "canvas"-HTML-element, which we will discuss for the rest of this lecture.
● "canvas" is basically a way to bring interactive graphics into the browser with JavaScript without any plugins.
– Therefor we can now continue our discussion about of how software implements drawing in general...
18
Excursion: Continuous, Event driven and free Drawing – Part I
● Basically there exist three models for drawing on the computer screen:
– Continuous drawing.
– Event driven drawing.
– Free drawing.
● Continuous drawing:
– The code, which performs the drawing, is executed automatically and continuously at a certain framerate.
● Benefit: the programming of animation and other "vivid" graphics is very simple. It's good for learning graphics basics and simple to use for "sketching".
● Downside: it needs a lot of resources.
– Example: Processing
● Event driven drawing:
– The code, which performs the drawing is only executed, when specific events are raised (e.g. update, redraw, refresh, resize).
● Benefit: it doesn't need many resources.
● Downside: W/o interaction there is generally no drawing. (To have continuous drawing with an event driven drawing API, we have to fire draw events at a
certain framerate or call the drawing code continuously ourselves.)
– Examples: Cocoa drawing (OS X), GTK, Java 2D, Windows Forms
19
Excursion: Continuous, Event driven and free Drawing – Part II
● However, we want to discuss the third approach: free drawing.
● The idea of free drawing is that there is neither a dedicated event that initiates drawing nor any redrawing framerate.
● Free drawing means that any code, which can access the context of the graphics is able to draw!
– The code can draw independently on events as well as independently on a continuous framerate.
– It should be said that this is also possible with, e.g., Windows Forms, but the result might be overdrawn by the draw-event!
● E.g. with HTML 5 canvas each function is able to draw, because the graphical context can be accessed from everywhere.
– Benefits: it is simple to use from scratch.
– Downsides: it can be tricky to migrate code from other drawing approaches.
● Ok, now its time to see free drawing with HTML 5 canvas!
20
Let's go and draw!
● We'll begin with a general HTML scaffold to program canvas with these important parts:
– (1) Import the file containing the needed JavaScript code (Canvas.js).
– (2) Bind the HTML page's load event to the JavaScript function draw() (defined in Canvas.js).
– (3) Mark the canvas element in the page's body with the id "myCanvas".
● In the JavaScript file "Canvas.js" we implement the function draw():
– (a) Get the HTML page's canvas element by its id "myCanvas".
– (b) Get the graphical context from the canvas element by calling getContext("2d").
– (c) On the canvas' graphics context draw on the canvas programmatically with special functions (e.g. arc() and fill()).
● As can be seen, the event onload and the canvas object connect the HTML page with the JavaScript code.
<html>
<head>
<script src="Canvas.js"></script> <!--(1)-->
<title>Canvas</title>
</head>
<body onload="draw();"> <!--(2)-->
<canvas id="myCanvas" width="300" height="300"></canvas><!--(3)-->
</body>
</html>
function draw() {
var canvas = document.getElementById("myCanvas"); // (a)
var context = canvas.getContext("2d"); // (b)
// (c):
context.arc(canvas.width/2, canvas.height/2, 75, 0, 2 * Math.PI, false);
context.fill();
}
21
Excursion: Notification or Polling
● When the page's load event is fired, the function draw() will be called.
– This event is fired when the page is loaded into the browser. The state of the page then changes from unloaded to loaded.
● There exist two "extreme" ways to deal with state changes.
● Communication via events:
– We attach our code to the event, to which we want to react (get notified).
● The code, which is called when the event fired, is called eventhandler or eventlistener.
– => We passively assume that the event will be fired somewhen in future. When the event is fired, we're getting notified.
– (This is what we call the "hollywood principle": Don't call us, we'll call you! It's also called "callback principle".)
● Communication via polling:
– We query a system function continuousely, until a certain state has changed.
– => We actively poll for a state to be changed (here with "slow busy waiting").
● JavaScript uses events for communication.
– Most GUI frameworks use events as well.
// Attaching an eventlistener:
// The eventlistener draw():
function draw() { /* pass */ }
// Attach the eventlistener draw() to the load event:
document.addEventListener("load", draw);
// Polling (this is no legal JavaScript code):
// The draw() function:
function draw() { /* pass */ }
// Wait until the page is loaded:
while (!document.isLoaded) {
wait(1000); // "slow busy waiting"
}
// When the document is loaded call draw():
draw();
22
Drawing on a Canvas Element
● Canvas allows to draw two kinds of primitives: solid primitives and paths (no official JavaScript API terms).
● Solid primitives are filled with a color, gradient or pattern.
– Relevant functions and properties: fillRect(), fillStyle, fill() (to fill a drafted path (see below))
● Paths are drafted with functions, which define the skeleton of a figure. Later on, these paths are stroked to be visible.
– Drafting paths is like "preliminary" drawing a figure with a very fine and hard pencil.
– Stroking is like drawing the real figure with ink.
– Relevant functions and properties: beginPath(), closePath(), moveTo(), lineTo(), rect(), arc(), strokeStyle, stroke() or fill()
– Sometimes
● (1) a path needs to be started by calling beginPath() and sometimes
● (2) after the drafting is done a path needs to be closed (connecting the first with the last "pencil stop" with a line) by calling closePath().
function drawPathAndStrokeCircle() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
context.arc(/* pass */);
context.stroke();
}
function drawSolidCircle() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
context.arc(/* pass */);
context.fill();
}
23
Controls
● So far we have a rough understanding of how we can draw visible contents on an HTML page.
– But it would be very time consuming to draw every piece of interaction in such a way!
– Therefor we have predefined pieces of interaction: controls.
● Controls are pieces on a GUI, arranged on a window, with which the user can interact.
– Users use mouse, keyboard and touch gestures to interact with the controls on the GUI.
24
Combine/implement Interaction with Controls and Canvas
● In this example we bind another eventlistener to the onclick event of a button.
– The onclick event is fired, when the button is clicked.
– The eventlistener drawInnerCircle() draws a smaller inner circle into the initial circle.
– The eventlistener drawInnerCircle() sets the text of the textbox to "Button clicked!".
● Via events and JavaScript code we can have real interactivity.
– Events are typically a result of user interaction, e.g. clicking a button.
● Events are fired, when the state of HTML controls changes (page loaded, button clicked etc.).
– JavaScript code is provided by developers.
●
JavaScript code is able to access (getElementById()) and change the state of controls (e.g. setting a value).
function drawInnerCircle() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
var textBox;
context.beginPath(); // Initiate a new path to decouple from 1st arc!
context.arc(canvas.width/2, canvas.height/2, 20, 0, 2 * Math.PI, false);
context.fillStyle = "white";
context.fill();
textBox = document.getElementById("myText");
textBox.value = "Button clicked!";
}
<html>
<head>
<script src="Canvas.js"></script>
<title>Canvas</title>
</head>
<body onload="draw();">
<canvas id="myCanvas" width="300" height="300"></canvas>
<button onclick="drawInnerCircle();">Click me!</button>
<input id="myText" type="text"></input>
</body>
</html>
25
Events with Parameters
● We can also attach events to a canvas element, e.g. to canvas' onmousedown event:
– The onmousedown event is fired, when the canvas is clicked.
– As can be seen, the onmousedown event is somewhat special: it accepts an argument!
● Here we pass the global event object, just called "event".
– The event's argument is available via the parameter e in the eventlistener canvasClicked().
– The parameter allows to read the coordinates (i.e. properties x and y) of the mouse position, on which the mouse was clicked.
● A common strategy is to pass the global event object as an argument to the eventlistener.
– The passed object contains extra information about the state of the page, controls, keyboard and mouse.
– Then the eventlistener's parameter provides a lot of properties and functions, which allow almost full control of the GUI.
function canvasClicked(e) {
var textBox = document.getElementById("myText");
textBox.value = "x = "+e.x+"; y = "+e.y;
}
<html>
<head>
<script src="Canvas.js"></script>
<title>Canvas</title>
</head>
<body onload="draw();">
<canvas id="myCanvas"
onmousedown="canvasClicked(event);"
width="300" height="300"></canvas>
<input id="myText" type="text"></input>
</body>
</html>
26
Web Apps with HTML and JavaScript in Reality
● There are some important downsides of this approach:
– A browser needs to be able to render "HTML 5" in order to fully unleash the power of, e.g., canvas.
– The execution of JavaScript needs to be enabled in the browser!
– The HTML- as well as the JavaScript-code are loaded to the client side and can be read.
● I.e. the code could be copied/reused without permission. Also leaks could be easily detected and exploited.
● (However there is a way to reduce the readability of code: with "code minimizers" (i.e. the opposite of code beautifiers).)
● General acceptance of web-applications:
– Most of them do not work offline.
– The acceptance of users is not always given, esp. the look and feel (l&f) is not like that of a desktop application.
– Web-applications can be a cheap but effective solution for business applications.
27
Thank you!

More Related Content

What's hot

Computer graphics.
Computer graphics.Computer graphics.
Computer graphics.
ALIHAMID71
 
Overview of graphics systems
Overview of  graphics systemsOverview of  graphics systems
Overview of graphics systems
Jay Nagar
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
Sakthivel Murugan
 
Advanced animation techniques
Advanced animation techniquesAdvanced animation techniques
Advanced animation techniquesCharles Flynt
 
支援DSL的嵌入式圖形操作環境
支援DSL的嵌入式圖形操作環境支援DSL的嵌入式圖形操作環境
支援DSL的嵌入式圖形操作環境
John Chou
 
CS101- Introduction to Computing- Lecture 33
CS101- Introduction to Computing- Lecture 33CS101- Introduction to Computing- Lecture 33
CS101- Introduction to Computing- Lecture 33
Bilal Ahmed
 
3 d computer graphics software
3 d computer graphics software3 d computer graphics software
3 d computer graphics software
Afnan Asem
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
Kamal Acharya
 

What's hot (8)

Computer graphics.
Computer graphics.Computer graphics.
Computer graphics.
 
Overview of graphics systems
Overview of  graphics systemsOverview of  graphics systems
Overview of graphics systems
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
Advanced animation techniques
Advanced animation techniquesAdvanced animation techniques
Advanced animation techniques
 
支援DSL的嵌入式圖形操作環境
支援DSL的嵌入式圖形操作環境支援DSL的嵌入式圖形操作環境
支援DSL的嵌入式圖形操作環境
 
CS101- Introduction to Computing- Lecture 33
CS101- Introduction to Computing- Lecture 33CS101- Introduction to Computing- Lecture 33
CS101- Introduction to Computing- Lecture 33
 
3 d computer graphics software
3 d computer graphics software3 d computer graphics software
3 d computer graphics software
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 

Viewers also liked

Still image analysis
Still image analysisStill image analysis
Still image analysis
naomi_pierce
 
Color Palettes
Color PalettesColor Palettes
Color Palettes
Nancy Jin
 
Still image analysis
Still image analysisStill image analysis
Still image analysisjphibbert
 
10 still image analysis
10 still image analysis10 still image analysis
10 still image analysisTommy Noad
 
3D transformation and viewing
3D transformation and viewing3D transformation and viewing
3D transformation and viewing
abhishek1235010004
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsKetan Jani
 
Commonly Used Image File Formats
Commonly Used Image File FormatsCommonly Used Image File Formats
Commonly Used Image File Formats
Fatih Özlü
 
3D transformation
3D transformation3D transformation
3D transformation
Aditya Rawat
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing Algorithm
Mahesh Kodituwakku
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
Aishwarya K. M.
 
Compression: Images (JPEG)
Compression: Images (JPEG)Compression: Images (JPEG)
Compression: Images (JPEG)
danishrafiq
 
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Saikrishna Tanguturu
 
Introduction to Computer graphics
Introduction to Computer graphics Introduction to Computer graphics
Introduction to Computer graphics PrathimaBaliga
 
applications of computer graphics
applications of computer graphicsapplications of computer graphics
applications of computer graphicsAaina Katyal
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
Sahil Biswas
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
Somya Bagai
 

Viewers also liked (17)

Still image analysis
Still image analysisStill image analysis
Still image analysis
 
Color Palettes
Color PalettesColor Palettes
Color Palettes
 
Still image analysis
Still image analysisStill image analysis
Still image analysis
 
10 still image analysis
10 still image analysis10 still image analysis
10 still image analysis
 
3D transformation and viewing
3D transformation and viewing3D transformation and viewing
3D transformation and viewing
 
Graphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygonsGraphics6 bresenham circlesandpolygons
Graphics6 bresenham circlesandpolygons
 
Cg Chap 02
Cg Chap 02Cg Chap 02
Cg Chap 02
 
Commonly Used Image File Formats
Commonly Used Image File FormatsCommonly Used Image File Formats
Commonly Used Image File Formats
 
3D transformation
3D transformation3D transformation
3D transformation
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing Algorithm
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Compression: Images (JPEG)
Compression: Images (JPEG)Compression: Images (JPEG)
Compression: Images (JPEG)
 
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
 
Introduction to Computer graphics
Introduction to Computer graphics Introduction to Computer graphics
Introduction to Computer graphics
 
applications of computer graphics
applications of computer graphicsapplications of computer graphics
applications of computer graphics
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Random scan displays and raster scan displays
Random scan displays and raster scan displaysRandom scan displays and raster scan displays
Random scan displays and raster scan displays
 

Similar to (2) gui drawing

Computer graphics Applications and System Overview
Computer graphics Applications and System OverviewComputer graphics Applications and System Overview
Computer graphics Applications and System Overview
RAJARATNAS
 
Html5 (games)
Html5 (games)Html5 (games)
Html5 (games)
chamsddine bouzaine
 
COMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LIST
COMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LISTCOMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LIST
COMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LIST
tarun kumar sharma
 
Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2
Iftikhar Ahmad
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
SamiraKids
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
Mohammad Hosein Nemati
 
EFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the DesktopEFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the Desktop
Samsung Open Source Group
 
Graphics in mobile terminals
Graphics in mobile terminalsGraphics in mobile terminals
Graphics in mobile terminals
Tomi Aarnio
 
Mod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdfMod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdf
DavidsonJebaseelan1
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Mark Kilgard
 
GPU Renderfarm with Integrated Asset Management & Production System (AMPS)
GPU Renderfarm with Integrated Asset Management & Production System (AMPS)GPU Renderfarm with Integrated Asset Management & Production System (AMPS)
GPU Renderfarm with Integrated Asset Management & Production System (AMPS)
Budianto Tandianus
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics Notes
Gurpreet singh
 
Korea linuxforum2014 html5game-sangseoklim
Korea linuxforum2014 html5game-sangseoklimKorea linuxforum2014 html5game-sangseoklim
Korea linuxforum2014 html5game-sangseoklim
Sang Seok Lim
 
Kompüter Qrafikasına giriş
Kompüter Qrafikasına girişKompüter Qrafikasına giriş
Kompüter Qrafikasına giriş
Hackathon Azerbaijan
 
High DPI for desktop applications
High DPI for desktop applicationsHigh DPI for desktop applications
High DPI for desktop applications
Kirill Grouchnikov
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
LOKESH KUMAR
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalMasatsugu HASHIMOTO
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
Paul Bakaus
 
Stream processors texture generation model for 3d virtual worlds learning too...
Stream processors texture generation model for 3d virtual worlds learning too...Stream processors texture generation model for 3d virtual worlds learning too...
Stream processors texture generation model for 3d virtual worlds learning too...
Mikhail Fominykh
 

Similar to (2) gui drawing (20)

Computer graphics Applications and System Overview
Computer graphics Applications and System OverviewComputer graphics Applications and System Overview
Computer graphics Applications and System Overview
 
Html5 (games)
Html5 (games)Html5 (games)
Html5 (games)
 
COMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LIST
COMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LISTCOMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LIST
COMPUTER GRAPHICS AND MULTI MEDIA SOFTWARE LIST
 
Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2Monitors & workstation,Donald ch-2
Monitors & workstation,Donald ch-2
 
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdfJIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
JIT Spraying Never Dies - Bypass CFG By Leveraging WARP Shader JIT Spraying.pdf
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
 
EFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the DesktopEFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the Desktop
 
Graphics in mobile terminals
Graphics in mobile terminalsGraphics in mobile terminals
Graphics in mobile terminals
 
Mod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdfMod 2 hardware_graphics.pdf
Mod 2 hardware_graphics.pdf
 
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware PipelineAccelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
Accelerating Vector Graphics Rendering using the Graphics Hardware Pipeline
 
GPU Renderfarm with Integrated Asset Management & Production System (AMPS)
GPU Renderfarm with Integrated Asset Management & Production System (AMPS)GPU Renderfarm with Integrated Asset Management & Production System (AMPS)
GPU Renderfarm with Integrated Asset Management & Production System (AMPS)
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics Notes
 
Korea linuxforum2014 html5game-sangseoklim
Korea linuxforum2014 html5game-sangseoklimKorea linuxforum2014 html5game-sangseoklim
Korea linuxforum2014 html5game-sangseoklim
 
Kompüter Qrafikasına giriş
Kompüter Qrafikasına girişKompüter Qrafikasına giriş
Kompüter Qrafikasına giriş
 
High DPI for desktop applications
High DPI for desktop applicationsHigh DPI for desktop applications
High DPI for desktop applications
 
Introduction to Computer graphics
Introduction to Computer graphicsIntroduction to Computer graphics
Introduction to Computer graphics
 
VisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_FinalVisionizeBeforeVisulaize_IEVC_Final
VisionizeBeforeVisulaize_IEVC_Final
 
Building a game engine with jQuery
Building a game engine with jQueryBuilding a game engine with jQuery
Building a game engine with jQuery
 
Stream processors texture generation model for 3d virtual worlds learning too...
Stream processors texture generation model for 3d virtual worlds learning too...Stream processors texture generation model for 3d virtual worlds learning too...
Stream processors texture generation model for 3d virtual worlds learning too...
 
Cg
CgCg
Cg
 

More from Nico Ludwig

Grundkurs fuer excel_part_v
Grundkurs fuer excel_part_vGrundkurs fuer excel_part_v
Grundkurs fuer excel_part_v
Nico Ludwig
 
Grundkurs fuer excel_part_iv
Grundkurs fuer excel_part_ivGrundkurs fuer excel_part_iv
Grundkurs fuer excel_part_iv
Nico Ludwig
 
Grundkurs fuer excel_part_iii
Grundkurs fuer excel_part_iiiGrundkurs fuer excel_part_iii
Grundkurs fuer excel_part_iii
Nico Ludwig
 
Grundkurs fuer excel_part_ii
Grundkurs fuer excel_part_iiGrundkurs fuer excel_part_ii
Grundkurs fuer excel_part_ii
Nico Ludwig
 
Grundkurs fuer excel_part_i
Grundkurs fuer excel_part_iGrundkurs fuer excel_part_i
Grundkurs fuer excel_part_i
Nico Ludwig
 
(1) gui history_of_interactivity
(1) gui history_of_interactivity(1) gui history_of_interactivity
(1) gui history_of_interactivity
Nico Ludwig
 
(1) gui history_of_interactivity
(1) gui history_of_interactivity(1) gui history_of_interactivity
(1) gui history_of_interactivity
Nico Ludwig
 
New c sharp4_features_part_vi
New c sharp4_features_part_viNew c sharp4_features_part_vi
New c sharp4_features_part_vi
Nico Ludwig
 
New c sharp4_features_part_v
New c sharp4_features_part_vNew c sharp4_features_part_v
New c sharp4_features_part_v
Nico Ludwig
 
New c sharp4_features_part_iv
New c sharp4_features_part_ivNew c sharp4_features_part_iv
New c sharp4_features_part_iv
Nico Ludwig
 
New c sharp4_features_part_iii
New c sharp4_features_part_iiiNew c sharp4_features_part_iii
New c sharp4_features_part_iii
Nico Ludwig
 
New c sharp4_features_part_ii
New c sharp4_features_part_iiNew c sharp4_features_part_ii
New c sharp4_features_part_ii
Nico Ludwig
 
New c sharp4_features_part_i
New c sharp4_features_part_iNew c sharp4_features_part_i
New c sharp4_features_part_i
Nico Ludwig
 
New c sharp3_features_(linq)_part_v
New c sharp3_features_(linq)_part_vNew c sharp3_features_(linq)_part_v
New c sharp3_features_(linq)_part_v
Nico Ludwig
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_iv
Nico Ludwig
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNico Ludwig
 
New c sharp3_features_(linq)_part_iii
New c sharp3_features_(linq)_part_iiiNew c sharp3_features_(linq)_part_iii
New c sharp3_features_(linq)_part_iii
Nico Ludwig
 
New c sharp3_features_(linq)_part_ii
New c sharp3_features_(linq)_part_iiNew c sharp3_features_(linq)_part_ii
New c sharp3_features_(linq)_part_ii
Nico Ludwig
 
New c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_iNew c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_i
Nico Ludwig
 
New c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_iNew c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_i
Nico Ludwig
 

More from Nico Ludwig (20)

Grundkurs fuer excel_part_v
Grundkurs fuer excel_part_vGrundkurs fuer excel_part_v
Grundkurs fuer excel_part_v
 
Grundkurs fuer excel_part_iv
Grundkurs fuer excel_part_ivGrundkurs fuer excel_part_iv
Grundkurs fuer excel_part_iv
 
Grundkurs fuer excel_part_iii
Grundkurs fuer excel_part_iiiGrundkurs fuer excel_part_iii
Grundkurs fuer excel_part_iii
 
Grundkurs fuer excel_part_ii
Grundkurs fuer excel_part_iiGrundkurs fuer excel_part_ii
Grundkurs fuer excel_part_ii
 
Grundkurs fuer excel_part_i
Grundkurs fuer excel_part_iGrundkurs fuer excel_part_i
Grundkurs fuer excel_part_i
 
(1) gui history_of_interactivity
(1) gui history_of_interactivity(1) gui history_of_interactivity
(1) gui history_of_interactivity
 
(1) gui history_of_interactivity
(1) gui history_of_interactivity(1) gui history_of_interactivity
(1) gui history_of_interactivity
 
New c sharp4_features_part_vi
New c sharp4_features_part_viNew c sharp4_features_part_vi
New c sharp4_features_part_vi
 
New c sharp4_features_part_v
New c sharp4_features_part_vNew c sharp4_features_part_v
New c sharp4_features_part_v
 
New c sharp4_features_part_iv
New c sharp4_features_part_ivNew c sharp4_features_part_iv
New c sharp4_features_part_iv
 
New c sharp4_features_part_iii
New c sharp4_features_part_iiiNew c sharp4_features_part_iii
New c sharp4_features_part_iii
 
New c sharp4_features_part_ii
New c sharp4_features_part_iiNew c sharp4_features_part_ii
New c sharp4_features_part_ii
 
New c sharp4_features_part_i
New c sharp4_features_part_iNew c sharp4_features_part_i
New c sharp4_features_part_i
 
New c sharp3_features_(linq)_part_v
New c sharp3_features_(linq)_part_vNew c sharp3_features_(linq)_part_v
New c sharp3_features_(linq)_part_v
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_iv
 
New c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_ivNew c sharp3_features_(linq)_part_iv
New c sharp3_features_(linq)_part_iv
 
New c sharp3_features_(linq)_part_iii
New c sharp3_features_(linq)_part_iiiNew c sharp3_features_(linq)_part_iii
New c sharp3_features_(linq)_part_iii
 
New c sharp3_features_(linq)_part_ii
New c sharp3_features_(linq)_part_iiNew c sharp3_features_(linq)_part_ii
New c sharp3_features_(linq)_part_ii
 
New c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_iNew c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_i
 
New c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_iNew c sharp3_features_(linq)_part_i
New c sharp3_features_(linq)_part_i
 

Recently uploaded

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 

Recently uploaded (20)

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 

(2) gui drawing

  • 2. 2 TOC ● (2) GUI – Drawing – Vector- and Raster-based Graphics ● Idea behind Vector- and Raster-based Graphics ● Crispness ● Overview of Raster-based Drawing APIs – Platform independent Graphics and GUIs in the Web Browser ● Bare HTML Pages ● Plugins and Problems ● From rich Content to HTML 5 – Drawing with HTML 5 Canvas ● Continuous, Event driven and free Drawing ● Basic Drawing "How does Drawing work with JavaScript?" ● Interaction with Controls ● Sources: – http://channel9.msdn.com/Niners/rbarraza – web.archive.org, Bare_HTML_Page (www.yahoo.com, 1996)
  • 3. 3 Vector and Raster-based Graphics ● We already discussed vector and raster displays, which bring graphics to a screen with different hardware respectively. ● Apart from how graphics are brought to screen by hardware, there are also different ways to render graphics by software. – (The term "rendering" is a more general term for "bringing graphics (incl. video) to the screen or to paper".) ● From a software perspective there exist vector-based and raster-based graphics.
  • 4. 4 Raster-based Graphics ● In this lecture we'll only discuss raster-based graphics in depth. ● Graphics that is rendered on a screen, whereby software handles pixels individually, is called raster-based. – (Raster-based graphics are also called pixel-based graphics.) ● For example Java's "Java 2D" software provides the function setRGB() to set one pixel to a certain value/color: ● Often, only raster-based graphics are associated with the word "drawing". ● Raster-based graphics are also used for photographs. // Java: Set the pixel at (0; 0) to white color: image.setRGB(0, 0, Color.WHITE.getRGB());
  • 5. 5 Basics on Raster-based Drawing ● Let's recapitulate, what a picture on a screen is: a big two-dimensional array of pixels, in other words it is a matrix. – Mind that we already discussed the needed memory depending on spatial dimension and color resolution: a picture is an array! ● To have graphics on the screen we could use functions, which draw pixels of a specific color at specific coordinates, e.g.: ● But there are some problems with this pixel-oriented approach: – It is relatively hard to use these functions to draw more complicated shapes like circles (e.g. with trigonometric functions). – Drawing individual pixels would be very inefficient and slow, at least not very interactive. ● Therefor graphics libraries provide special functions to draw graphic primitives (rectangle, ellipse, line, bezier and text): – This approach is very much faster than pixel-oriented drawing! Often the graphics adapter provides hardware acceleration. ● I.e. the calculation of coordinates of individual pixels to draw a circle (with trigonometry) can be done on the graphics adapter without using the CPU! ● The term graphics adapter can be reduced to the term Graphics Processing Unit (GPU). – A set of functions and objects controlling specific aspects on a computer is called Application Programming Interface (API). ● For operating systems (OS) providing a GUI, it is mandatory to have an API for graphics programming. // Java: Draw an ellipse of width and height at (0; 0): graphics.setColor(Color.WHITE); graphics.drawOval(0, 0, width, height); // Java: Set the pixel at (0; 0) to white color: image.setRGB(0, 0, Color.WHITE.getRGB());
  • 6. 6 Crispness ● We should have a look at the result of drawing a circle with a raster-based API, we'll continue using Java 2D: ● Welcome the alias-effect: It looks crisp, but... – …when we zoom the drawn image, the pixels become visible and we see how the circle is plotted by pixels mimicking an arc: ● For raster-based graphics there are two ways to get at least a bit of the crispness back: – (1) By the application of anti-aliasing, which smoothes a raster-graphics' edges with the background with colored extra pixels. – (2) By the application of subpixel rendering (e.g. ClearType on Windows). Zoom ZoomZoom Zoom ZoomZoom Subpixel rendering // Java: Draw a circle with the diameter 100 at (0; 0): graphics.setColor(Color.WHITE); graphics.drawOval(0, 0, 100, 100);
  • 7. 7 Excursion – Vector-based Graphics – Part I ● There are problems with raster-based graphics in general: – When parts of the graphics are zoomed, the crispness of details gets lost. It results in pixilated graphics, not recognizable as detail. – When the resolution increases, graphics get smaller. When the resolution decreases, graphics get larger. ● Is that a problem? Well, when we have a premium 4K display do we like smaller graphics or crisper graphics? ● These effects emerge because the rendering of raster-based graphics is dependent on the resolution. – The shown problems are esp. visible on arcs and circles and they are very annoying on text. increase resolution
  • 8. 8 Excursion – Vector-based Graphics – Part II ● To solve these problems, there needs to be a way to make the rendering of graphics independent from the resolution. – The logical resolution was made independent from the physical resolution. ● E.g. this idea was put into effect with Microsoft's Windows Presentation Foundation (WPF): – WPF introduced Device Independent Units (DIUs). DIUs are independent of a device's pixel raster, a DIU is defined as 1/96 of an inch. ● On a device having 96ppi (pixels per inch), 96 pixels would consume 1 inch; on a device having 120ppi, 96DIUs would be represented by 120 pixels... ● (If logical DIUs do not exactly match to physical pixels WPF will use anti-aliasing.) ● Vector-based graphics are described as formula, which is parameterized by the physical resolution. – It means that vector-based graphics are not described as an array of pixels! – Raster-based graphics get smaller with higher resolution and zooming leads to pixelation: – Vector-based graphics get crisper with higher resolution and zooming, em, just zooms! Vector-based graphics are scalable! raster-based zoom raster-based zoom raster-based zoom vector-based zoom vector-based zoom vector-based zoom
  • 9. 9 Excursion – Vector-based Graphics – Part III ● The application of vector-based graphics allowed the development some very important applications: – crisp and scalable texts to allow WYSIWYG editing of documents, – a new category of software for Computer Aided Design (CAD) to construct structures on a computer instead of pencil and paper, – a new category of software for Desktop Publishing (DTP) to layout high quality documents for printout. – => Graphics and print results of excellent quality on any scale. – (Vector-based graphics are not suited for photographs.) ● Besides these applications, which more or less deal with design, also the desktop was influenced meanwhile: – The scalability and crispness of vector-based graphics was applied to controls, windows and the desktop. – This was required, because of: ● (1) the availability of higher and higher physical resolutions (high definition, 4K, 8K) and ● (2) the availability of different screen sizes for the same applications (watch, mp3-player, automotive, mobile, tablet, notebook, PC screen, tv, projector). – Examples: ● Desktop: WPF, (Graphics Device Interface+ (GDI+)), Quartz, PostScript, Cairo ● Browser: Silverlight (WPF/E), Scalable Vector Graphics (SVG) ● Printer: PostScript
  • 10. 10 Overview of raster-based Drawing APIs ● In this presentation we'll only discuss raster-based drawing in more depth. ● Up to now we used the Java 2D API for the examples, but there exist more APIs: ● Windows – Graphics Device Interface (GDI) ● Linux – GTK+ drawing (GTK for GIMP Toolkit; GIMP for GNU Image Manipulation Program; GNU for GNU is not Unix) ● OS X – Quartz, Cocoa drawing
  • 11. 11 Native and platform independent Drawing APIs ● The drawing APIs we've enumerated are so called native APIs. What does that mean? – Native APIs are only usable on/compatible with a certain platform. E.g. Windows GDI code won't run on OS X. – I.e. code written in native APIs is not portable! → Native API vs. platform independent API. – On the other hand native APIs are fast, because they can exploit the power of the platform, e.g. directly use Windows functions. ● From a 20K miles perspective there are two ways to have platform independent (drawing) APIs: – Create and establish a common platform. ● Establish and use a common graphics API, which is translated into native graphics API calls at run time. ● E.g. Java 2D, QT – Use a present common platform. ● Find a platform, which is existent on most OS' and implement graphics on that platform. ● E.g. web browsers Operation System Graphics Adapter Native graphics API Platform independent graphics API Application Operation System Graphics Adapter Native graphics API Browser, interprets HTML Website
  • 12. 12 Platform independent Graphics in the Web Browser ● The following discussion deals with platform independent graphics via the web browser (browser). ● Browsers are an interesting platform, because they are available on all important operating systems! ● The first approach to put "graphical content" into effect on the browser was bare HTML with forms and controls. – ~mid 1990s
  • 13. 13 Bare HTML Pages ● Bare HTML pages do of course work very good in a browser, but using them didn't feel like using an application. – HTML pages basically look like a pages of text containing some links, form elements (controls) and images. – Using HTML pages is more or less navigation in the browser with links and the browser history. – HTML pages seem to have no togetherness: somehow the contents of the same web address seem to belong together somehow. ● In other words: togetherness is primarily defined by how the session with the HTML "site" is defined. ● Yes, it works, but the result is not very appealing. It is just "navigation in the browser". – When this approach was used, network throughput was low and the performance of clients was not very good. – On the client the browser just needed to store and render pages. The web server had to handle many requests. – HTML page 1 the "application" HTML page 2 HTML page 3 HTML page 4 Form Control 1 Control 2 Image Link One page in the browser browser history link link link web server Client Server delivers HTML pages
  • 14. 14 Rich content with Plugins ● The next incarnation of "graphical content" in the browser was the usage of additional browser plugins. – E.g. Java Applets, Adobe Flash, Apple QuickTime etc. ● The idea is to use a special control, which has very rich interactive features: – The functionality of these controls is provided by plugins, which are installed on the browser's OS. ● Typically the "object"- or "embed"-HTML-element is used. – With plugins the browser is able to execute mini-applications, often called applets, in instances of plugin controls. ● The browser does indeed start an embedded runtime (e.g. the Java runtime) to execute applets. – The web server delivers binary components (and HTML pages) that contain the code to be run in the plugin controls. – (Adobe Flash and Apple QuickTime were the most important plugins in order to play video material in the browser at all!) HTML page Plugin component One page in the browser
  • 15. 15 Rich content with Plugins ● Browser plugin technologies allowed "web-applications" consisting of only one site without the need for navigation. – It should be clarified that each type of plugin provides its own event system, apart from the browser's event system. – Because events are an intrinsic part of genuine GUIs, we can say that a web-application provides a genuine GUI. – Pages could be designed as a mosaic of plugin controls, such web-applications are called Single Page web-Applications (SPAs). ● A new aspect of SPAs is that no navigation/reloading of sites is needed. Only parts of the sites are reloaded. ● After SPAs with plugins established, another kind of SPAs emerged: those using AJAX. – AJAX (Asynchronous JavaScript And XML) uses JavaScript to load content dynamically without plugin components. ● The important point: AJAX allows to load parts of a currently displayed page w/o reloading the whole page! – The mix of those technologies is sometimes called "Web 2.0" to have a nice marketing term. – A web-application using Web 2.0 is sometimes called Rich Internet Application (RIA). ● It can be said that the last incarnation of RIAs were sites that consisted of one huge control making up the whole content. – E.g. JavaFX and Silverlight. ● Yes, this approach also worked and the results were appealing, but there are problems with the application of plugins!
  • 16. 16 Problems with Browser Plugins ● The problem lies in the place where plugins are executed: in the browser and on the client side. – Different browsers on different clients may behave differently. This also influences the effort for quality assurance! – The required runtimes (and correct versions thereof) need to be installed on the client side. – Because plugin components are loaded from a foreign source and executed on the client side, there is a certain security problem. ● To shield the client from vicious plugin code, plugin runtimes are executed in a so called sandbox having strong security constraints. ● The problem is that there could be a leak in the sandbox, which still allows vicious plugin code to be executed! ● => As a result the execution of plugins is often blocked, and many users don't trust these technologies (esp. Java applets). – Running plugin code requires a lot of resources: computing time as well as battery lifetime!
  • 17. 17 The Solution: HTML 5 ● However, in the end there are still many problems with GUIs in the browser: – With bare HTML the interaction is not appealing, e.g. navigation among HTML pages. – Plugins need a lot of resources: computing time and battery lifetime. – Plugin runtimes are not necessarily installed and activated on the client-side. – Plugins provide potential security problems. ● It took years until industry addressed these problems. In the end the answer was "HTML 5", providing important updates: – (HTML 5 is not strictly the successor of HTML 4, instead it is a set of new features running in the browser.) – New clever input controls: date pickers, email and web address controls, sliders and spinboxes etc. – Support for offline web-applications, HTML 5 storage and support for data mapping and annotation with microdata. – Support for mobile web-applications: geo location APIs. – Support for playing video material without third party components like Apple QuickTime or Adobe Flash. – Support for appealing/more desktop-like usage, e.g. with web workers for doing things in the background. – But, potentially the most powerful new feature is the "canvas"-HTML-element, which we will discuss for the rest of this lecture. ● "canvas" is basically a way to bring interactive graphics into the browser with JavaScript without any plugins. – Therefor we can now continue our discussion about of how software implements drawing in general...
  • 18. 18 Excursion: Continuous, Event driven and free Drawing – Part I ● Basically there exist three models for drawing on the computer screen: – Continuous drawing. – Event driven drawing. – Free drawing. ● Continuous drawing: – The code, which performs the drawing, is executed automatically and continuously at a certain framerate. ● Benefit: the programming of animation and other "vivid" graphics is very simple. It's good for learning graphics basics and simple to use for "sketching". ● Downside: it needs a lot of resources. – Example: Processing ● Event driven drawing: – The code, which performs the drawing is only executed, when specific events are raised (e.g. update, redraw, refresh, resize). ● Benefit: it doesn't need many resources. ● Downside: W/o interaction there is generally no drawing. (To have continuous drawing with an event driven drawing API, we have to fire draw events at a certain framerate or call the drawing code continuously ourselves.) – Examples: Cocoa drawing (OS X), GTK, Java 2D, Windows Forms
  • 19. 19 Excursion: Continuous, Event driven and free Drawing – Part II ● However, we want to discuss the third approach: free drawing. ● The idea of free drawing is that there is neither a dedicated event that initiates drawing nor any redrawing framerate. ● Free drawing means that any code, which can access the context of the graphics is able to draw! – The code can draw independently on events as well as independently on a continuous framerate. – It should be said that this is also possible with, e.g., Windows Forms, but the result might be overdrawn by the draw-event! ● E.g. with HTML 5 canvas each function is able to draw, because the graphical context can be accessed from everywhere. – Benefits: it is simple to use from scratch. – Downsides: it can be tricky to migrate code from other drawing approaches. ● Ok, now its time to see free drawing with HTML 5 canvas!
  • 20. 20 Let's go and draw! ● We'll begin with a general HTML scaffold to program canvas with these important parts: – (1) Import the file containing the needed JavaScript code (Canvas.js). – (2) Bind the HTML page's load event to the JavaScript function draw() (defined in Canvas.js). – (3) Mark the canvas element in the page's body with the id "myCanvas". ● In the JavaScript file "Canvas.js" we implement the function draw(): – (a) Get the HTML page's canvas element by its id "myCanvas". – (b) Get the graphical context from the canvas element by calling getContext("2d"). – (c) On the canvas' graphics context draw on the canvas programmatically with special functions (e.g. arc() and fill()). ● As can be seen, the event onload and the canvas object connect the HTML page with the JavaScript code. <html> <head> <script src="Canvas.js"></script> <!--(1)--> <title>Canvas</title> </head> <body onload="draw();"> <!--(2)--> <canvas id="myCanvas" width="300" height="300"></canvas><!--(3)--> </body> </html> function draw() { var canvas = document.getElementById("myCanvas"); // (a) var context = canvas.getContext("2d"); // (b) // (c): context.arc(canvas.width/2, canvas.height/2, 75, 0, 2 * Math.PI, false); context.fill(); }
  • 21. 21 Excursion: Notification or Polling ● When the page's load event is fired, the function draw() will be called. – This event is fired when the page is loaded into the browser. The state of the page then changes from unloaded to loaded. ● There exist two "extreme" ways to deal with state changes. ● Communication via events: – We attach our code to the event, to which we want to react (get notified). ● The code, which is called when the event fired, is called eventhandler or eventlistener. – => We passively assume that the event will be fired somewhen in future. When the event is fired, we're getting notified. – (This is what we call the "hollywood principle": Don't call us, we'll call you! It's also called "callback principle".) ● Communication via polling: – We query a system function continuousely, until a certain state has changed. – => We actively poll for a state to be changed (here with "slow busy waiting"). ● JavaScript uses events for communication. – Most GUI frameworks use events as well. // Attaching an eventlistener: // The eventlistener draw(): function draw() { /* pass */ } // Attach the eventlistener draw() to the load event: document.addEventListener("load", draw); // Polling (this is no legal JavaScript code): // The draw() function: function draw() { /* pass */ } // Wait until the page is loaded: while (!document.isLoaded) { wait(1000); // "slow busy waiting" } // When the document is loaded call draw(): draw();
  • 22. 22 Drawing on a Canvas Element ● Canvas allows to draw two kinds of primitives: solid primitives and paths (no official JavaScript API terms). ● Solid primitives are filled with a color, gradient or pattern. – Relevant functions and properties: fillRect(), fillStyle, fill() (to fill a drafted path (see below)) ● Paths are drafted with functions, which define the skeleton of a figure. Later on, these paths are stroked to be visible. – Drafting paths is like "preliminary" drawing a figure with a very fine and hard pencil. – Stroking is like drawing the real figure with ink. – Relevant functions and properties: beginPath(), closePath(), moveTo(), lineTo(), rect(), arc(), strokeStyle, stroke() or fill() – Sometimes ● (1) a path needs to be started by calling beginPath() and sometimes ● (2) after the drafting is done a path needs to be closed (connecting the first with the last "pencil stop" with a line) by calling closePath(). function drawPathAndStrokeCircle() { var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); context.arc(/* pass */); context.stroke(); } function drawSolidCircle() { var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); context.arc(/* pass */); context.fill(); }
  • 23. 23 Controls ● So far we have a rough understanding of how we can draw visible contents on an HTML page. – But it would be very time consuming to draw every piece of interaction in such a way! – Therefor we have predefined pieces of interaction: controls. ● Controls are pieces on a GUI, arranged on a window, with which the user can interact. – Users use mouse, keyboard and touch gestures to interact with the controls on the GUI.
  • 24. 24 Combine/implement Interaction with Controls and Canvas ● In this example we bind another eventlistener to the onclick event of a button. – The onclick event is fired, when the button is clicked. – The eventlistener drawInnerCircle() draws a smaller inner circle into the initial circle. – The eventlistener drawInnerCircle() sets the text of the textbox to "Button clicked!". ● Via events and JavaScript code we can have real interactivity. – Events are typically a result of user interaction, e.g. clicking a button. ● Events are fired, when the state of HTML controls changes (page loaded, button clicked etc.). – JavaScript code is provided by developers. ● JavaScript code is able to access (getElementById()) and change the state of controls (e.g. setting a value). function drawInnerCircle() { var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); var textBox; context.beginPath(); // Initiate a new path to decouple from 1st arc! context.arc(canvas.width/2, canvas.height/2, 20, 0, 2 * Math.PI, false); context.fillStyle = "white"; context.fill(); textBox = document.getElementById("myText"); textBox.value = "Button clicked!"; } <html> <head> <script src="Canvas.js"></script> <title>Canvas</title> </head> <body onload="draw();"> <canvas id="myCanvas" width="300" height="300"></canvas> <button onclick="drawInnerCircle();">Click me!</button> <input id="myText" type="text"></input> </body> </html>
  • 25. 25 Events with Parameters ● We can also attach events to a canvas element, e.g. to canvas' onmousedown event: – The onmousedown event is fired, when the canvas is clicked. – As can be seen, the onmousedown event is somewhat special: it accepts an argument! ● Here we pass the global event object, just called "event". – The event's argument is available via the parameter e in the eventlistener canvasClicked(). – The parameter allows to read the coordinates (i.e. properties x and y) of the mouse position, on which the mouse was clicked. ● A common strategy is to pass the global event object as an argument to the eventlistener. – The passed object contains extra information about the state of the page, controls, keyboard and mouse. – Then the eventlistener's parameter provides a lot of properties and functions, which allow almost full control of the GUI. function canvasClicked(e) { var textBox = document.getElementById("myText"); textBox.value = "x = "+e.x+"; y = "+e.y; } <html> <head> <script src="Canvas.js"></script> <title>Canvas</title> </head> <body onload="draw();"> <canvas id="myCanvas" onmousedown="canvasClicked(event);" width="300" height="300"></canvas> <input id="myText" type="text"></input> </body> </html>
  • 26. 26 Web Apps with HTML and JavaScript in Reality ● There are some important downsides of this approach: – A browser needs to be able to render "HTML 5" in order to fully unleash the power of, e.g., canvas. – The execution of JavaScript needs to be enabled in the browser! – The HTML- as well as the JavaScript-code are loaded to the client side and can be read. ● I.e. the code could be copied/reused without permission. Also leaks could be easily detected and exploited. ● (However there is a way to reduce the readability of code: with "code minimizers" (i.e. the opposite of code beautifiers).) ● General acceptance of web-applications: – Most of them do not work offline. – The acceptance of users is not always given, esp. the look and feel (l&f) is not like that of a desktop application. – Web-applications can be a cheap but effective solution for business applications.

Editor's Notes

  1. The coordinate system of pixels is a left-handed system (an example for a right-handed coordinate system is the cartesian coordinate system)! This is due to the fact that pictures are drawn row wise on a CRT.
  2. Aliasing is a term taken from digital signal processing technologies. Aliasing happens if the resolution of a raster graphic (read: frequency) is greater than the resolution of a zoom frame (read: scan frequency). Graphical anti aliasing put a considerable burden on rendering a graphic. Some tools, e.g. LibreOffice allow to deactivate anti aliasing. Bill Hill invented ClearType at IBM in 1988. The exploitation of sub pixels lead to having more DPIs, which lead to nicer text before WPF! It should be said that techniques for anti aliasing are about to get superfluous with 4K (4096 × 2304 or 3840 × 2160) graphics. The pixels are so small that they are typically no longer individually visible.
  3. Scalability can be defined in a very simple way: Graphics a scalable, if it is parameterized with physical resolutions (spacial dimension as well as color resolution). Maybe in future we&amp;apos;ll have to take more parameters into consideration: 3D-depth/resolution, haptic-detail-resolution, etc.
  4. Using the same graphics API for graphics on the screen as well as for the printer is the basis for WYSIWYG. On OS X the graphics engine &amp;quot;Quartz&amp;quot; is based on PDF (Portable Document Format) and uses PDF&amp;apos;s features to have resolution independent graphics on the desktop. Virtually OS X uses PostScript and transparent PNGs and Windows uses a mix of raster- and vector-base graphics. PDF is based on PostScript, but it is structured like a &amp;quot;real&amp;quot; programming language. There are also some extra features in PDF like transparent regions. GDI+ is the successor of GDI. It is hardware accelerated (which was no longer the case for GDI starting with Windows Vista) and has a couple of features for using vector-based graphics.
  5. We&amp;apos;ll not discuss multitiered architectures here. Let&amp;apos;s just assume that we have a web server as well as clients and no other participants (e.g. database servers). But it should be said that the shown architecture does somehow resemble the &amp;quot;thin-client-mainframe&amp;quot; architecture. The thin-client is the application running in the browser, the mainframe is the web-server, or whatever servers are behind the server-border (following the figure on this slide).
  6. Before HTML 5 the applet element could be used for Java applets. This element is no longer supported. There also exist so called hybrid Java-applets: those implement a Java main() method, which makes them runnable as &amp;quot;ordinary&amp;quot; Java application on the desktop. Some OS&amp;apos; allow applets running, or even web sites, on the desktop, these mini-applications on the desktop are sometimes called widgets.
  7. In order to maximize battery lifetime, some browsers (e.g. Safari) freeze the execution of plugins, so that the uses must start them manually on the page.
  8. Apple&amp;apos;s browser Safari 7 addressed the computing time and battery life problem: the execution of plugins are paused by default. Virtually all these individual HTML 5 features need to be checked for support in the browser. A browser may support only a subset of these features; browser do usually not support &amp;quot;HTML 5&amp;quot; completely. HTML 5 video supports video/mp4, video/webm and video/ogg following the standard.
  9. There exists Processing.js, which is a continuous drawing API based on Processing, but being implemented used the event driven canvas API.
  10. There exists Processing.js, which is a continuous drawing API based on Processing, but being implemented used the event driven canvas API.
  11. Yes, we are using an event to initiate drawing here, but this is not required, we could use the same drawing code in any function elsewhere! In this example we do so, because we want to see something drawn as soon as the HTML page in loaded! The coordinates are pixels relative to the left upper corner of the canvas element. The last parameter of arc() controls whether the arc is drawn clockwise (argument is false) or anticlockwise (argument is true).
  12. The function moveTo() works like &amp;quot;pencil stop&amp;quot; and then moving the pencil to another location without drawing a line.
  13. Code minimizers do basically rename the used identifiers (variable and function names) to very short names and remove superfluous whitespaces. - These modifications in the code &amp;quot;obfuscate&amp;quot; the code and reduce the size of the code files, which need to be transmitted from the web server to the client.