objective c - Draw a square on Mac OS X? -
i draw small square, 4x4 pixels. able adjust color @ runtime (not color or anything, user doesn't need able to). had been doing nsimage
, uses lot of resources , can't adjust, , making different little color swatch in photoshop change new color huge pain, no longer suitable. how can done on mac os x ?
the simplest way draw 4x4 square @ coordinate 0,0 (bottom left) on mac os x:
nsrectfill(nsmakerect(0.0, 0.0, 4.0, 4.0));
the simplest way set colour used sort of drawing:
[[nscolor colorwithcalibratedred:... green:... blue:... alpha:1.0] set];
;)
Comments
Post a Comment