Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

Beginner's Corner

Canvas 101

Canvas Basics

Issue: 7.5 (July/August 2009)
Author: Marc Zeedar editor-at-rbdeveloper.com
Article Description: No description available.
Article Length (in bytes): 13,576
Starting Page Number: 46
RBD Number: 7515
Resource File(s):

Download Icon 7515 project.zip Updated: Wednesday, July 1, 2009 at 1:24 PM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

Beginners are often intimidated by the canvas control. It took me a while before I did much with it. A canvas is literally blank, an empty canvas if you will, ready for you to paint with code. So what do you do with it?

The most common use for a canvas is to display a picture. This is easily accomplished by simply dragging a canvas to a window and setting the canvas' backdrop property to a graphic you've imported into your project.

This technique is useful for displaying something simple like an application's logo or a background picture, and it has the key advantage of displaying within the IDE so you can see the result without having to compile and run your application.

But it's severely limited. The picture is a fixed size and is non-interactive (that is, it does not respond to mouse clicks or anything else).

When you get a little more advanced, you might figure out that instead of displaying a picture via the backdrop property, you're much better off drawing the picture manually (via code) within the canvas' paint event.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com