Re[4]: copyToBitmapFile

new topic     » topic index » view thread      » older message » newer message

------------434A3719495206

> Win32Lib is choking.  Here's the complete program:
> [begin code]
<snip>
> [end code]

Ah, you're using a label to display the text, didn't think of that (I
have no idea why not, really should have :). Anyway, you can place
text on a pixmap using the wPuts() function (see the Fonts section in
the win32lib doc).

I've attached a working copy of the program, basically all I've done
is:
* Comment out the PixLabel line
* Add the following lines to makeImage (and the declaration of the
size variable as a sequence):
        --...could use setFont and setTextColor on songPix here...
--Get the size that the text will take up, you could just set size to a
        constant if you want the bitmap to always be the same size
        size = getTextExtent(songPix,s)
        --Set the pen color to a good background color (i'll use white)
        setPenColor(songPix,White)
        --Erase whatever is currently in the pixmap
        drawRectangle(songPix,1,0,0,size[1],size[2])
        --Set the position to write text at
        setPenPos(songPix,0,0)
        ---Write the text to the pixmap
        wPuts(songPix,s)
* Changed the copyToBitmapFile line in makeImage to use the sizes
found using getTextExtent()

Hope it makes some sort of sense :)

Thomas Parslow (PatRat) ICQ #:26359483
Rat Software
http://www.rat-software.com/
Please leave quoted text in place when replying
------------434A3719495206
Content-Type: application/octet-stream; name="ticker.exw"
Content-Transfer-Encoding: base64

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu