
Application System/400 IBM Programming: GDDM Programming Guide Version 2 SC41-0536-00 Application System/400 IBM Programming: GDDM Programming Guide Version 2 SC41-0536-00 | Take Note! | Before using this information and the product it supports, be sure to read the general information under “Notices” on page ix. | First Edition (May 1991) | This edition applies to the licensed program IBM Operating System/400 (Program 5738-SS1), Version 2 Release 1 Modification 0, | and to all subsequent releases and modifications until otherwise indicated in new editions. Make sure you are using the proper | edition for the level of the product. | Order publications through your IBM representative or the IBM branch serving your locality. Publications are not stocked at the | address given below. | A form for readers' comments is provided at the back of this publication. If the form has been removed, you may address your | comments to: | Attn Department 245 | IBM Corporation | 3605 Highway 52 N | Rochester, MN 55901-7899 | When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes | appropriate without incurring any obligation to you or restricting your use of it. | Copyright International Business Machines Corporation 1991. All rights reserved. | US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents | Notices . ix | Programming Interface . ix | About This Guide .................................... xi | Who Should Use This Guide .............................. xi Chapter 1. An Introduction to OS/400 Graphics ................ 1-1 What Is OS/400 Graphics All About? ........................ 1-1 What Are Some Uses of OS/400 Graphics? .................... 1-1 What Do I Need Before I Can Use OS/400 Graphics? .............. 1-2 AS/400 Hardware . 1-2 AS/400 Software . 1-3 Required Knowledge . 1-3 Chapter 2. The Application Program Interface to Graphics ......... 2-1 Programming Considerations . 2-1 Drawing a Simple Picture with GDDM ...................... 2-2 How the Program Works ............................ 2-5 Drawing a Simple Chart with Presentation Graphics Routines ....... 2-11 How the Program Works ........................... 2-12 The Syntax of Routines ............................. 2-14 Parameters that Supply Values to the Program .............. 2-14 Parameters that Get Values from the Program .............. 2-14 The Names of the Routines ......................... 2-14 The Parts of a Typical Program ......................... 2-15 Summary of This Chapter ............................ 2-15 Chapter 3. Using GDDM . 3-1 Drawing Pictures . 3-2 Graphic Primitives and Their Attributes ...................... 3-2 Setting Color Attributes ............................... 3-2 | Selecting a Color ................................. 3-2 | Mixing Colors . 3-7 The Current Position ............................... 3-11 | Setting the Current Position ......................... 3-11 | Querying the Current Position ........................ 3-11 | Querying the Cursor Position ......................... 3-11 How to Draw Lines ................................ 3-12 | Setting Attributes for Lines .......................... 3-12 | Drawing Straight Lines ............................ 3-14 | Drawing Curved Lines ............................. 3-17 How to Draw Filled Areas ............................ 3-22 | Drawing Area-Fills . 3-22 | Selecting a Pattern for Filled Areas ..................... 3-24 How to Draw Graphics Symbols ........................ 3-25 Controlling Symbol Sets ............................ 3-27 | Loading Symbol Sets ............................. 3-28 | Selecting a Character Mode ......................... 3-29 | Selecting the Current Symbol Set ...................... 3-29 | Drawing Graphics Symbols .......................... 3-29 Copyright IBM Corp. 1991 iii Attributes for Graphics Symbols ....................... 3-30 | Setting the Graphics Symbol Size ...................... 3-30 | Setting the Character Angle ......................... 3-32 | Setting the Character Direction ........................ 3-33 | Setting the Character Shear ......................... 3-34 Drawing Graphics Images ............................ 3-35 | Drawing a Graphics Image .......................... 3-36 | Drawing a Scaled Graphics Image ...................... 3-38 How to Draw Markers ............................... 3-38 | Loading Marker Symbol Sets ......................... 3-39 | Selecting a Marker ............................... 3-39 | Drawing Markers . 3-39 | Drawing Scaled Markers ........................... 3-39 Drawing Pictures: Summary . 3-40 Controlling Graphics . 3-41 Program Controls . 3-41 Graphics Environment Controls ....................... 3-41 | Initializing and Terminating the Graphics Environment .......... 3-41 Error Handling Controls ............................ 3-41 | Specifying an Error Handling Program ................... 3-41 | Querying the Last Error ............................ 3-42 Display Controls . 3-42 | Sending the Picture to a Device ....................... 3-42 Picture Controls . 3-43 The Device . 3-43 The Page . 3-44 | Creating a Page ................................ 3-45 | Selecting a Page ................................ 3-46 | Clearing a Page ................................ 3-47 | Deleting a Page ................................ 3-47 | Querying Page Information .......................... 3-47 The Graphics Field ............................... 3-47 | Defining a Field ................................. 3-48 | Clearing a Field ................................ 3-48 The Picture Space ............................... 3-48 | Defining a Picture Space ........................... 3-49 The Viewport . 3-50 | Defining a Viewport .............................. 3-52 The Graphics Window ............................. 3-53 | Defining a Graphics Window ......................... 3-54 Clipping . 3-55 | Setting the Clipping State ........................... 3-56 The Graphics Segment ............................ 3-58 | Creating a Graphics Segment ........................ 3-58 | Closing a Graphics Segment ......................... 3-58 | Deleting a Graphics Segment ........................ 3-58 | Querying the Number of Graphics Segments ............... 3-59 Retained and Temporary Data ........................ 3-63 Device Controls . 3-65 | Opening and Closing Devices ........................ 3-66 | Using Devices . 3-66 | Querying the Device Characteristics ..................... 3-67 | Sounding the Device Alarm .......................... 3-67 Controlling Graphics: Summary . 3-67 iv AS/400 GDDM Programming Guide Using Graphics Data Format Files ......................... 3-68 | Retrieving Graphics Data ........................... 3-68 | Drawing a Picture with a Graphics Data Format File ........... 3-68 Summary of This Chapter .............................. 3-72 Chapter 4. Using Presentation Graphics .................... 4-1 Understanding Presentation Graphics Routines .................. 4-1 Chart Types . 4-4 Line Charts . 4-4 Scatter Plots . 4-5 Surface Charts . 4-6 Bar Charts . 4-7 Histograms . 4-9 Pie Charts . 4-10 Venn Diagrams . 4-11 Using Charts to Show Data ........................... 4-12 Selecting a Chart Type ............................ 4-12 Drawing Charts with Presentation Graphics Routines .............. 4-13 The Structure of Presentation Graphics Programs .............. 4-13 Control Operations . 4-13 Chart Definition . 4-14 Chart Drawing . 4-14 What You Can Do in a Program and Where ................ 4-14 More Control Operations ........................... 4-15 Designing the Chart Layout ........................... 4-15 | Setting the Chart Size ............................. 4-15 | Setting the Character Size .......................... 4-16 | Setting the Chart Margins ........................... 4-17 | Enclosing the Chart in a Frame ....................... 4-18 | Setting the Frame Attributes ......................... 4-18 Adding Chart Features .............................. 4-18 Writing Chart Headings ............................ 4-19 | Writing the Chart Heading .......................... 4-19 | Suppressing the Chart Heading ....................... 4-19 | Setting the Heading Attributes ........................ 4-19 | Positioning the Chart Heading ........................ 4-20 Drawing Chart Axes .............................. 4-20 | Drawing or Suppressing the Chart Axes .................. 4-21 | Setting the Number of Axes ......................... 4-22 | Setting the Axis Attributes ........................... 4-23 | Positioning the Axis .............................. 4-23 | Setting the Axis Range ............................ 4-26 | Setting the Axis Scale ............................. 4-27 | Drawing the Axis Tick Marks ......................... 4-28 | Writing the Axis Text .............................. 4-30 Writing Axis Titles ............................... 4-30 Setting the Title Attributes ........................... 4-30 Writing the Axis Title .............................. 4-31 Positioning the Title .............................. 4-31 | Writing Axis Labels .............................. 4-32 Setting Label Attributes ............................ 4-33 Setting Individual Axis Label Attributes ................... 4-33 Positioning the Labels ............................. 4-33 Blanking the Label Area ............................ 4-33 Contents v Specifying the Type of Label ......................... 4-33 Numeric Labels
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages323 Page
-
File Size-