Re: Pictures as characters
Re: Pictures as characters
- Subject: Re: Pictures as characters
- From: Aaron Fothergill <email@hidden>
- Date: Fri, 21 Jan 2005 15:35:57 +0000
Assuming you're using the images as characters for a more graphical
font effect (the sort of effect you can't get just by changing font),
one simple method is to create an array of NSImages to store all your
characters in, load them all in at the start of the app and use
NSImage's drawAtPoint method to draw the required images across a
single view.
A slightly more optimal method would be to draw all your characters in
a single image, in rows (a single row if all you need are A-Z, or a
grid of 128 characters if you're doing a full ASCII set). Load this in
as an NSImage on initialisation. You can then use the fromRect:
parameter of drawAtPoint to target the character to draw from within
the source image. You should end up with a graphical text method that
lets you draw a string of text in any view if you work on it :)
_____________________________
Aaron Fothergill : MD / Lead Coder
Strange Flavour Ltd
email@hidden
http://www.strangeflavour.com
On 21 Jan 2005, at 14:19, Peter Karlsson wrote:
Dear list!
I have 32 NSImageView's in my app, located as a row. I take a 32
character
NSString and convert the first char to a ascii filename (for example A
=
65.tif) and load a picture in the first NSImageView. The 32
NSImageView's
is called view1Outlet, view2Outlet and so on. This is a lot of work. Is
there another and better way to use pictures as characters?
Best regards Peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden