rect

tracking.js实现前端人脸识别

喜夏-厌秋 提交于 2019-12-06 11:48:24
1.下载 https://trackingjs.com/ 2.运行例子 纳总一下 发现效果 里面的代码为 <!doctype html> <html> <head> <meta charset="utf-8"> <title>tracking.js - face hello world</title> <link rel="stylesheet" href="assets/demo.css"> <script src="build/tracking-min.js"></script> <script src="build/data/face-min.js"></script> <script src="build/data/eye-min.js"></script> <script src="build/data/mouth-min.js"></script> <style> .rect { border: 2px solid #a64ceb; left: -1000px; position: absolute; top: -1000px; } #img { position: absolute; top: 50%; left: 50%; margin: -173px 0 0 -300px; } </style> </head> <body> <!-- <div class=

Android Canvas绘图详解(图文)

本秂侑毒 提交于 2019-12-06 10:25:28
Android中使用图形处理引擎,2D部分是android SDK内部自己提供,3D部分是用Open GL ES 1.0。今天我们主要要了解的是2D相关的,如果你想看3D的话那么可以跳过这篇文章。 大 部分2D使用的api都在android.graphics和android.graphics.drawable包中。他们提供了图形处理相关的: Canvas、ColorFilter、Point(点)和RetcF(矩形)等,还有一些动画相关的:AnimationDrawable、 BitmapDrawable和TransitionDrawable等。以图形处理来说,我们最常用到的就是在一个View上画一些图片、形状或者自定 义的文本内容,这里我们都是使用Canvas来实现的。你可以获取View中的Canvas对象,绘制一些自定义形状,然后调用View. invalidate方法让View重新刷新,然后绘制一个新的形状,这样达到2D动画效果。下面我们就主要来了解下Canvas的使用方法。 Canvas对象的获取方式有两种:一种我们通过重写View.onDraw方法,View中的Canvas对象会被当做参数传递过来,我们操作这个Canvas,效果会直接反应在View中。另一种就是当你想创建一个Canvas对象时使用的方法: 1 2 Bitmap b = Bitmap.createBitmap

MFC 画字体DrawText()或TextOut(),CFont字体样式类

我的未来我决定 提交于 2019-12-06 04:32:51
新建单个文档的MFC应用程序,类视图——View项的属性——消息,WM_PAINT,创建OnPaint()函数 void CMFCApplication27View::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: 在此处添加消息处理程序代码 CRect rect; this->GetClientRect(&rect);//获取客户区大小 CFont font;//用来设置大小、样式,颜色用dc.SetTextColor设置 font.CreatePointFont(200, TEXT("Arial"));//20号字 dc.SelectObject(&font); //-------------------- 矩形框偏移,阴影效果 -------------------------------------// dc.SetBkMode(TRANSPARENT);//透明,否则新的遮住旧的 rect.OffsetRect(20, 20);//右、下偏移20 dc.SetTextColor(RGB(192, 192, 192));//灰色 dc.DrawText(TEXT("DrawText画文本"), &rect, DT_SINGLELINE | DT_CENTER | DT

MFC 画笔CPen、画刷CBrush

断了今生、忘了曾经 提交于 2019-12-06 04:26:59
新建单个文档的MFC应用程序,类视图——View项的属性——消息,WM_PAINT,创建OnPaint()函数 dc默认有一个画笔(实心1像素宽黑线)。 CPen画笔 非实心线像素宽必须为1 ,否则膨胀接到一起,与实心线没有差异。 CBrush画刷,用来填充封闭区域,默认白色填充。 void CMFCApplication27View::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: 在此处添加消息处理程序代码 //-------------------- 画笔创建方式一 -------------------------------------// CPen pen(PS_SOLID, 6, RGB(255, 0, 0));//创建画笔,实心线、6像素宽、红色 dc.SelectObject(&pen); //选择此画笔 CRect rect; this->GetClientRect(&rect);//获取客户区大小 dc.MoveTo(10, 10);//起始点 dc.LineTo(rect.Width() - 10, 10);//终点 //-------------------- 画笔创建方式二 -------------------------------------// CPen

KineticJS: right click fires click

