- (UIImage *)dtk_setImageColor:(UIColor *)imageColor{
// Get canvas
UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0f);
// The brush is stained with color
[imageColor setFill];
CGRect bounds = CGRectMake(, , self.size.width, self.size.height);
// Draw once
UIRectFill(bounds);
// Draw again
[self drawInRect:bounds blendMode:kCGBlendModeOverlay alpha:1.0f];
// Get photo
[self drawInRect:bounds blendMode:kCGBlendModeDestinationIn alpha:1.0f];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}

iOS-UIImage More related articles on drawing colors in pictures

  1. iOS Develop image and color processing tools

    1. Make a picture based on the color /** Make a picture based on the color @param color Color system UIColor type @return a sheet UIImage picture */ + (UIImage *)createIm ...

  2. ios UIImage Picture stretch resizableImageWithCapInsets:

    Common button addition and background settings are as follows : UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(80, 130, 160, 44)];[bu ...

  3. iOS UIImage Some learning points of partial stretching of pictures

    Before Do solid color local stretch adopt top  bottom left  right Intersecting shadows stretch To test that Implementation method : imageView.image = [[UIImage imageNamed: @&q ...

  4. iOS Remove the white background of the picture ( Close to white ), Or the replacement of other colors , Get the... Of pixels ARGB value

    iOS Remove the white background of the picture ( Close to white ), Or the replacement of other colors The method is as follows : // Remove the white background of the picture + (UIImage*) imageToTransparent:(UIImage*) image { / ...

  5. solve iOS in tabBarItem The default color of the picture ( Specify the code rendering mode to display as is mode )

    solve iOS in tabBarItem The default color of the picture ( Specify the code rendering mode to display as is mode ) terms of settlement : Specifies the rendering mode of the image (imageWithRenderingMode by :UIImageRende ...

  6. Change the color of the picture ,UIImage Color change

    Definition #import <UIKit/UIKit.h> @interface UIImage (ChangeImageColor) /** * Change the color of the picture * * @param tint ...

  7. iOS GIF Picture turn UIImage

    Multiple platforms keep the same style UI Design , Without the use of some dynamic pictures 1. Local GIF Images using 1.1 Will local GIF To NSdata type NSData *tempdata = [NSData dataWithCont ...

  8. iOS Development : Draw pixels to screen

    Reprint :https://segmentfault.com/a/1190000000390012 Translation notes : Although this article is relatively long , But the content is still valuable . How pixels are drawn on the screen ? Output data to the side of the screen ...

  9. Talk about iOS Decompression of pictures in

    original text For most iOS applications , Pictures are often one of the most memory intensive resources in mobile phones , It's also an integral part of . Load an image from disk , And finally it's on the screen , In fact, there are a series of complicated processes in the middle , And that includes the graph ...

Random recommendation

  1. Export from database to excel

    In the project Yangzhong News shenbaocreateall // Selected id string cc = Request["IDcheck"];            Response.C ...

  2. [4] Intelligent pointer boost::scoped_ptr

    [1]boost::scoped_ptr brief introduction boost::scoped_ptr Belong to boost library , It's defined in namespace boost in , Include header file #include <boost/scoped_ ...

  3. Samsung's original factory is K9K8G08U0D Upgrade to K9K8G08U0E In response to the letter

     1. please check the below timing first. K9F1G08U0E vs K9F1G08U0D Timing difference tR tPROG tBERS N ...

  4. mvc Storage Cookie And read Cookie Method

    mvc Storage Cookie And read Cookie Method : // Storage HttpCookie cookie = new HttpCookie("User"); System.Text.Encod ...

  5. 【java Design patterns 】 And builder (Builder) Pattern

    Let's take an example from the previous section : Make cars . In the previous section, we used the template method to control the movement of the car running , So the demand is endless , Now if the boss adds extra demand : The car starts . stop it . The whistle and engine sound are controlled by the customer himself , He can go in whatever order he wants ...

  6. Jquery Synchronous and asynchronous requests for

    1 Asynchronous requests :    1.1 $.ajax       $.ajax({                url : 'your url',                data:{name:valu ...

  7. 【WCF series 】( One ) Why do we need WCF

    Why do we need WCF Architecture analysis of traditional distributed software A development requirement : Social security platform The type of client with a large number of visits / More platforms interact with other systems, more rapid development / The deployment structure is complex (B/S.C/S. desktop . service …) Traditional implementation technology : The industry needs one ...

  8. MongoDB MapReduce Introduction of usage

    Map-Reduce part :Map-Reduce Equivalent to... In a relational database group by, It is mainly used for statistical data .MongoDB Provided Map-Reduce Very flexible , It is also quite practical for large-scale data analysis . grammar db ...

  9. RuntimeError: Model class app_anme.models.User doesn&#39;t declare an explicit app_label and isn&#39;t in an application in INSTALLED_APPS.---python Learning error records

    untimeError: Model class app_anme.models.User doesn't declare an explicit app_label and isn't in an ...

  10. Wechat hardware platform ( 7、 ... and ) Device control panel - Webpage sokect-mqtt A long connection

    Add our own control panel to wechat hardware devices . The main problem : 1 Make sure the connection is long , So the panel can interact with the devices in the underworld in real time ,http One time connection mode doesn't work . The panel must be web-based , Web pages can be operated interactively . no need APP And small program . 2 ...