Article Preview
Buy Now
COLUMN
The Missing Picture class
Issue: 3.5 (May/June 2005)
Author: Didier Barbas
Author Bio: Didier has been a dilettante programmer and linguist for more than 20 years. Unusual for a Frenchman, he speaks 11 languages, including Korean and PowerPC machine-language.
Article Description: No description available.
Article Length (in bytes): 8,797
Starting Page Number: 46
Article Number: 3521
Resource File(s):
3521.zip Updated: 2005-05-18 09:07:24
Related Web Link(s):
http://effbot.org/downloads/#Imaging
http://effbot.org/zone/pil-toc.htm
Excerpt of article text...
When building console applications, we may not use instances of the Picture class. This restriction is imposed by some requirements that would make compiling Picture-enabled console applications a nightmare, or so I gather. Thus, until Mars Saxman and the other voodoo artists at REAL Software come up with a solution, we are out on a limb. So far, the best solution I have found is to use PIL, Python's Imaging Library. There are other solutions, like using ImageMagick (which I have used quite a bit, and like), but so far the only one I found that gave access to the innards of the image, while providing a fair number of manipulation functions, is PIL. Besides, all solutions are external and require us to install libraries (unless you want to write your own class in pure RB), so in the end, it's a matter of choice, really. So this column will be about integrating PIL within RB, at least on Mac OS X. PIL exists on Windows -- I understand the author is actually more Windows-oriented than I'll ever be -- so I suppose that the provided sample project is usable, with some modifications, on Windows. Linux users should be all right, although I have yet to test it.
Objectives
The principal objective is to provide a custom class that will behave, to the outsider, as much as possible like RB's native Picture class -- that is, in the GUI app version. Whatever black magic we use to have RB and PIL work together, it should be transparent.
We won't be able to provide a fully functional Picture class in the space of this column, but we can give it our best effort, and fill in the blanks later. The idea for this issue is to put in place the structure that will enable such a class.
Requirements
...End of Excerpt. Please purchase the magazine to read the full article.