当前位置:网站首页>Gets the color of a point
Gets the color of a point
2022-04-22 23:53:00 【~Abandoned memories】
@implementation UIView (****)
/** Get the color of a point */
- (UIColor *)colorWithPoint:(CGPoint)point
{
unsigned char pixel[4] = {
0};
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef context = CGBitmapContextCreate(pixel, 1, 1, 8, 4, colorSpace, (CGBitmapInfo)kCGImageAlphaPremultipliedLast);
CGContextTranslateCTM(context, -point.x, -point.y);
[self.layer renderInContext:context];
CGContextRelease(context);
CGColorSpaceRelease(colorSpace);
return [UIColor colorWithRed:pixel[0]/255.0 green:pixel[1]/255.0 blue:pixel[2]/255.0 alpha:pixel[3]/255.0];
}
@end
版权声明
本文为[~Abandoned memories]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204222352443293.html
边栏推荐
- FPGA(四)数字IC面试的四个基本问题
- [leetcode] binary tree, in-depth understanding of the first, middle and last order
- 人们对于产业互联网的认识越来越清晰,越来越接近产业互联网
- 选中所有的文字
- Basic use of redis
- [annual summary] carry forward the past and forge ahead into the future: look back on the unreliable 2021 and hope for the reliable 2022
- [perseverance challenge] PCIe daily question and answer (table of contents)
- xpath定位
- Share two recent classic OJ questions (arrange subsequences + find the longest continuous number string in the string)
- websoket封装版 参数配置化 开箱即用
猜你喜欢
![[dvcon2020] acceleration of low power design level verification based on signoff abstract model](/img/c1/3495627bf41f5ba8b06d624831e6d8.png)
[dvcon2020] acceleration of low power design level verification based on signoff abstract model

grid_ Map (6): grid mapping in ROS compilation run

微信小程序页面跳转

Detailed explanation of MySQL index
![[turtle confession collection]](/img/81/b4bacc23691e58e403f1330d0ca7cf.jpg)
[turtle confession collection] "the moon at the bottom of the sea is the moon in the sky, and the person in front of us is the sweetheart." More joy and peace for the rest of your life ~ (with 3 sourc
![[VMware] VMware esxi 6.7 installation](/img/c2/5d9c55bc0931ed7c87a9e3e5f7f15f.png)
[VMware] VMware esxi 6.7 installation

Install vs2017 plug-in glsl language integration V0 under Windows 7 10.120. Vsix reported an error: Microsoft visualc. redist. twelve

Redis的基本使用

Conjugate gradients (3)

stm32f103 独立看门狗
随机推荐
在windows7下安装vs2017插件 GLSL language integration v0.10.120.vsix报错:microsoft.visualc.redist.12
北京航空航天大学开通CnOpenData试用
Bonner ultrasonic sensor t30uxda
条件判断(whilec循环&for&switch循环&if-else判断)
[*CTF2022]web题目复现及wp
Django创建表结构及对数据库增删改查
Method of shrinking master-slave nodes in redis cluster cluster
项目实训-小鬼僵尸
PCIe reference clock architecture
Vs write assembly
Project training - Kid zombie
彻底解决Failed to execute goal on project xxxxx
Online fox U3D client game configuration loading failed couldn't connect to server
JUC 全套(1)
LabVIEW controls computer shutdown, hibernation, logout and restart
分享两道最近做的比较经典的OJ题(排列子序列+字符串中找出连续最长的数字串)
[* ctf2022] Web Topic reproduction and WP
Common operations of PIL Library in deep learning
[perseverance challenge] PCIe asks and answers every day (2022.04 in progress)
[newcoder] week 20220422