图片(UIImage*) img
要截取的起始坐标sx:(int) sx1 sy:(int)sy1
要截取的长度和宽度sw:(int) sw1 sh:(int) sh1
最终要显示的坐标desx:(int) desx1 desy:(int)desy1
-(UIImage*)objectiveDrawRegion:(UIImage*) img sx:(int) sx1 sy:(int)sy1 sw:(int) sw1 sh:(int) sh1 desx:(int) desx1 desy:(int)desy1{
[self saveImage:img name:@"objectiveDrawRegion1.png"];
//创建图片缓冲
void *imageDataRegion=malloc(screenWidth*screenHeight*32);
CGColorSpaceRef iColorSpaceRegion=CGColorSpaceCreateDeviceRGB();
CGContextRef iDeviceRegion=CGBitmapContextCreate(imageDataRegion,screenWidth,screenHeight,8,4*screenWidth,iColorSpaceRegion,kCGImageAlphaPremultipliedLast);
//剪切区域
CGRect clipRegion=CGRectMake(sx1,sy1,sw1,sh1);
CGContextClipToRect(iDeviceRegion, clipRegion);
CGFloat widthf=img.size.width;
CGFloat heightf=img.size.height;
CGRect cg=CGRectMake(0.0, 0.0, widthf, heightf);
//画底图
CGContextDrawImage(iDeviceRegion,cg, img.CGImage);
//将缓冲形成图片
CGImageRef ioffRegion=CGBitmapContextCreateImage(iDeviceRegion);
CGRect cg1=CGRectMake(desx1, desy1, sw1, sh1);
UIImage *ui=[UIImage imageWithCGImage:ioffRegion];
CGContextDrawImage(当前context,cg1, ui.CGImage);
//清除缓冲
CGColorSpaceRelease(iColorSpaceRegion);
CGContextRelease(iDeviceRegion);
CGImageRelease(ioffRegion);
free(imageDataRegion);
// iDeviceRegion=NULL;
// imageDataRegion=0;
return ui;
}
分享一个大牛的人工智能教程。零基础!通俗易懂!风趣幽默!希望你也加入到人工智能的队伍中来!请点击http://www.captainbed.net/* * 每一趟从待排序的数据元素中选出最小(或最大)的一个元素, * 顺序放在已排好序的数列的最后,直到全部待排序的数据元素排完为止。 * 选择排序是不稳定的排序算法。 */namespace SelectionSort{ ...
报错本地测试环境k8s重启后,stateful set报错了# 报错信息MountVolume.NewMounter initialization failed for volume "pvc-61dedc85-ea5a-4ac7-aaf3-e072e2e46e18" : path "/var/openebs/local/pvc-61dedc85-ea5a-4ac7-aaf3-e072e2e46e18" does not exist原因观察到的现象就是本机的目录文件不存在,也就是docker里
1,参数定义 For MySQL row-based replication, this variable determines how row images are written to the binary log. 对于基于row模式的复制,binlog_row_image变量决定了images是如何写入到binlog日志文件的。 In MySQL row-based replication, each row change event contains two images, .
Global.asax 1 protected void Application_BeginRequest(object sender, EventArgs e) 2 { 3 //遍历Post参数,隐藏域除外 4 foreach (string i in this.Request.Form) 5 {...
目前由于iPhone手机的普及,其iPhone手机的出屏率也越来越高,但是由于iPhone手机本身知识产权的问题,导致所有想在iPhone手机上使用的App软件,都必须首先通过且只能通过苹果公司的“App Store”认证。但低端智能手机的问世,极大地促进了手机App的问世速度,从而导致一个无法回避的问题,那就是已经问世的App软件再通过“App Store”需要很长的时间周期,在此期...
推箱子Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6549 Accepted Submission(s): 1866Problem Description推箱子是一个很经典的游戏.今天我们来玩一个简
前段时间工作比较忙,博客也好长时间没有更新了!最近闲下来了,昨晚在mac 上装了一下数据库,中途也不是很顺利,决定在这里记录一下!废话不多说了,进入正题。1、去mysql 官网下载mysql (我下载的是最新版)安装过程不在过多叙述,百度上教程太多了,可以参考下边的连接https://www.cnblogs.com/chenmo-xpw/p/6102933.html有一点值得注意的是最新版...
引用其他项目做成的jar包后出现如下 LifecycleException : [2017-12-29 10:27:35,953] Artifact MonitoringService:war exploded: Artifact is being deployed, please ...
在eMMC协议接口当中,有自带的Boot功能,Boot模式分为两种,一种是Mandatory Boot,另一种是Alternative Boot一般的eMMC都会支持Mandatory Boot,但是是否支持Alternative Boot需要重看EXT CSD来确认,由于主要想说明两种Boot的操作流程和区别,在这里不赘述如何查看是否支持Boot和Boot参数配置Mandator
一、调用代码使APP进入后台,达到点击Home键的效果。(私有API) [[UIApplication sharedApplication] performSelector:@selector(suspend)];suspend的英文意思有:暂停; 悬; 挂; 延缓;二、带有中文的URL处理。大概举个例子,类似下面的URL,里面直接含有中文,可能导致播放不了,那么我们要处理
linux 下一般以 `.o`, `.so`, `.a`, `.la` 后缀的二进制文件,它们的工作原理,你知道吗?当得到一个二进制文件,要如何对其进行分析?可以直接盲目运行么?