℡╲_俬逩灬. 提交于 2019-12-06 04:05:15
I'm using Kineticjs and I'm defining a rect event like this this.rect.on('click tap', function(){ foo(); }); The event is fired when I left-click, but also when right-click. How can I avoid to fire this event with right-click? (I can't disabled the right-click in the page because I want to open a context menu if I rightclick over the rect) Thank you You need to filter out right mouse click this.rect.on('click tap', function(e){ // 1:left, 2: middle, 3: right, for IE 8, e.button != 2 if (e.which != 3) { foo(); } } 来源: https://stackoverflow.com/questions/15039915/kineticjs-right-click-fires

DPI aware and Rect

孤街浪徒 提交于 2019-12-06 03:53:21
问题 I got a small problem which I can't seem to find the answer of. I have a application that gets certain processes and gets the window size of it. Only the problem is it takes a percentage of the actual screen size (which the user sees). I want to make a screenshot of the application, but if I use the Rect of the window I get a smaller screen than it is, because the resolotion is 125%. This means my original resolution which gets outputted ( 1280 * 800 ) is smaller then my screen resolution (

Looking for a non “brute force” algorithm to remove intersecting areas of a collection of Rects

拟墨画扇 提交于 2019-12-06 03:11:06
问题 I have an n-sized collection of Rects, most of which intersect each other. I'd like to remove the intersections and reduce the intersecting Rects into smaller non-intersecting rects. I could easily brute force a solution, but I'm looking for an efficient algorithm. Here's a visualization: Original: Processed: Ideally the method signature would look like this: public static List<RectF> resolveIntersection(List<RectF> rects); the output would be greater or equal to the input, where the output

实现输入界面适应键盘的显示和隐藏事件

久未见 提交于 2019-12-06 02:01:17
方法一、设置activity的windowSoftInputMode属性 在AndroidManifest配置activity的 windowSoftInputMode为“ adjustResize ”,一般能解决问题。 其他取值说明: "stateUnspecified" 软键盘的状态(是否它是隐藏或可见)没有被指定。系统将选择一个合适的状态或依赖于主题的设置。这个是为了软件盘行为默认的设置。 "stateUnchanged" 软键盘被保持无论它上次是什么状态,是否可见或隐藏,当主窗口出现在前面时。 "stateHidden" 当用户选择该Activity时,软键盘被隐藏——也就是,当用户确定导航到该Activity时,而不是返回到它由于离开另一个Activity。 "stateAlwaysHidden" 软键盘总是被隐藏的,当该Activity主窗口获取焦点时。 "stateVisible" 软键盘是可见的,当那个是正常合适的时(当用户导航到Activity主窗口时)。 "stateAlwaysVisible" 当用户选择这个Activity时,软键盘是可见的——也就是,也就是,当用户确定导航到该Activity时,而不是返回到它由于离开另一个Activity。 "adjustUnspecified" 它不被指定是否该Activity主窗口调整大小以便留出软键盘的空间

Canvas实用库Fabric.js使用手册

一曲冷凌霜 提交于 2019-12-05 23:17:01
简介什么是Fabric.js? Fabric.js是一个可以简化Canvas程序编写的库。 Fabric.js为Canvas提供所缺少的对象模型, svg parser, 交互和一整套其他不可或缺的工具。由于Fabric.js为国外框架,官方API杂乱繁多,相关文档大多为英文文档,而且数量不多,所以本文旨在帮助新手在项目中快速上手Fabric.js,享受绘制Canvas的过程。 为什么要使用Fabric.js? Canvas提供一个好的画布能力, 但是Api不够友好。绘制简单图形其实还可以, 不过做一些复杂的图形绘制, 编写一些复杂的效果,就不是那么方便了。Fabric.js就是为此而开发,它主要就是用对象的方式去编写代码。 Fabric.js能做的事情 在Canvas上创建、填充图形(包括图片、文字、规则图形和复杂路径组成图形)。 给图形填充渐变颜色。 组合图形(包括组合图形、图形文字、图片等)。 设置图形动画集用户交互。 生成JSON, SVG数据等。 生成Canvas对象自带拖拉拽功能。 起步 Vue项目中引入Fabric.js 假设您的项目中正在使用ES6和Webpack,您可以开始使用Fabric.js,如下所示: 1、在命令行中: ? 1 npm install fabric(或yarn add fabric) 2、将其引入 .vue 文件中 ? 1 import {

减少HTTP请求的方式

允我心安 提交于 2019-12-05 15:34:26
1. 图片地图 缺点:坐标难定义;除了矩形之外几乎无法定义其他形状;通过DHTML(动态DOM操作)创建的图片地图在 IE 不兼容 <img usemap="#map1" border=0 src="/images/imagemap.gif?t=1574692303"> <map name="map1"> <area shape="rect" coords="0,0,31,31" href="javascript:alert('Home')" title="Home"> <area shape="rect" coords="36,0,66,31" href="javascript:alert('Gifts')" title="Gifts"> <area shape="rect" coords="71,0,101,31" href="javascript:alert('Cart')" title="Cart"> <area shape="rect" coords="106,0,136,31" href="javascript:alert('Settings')" title="Settings"> <area shape="rect" coords="141,0,171,31" href="javascript:alert('Help')" title="Help"> </map>