Đang chuẩn bị liên kết để tải về tài liệu:
Lecture Programming principles and practice using C++: Chapter 12 - Bjarne Stroustrup

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

This lecture presents a display model (the output part of a GUI), giving examples of use and fundamental notions such as screen coordinates, lines, and color. Some examples of shapes are Lines, Polygons, Axes, and Text. For more information, inviting you refer. | Chapter 12 A display model Bjarne Stroustrup www.stroustrup.com/Programming Abstract This lecture presents a display model (the output part of a GUI), giving examples of use and fundamental notions such as screen coordinates, lines, and color. Some examples of shapes are Lines, Polygons, Axes, and Text. Stroustrup/Programming Overview Why graphics? A graphics model Examples Stroustrup/Programming Why bother with graphics and GUI? It’s very common If you write conventional PC applications, you’ll have to do it It’s useful Instant feedback Graphing functions Displaying results It can illustrate some generally useful concepts and techniques Stroustrup/Programming Why bother with graphics and GUI? It can only be done well using some pretty neat language features Lots of good (small) code examples It can be non-trivial to “get” the key concepts So it’s worth teaching If we don’t show how it’s done, you might think it was “magic” Graphics is fun! Stroustrup/Programming Why | Chapter 12 A display model Bjarne Stroustrup www.stroustrup.com/Programming Abstract This lecture presents a display model (the output part of a GUI), giving examples of use and fundamental notions such as screen coordinates, lines, and color. Some examples of shapes are Lines, Polygons, Axes, and Text. Stroustrup/Programming Overview Why graphics? A graphics model Examples Stroustrup/Programming Why bother with graphics and GUI? It’s very common If you write conventional PC applications, you’ll have to do it It’s useful Instant feedback Graphing functions Displaying results It can illustrate some generally useful concepts and techniques Stroustrup/Programming Why bother with graphics and GUI? It can only be done well using some pretty neat language features Lots of good (small) code examples It can be non-trivial to “get” the key concepts So it’s worth teaching If we don’t show how it’s done, you might think it was “magic” Graphics is fun! Stroustrup/Programming Why Graphics/GUI? WYSIWYG What you see (in your code) is what you get (on your screen) Direct correspondence between concepts, code, and output Stroustrup/Programming Display model Objects (such as graphs) are “attached to” a window. The “display engine” invokes display commands (such as “draw line from x to y”) for the objects in a window Objects such as Square contain vectors of lines, text, etc. for the window to draw Shape Square “window” Display Engine attach() attach() draw() Stroustrup/Programming Display model An example illustrating the display model int main() { using namespace Graph_lib; // use our graphics interface library Point tl(100,200); // a point (obviously) Simple_window win(tl,600,400,"Canvas"); // make a simple window Polygon poly; // make a shape (a polygon, obviously) poly.add(Point(300,200)); // add three points to the polygon poly.add(Point(350,100)); poly.add(Point(400,200)); poly.set_color(Color::red); // make the polygon red (obviously) .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.