Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8926937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:06:24+00:00 2026-06-15T08:06:24+00:00

I’ve set up a drawing tool using an approach similar to what’s shown in

  • 0

I’ve set up a drawing tool using an approach similar to what’s shown in this SO question … I have a subclass of UIView that tracks touches, creates UIBezierPath objects, adds the paths to an array, then draws them onto the view in drawRect. The view is transparent ([UIColor clearColor], opaque=NO) and is placed over a UIWebView that displays documents in PDF and Word formats.

I want to use this tool to highlight text, so I’m using a yellow stroke color with .5 alpha. This works fairly well, but the color makes the text look faded where it overlaps. I was reading the description for the kCGBlendModeMultiply blend mode and thinking that would be perfect — it should allow the text to “punch through” the highlight color for better contrast.

However, I can’t see any difference between kCGBlendModeNormal, kCGBlendModeMultiply or any random blend mode I’ve tried. Do these really work, or do they only work in some situations?

Here’s my drawRect code:

- (void)drawRect:(CGRect)rect {
    for (UIBezierPath *path in self.paths) {
        [[UIColor colorWithRed:1 green:1 blue:0 alpha:0.5] setStroke]; // yellow
        //[path stroke]; // uses default blend mode
        [path strokeWithBlendMode:kCGBlendModeMultiply alpha:1.0]; // looks the same as above
    }
}

I tried setting the alpha of the color to 1.0 and the alpha argument of the strokeWithBlendMode method to 0.5, but it doesn’t make any difference. Am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:06:25+00:00Added an answer on June 15, 2026 at 8:06 am

    Your text is in a whole different world as far as your code is concerned. When you enter drawRect:, what you have available to you is a CGContextRef that was created specifically for your view and your view alone. It has no idea what is in other views, and so all of your blending is taking place against a bunch of clear pixels.

    I’d say just lower the alpha a bit more, it will look ok. Or, you can draw the strokes behind the text to make the text stand out a bit more (this will take a bit of trickery though).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I know there's a lot of other questions out there that deal with this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.