Article Preview
Buy Now
COLUMN
Welcome to the REALbasic Developer Magazine Beginner's Corner!
Issue: 1.5 (April/May 2003)
Author: Thomas J. Cunningham
Author Bio: Thomas is a hobbyist programmer and enjoys sharing the RB loving with others... His online RB Beginner tutorial has had over 17,000 hits!
Article Description: No description available.
Article Length (in bytes): 9,533
Starting Page Number: 28
Article Number: 1514
Resource File(s):
1514.zip Updated: 2013-03-11 19:07:56
Related Link(s): None
Excerpt of article text...
As promised, this month's column will continue with basic drawing concepts in RB. Last month we discussed pixels, resolution, color depth, and we explored a few methods of the Graphics class.
Graphics As A Layer
When I first started using RB, I wanted to be able to draw things using my computer. Sounds easy, but drawing to a computer can be a bit confusing, so let me introduce a concept that helped me get over the hump with drawing in RB: a bit of semantics. Remember that we are discussing the Graphics class.
When we speak of a graphics property, it is usefule to substitute the word "layer" for the word "property." We draw things to a graphics layer. Think of this layer as a thin sheet of clear plastic. Some classes come with this plastic sheet. A window, for example, has a graphics layer: our thin sheet of plastic to which we can draw. Most classes do not have a graphics property that we can use. A StaticText class, for example, does not have a graphics property (well, it does, since it is drawn to our screen, but RB does not give us access to its property).
Okay, so some classes have a graphics layer where we can do some drawing. In addition, if a class has a graphics layer, it also has a
Paint Event associated with it. Remember, RB is an event-driven environment, so we need to balance our understanding between both classes and the events it responds to.Paint Event
...End of Excerpt. Please purchase the magazine to read the full article.