• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Colorizing a bitmap
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Colorizing a bitmap


  • Subject: Colorizing a bitmap
  • From: "Craig Dooley" <email@hidden>
  • Date: Mon, 21 Aug 2006 09:46:07 -0400

I am writing a remote desktop client, and one of the drawing
operations is drawing text in color.  Glyphs are sent in one operation
as a bitmap, and cached.  It is later requested that a string of
glyphs be drawn in a specific color.

Currently I am creating a new NSBitmapImageRep for each glyph and
drawing that in black, but I am having a hard time figuring out the
best way to color this.  The options I have thought of are

1. Store the bitmap and then create a new image each time I want to
draw by creating a new solid plane for the color and using the bitmap
as an alpha mask.

2. Colorize the image using
colorizeByMappingGray:toColor:blackMapping:whiteMapping:.  However, I
would have to have a 8 bits per sample NSBitmapImageRep, and currently
I am only using 1bit per sample.

3. Use core graphics to create a stencil pattern.

4. Use core graphics with the bitmap as an image mask.

Is there an easier way that I have overlooked?  Any suggestions?

--
-----------------------------------------------------------------------
Craig Dooley <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


  • Follow-Ups:
    • Re: Colorizing a bitmap
      • From: Stephen Deken <email@hidden>
  • Prev by Date: NSFindPboard
  • Next by Date: Re: Colorizing a bitmap
  • Previous by thread: NSFindPboard
  • Next by thread: Re: Colorizing a bitmap
  • Index(es):
    • Date
    • Thread