Reference MWAPI

Chapter 6: Drawing

Overview

The last chapter focused on the other fourteen gadget types, and introduced the DRAW and DRAWTYPE attributes used for draw commands. This chapter focuses on the last type with a detailed look at the Generic Box gadget and draw commands. Draw commands give the Generic Box gadget the unique ability to draw geometric shapes, edit pixels, display images, and do the things you would expect from a drawing application.

The Creation and Modification section presents an overview of how draw commands are assigned and the drawing is created in the gadget. Detail coverage of each command is found in the Draw Commands section. A Generic Box gadget is produced with graphical objects in the Implementation section, and includes source code and discussion. After reading this chapter, the reader will have the tools needed to add imagery and drawing capabilities to an application.

Creation and Modification

This section explains how to use draw commands to create and modify objects in the drawing area of the gadget they are assigned. Drawing capabilities are only available to gadgets specified to use the DRAW and DRAWTYPE attributes. Currently only the Generic Box gadget is so specified by the MWAPI specification, and the drawing area is the entire area of the gadget. Drawing objects involves the assignment of draw commands to nodes descended from the gadget's DRAW attribute, and the subscript values must be nonnegative numeric values. If an application attempts to assign a negative valued subscript, an error will occur with a code...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Computer-Aided Design (CAD) Services
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.