未完成的控件

using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;namespace ImageControls
{/// <summary>/// 控件/// </summary> public class ShapeEx : Control{#region 字段private Color _BackColor; //背景颜色/// <summary>/// 必需的设计器变量。/// </summary>private Color _BorderColor; //边框颜色private Point _MouseLocation;private bool _ReSizeble; //是否可调整大小private int _SelectSelctedIndex; //0-8,0:SizeAllprivate int _SelfHeight;private Point _SelfLocation;private int _SelfWidth;private Rectangle _rectBottomSelector;private Rectangle _rectLeftBottomSelector;private Rectangle _rectLeftSelector;private Rectangle _rectLeftTopSelector;private Rectangle _rectRightBottomSelector;private Rectangle _rectRightSelector;private Rectangle _rectRightTopSelector;private Rectangle _rectTopSelector;private Container components;#region modify by anbyprivate float _ShapeExAngle; //控件的旋转角度private int _ShapeExIsFocus; //0表示没有获取焦点,1表示获取焦点#endregion#endregion#region 构造函数public ShapeEx(){// 该调用是 Windows.Forms 窗体设计器所必需的。
            InitializeComponent();}#endregion#region 属性[DefaultValue("Black"), Description("边框颜色"), Category("Appearance")]public Color BorderColor{get{// Insert code here.return _BorderColor;}set{_BorderColor = value;Invalidate();}}[Description("控件ID号,自增长"), Category("Appearance")]public int ShapeExControlID { get; set; }[Description("用于连接外部控件ID"), Category("Appearance")]public int ShapeExJoinID { get; set; }[DefaultValue("Control"), Description("背景颜色"), Category("Appearance")]public override Color BackColor{get{// Insert code here.return _BackColor;}set{_BackColor = value;Invalidate();}}[DefaultValue(false), Description("运行中控件大小是否可拖拽编辑"), Category("Behavior")]public bool ReSizeble{get{// Insert code here.return _ReSizeble;}set{_ReSizeble = value;Invalidate();}}[Description("控件选择区域"), Category("Behavior")]public Rectangle SelectRectangle{get{var selectRectangler = new Rectangle();selectRectangler.X = Location.X + 7;selectRectangler.Y = Location.Y + 7;selectRectangler.Height = Height - 15;selectRectangler.Width = Width - 15;return selectRectangler;}}/// <summary>/// 是否被获取焦点/// </summary>[Description("控件是否获取焦点"), Category("Focus")]public int ShapeExIsFocus{get { return _ShapeExIsFocus; }set { _ShapeExIsFocus = value; }}[Description("控件旋转角度"), Category("Angle")]public float ShapeExAngle{get { return _ShapeExAngle; }set{_ShapeExAngle = value;this.Invalidate();this.Visible = false;this.Visible = true;}}//CreateParamsprotected override CreateParams CreateParams{get{CreateParams cp = base.CreateParams;cp.ExStyle |= 0x00000020;return cp;}}#endregion#region 私有方法private void DrawSelector(Graphics graphics,Rectangle rect,Point[] Points) {//graphics.TranslateTransform(Pcenter.X, Pcenter.Y);//graphics.RotateTransform(_ShapeExAngle);////恢复绘图平面在水平和垂直方向的平移    rPoints[0]//graphics.TranslateTransform(-Pcenter.X, -Pcenter.Y);var SelectorPen = new SolidBrush(Color.White);var borderPen = new Pen(_BorderColor, 1);try{//实心Point[] LeftPoints = RPoints(getPoint(rect.X - 7, Height / 2 - 3, 6, 6));graphics.FillClosedCurve(SelectorPen, LeftPoints);Point[] TopPoints = RPoints(getPoint(Width / 2 - 3, rect.Y - 7, 6, 6));graphics.FillClosedCurve(SelectorPen, TopPoints);Point[] RightPoints = RPoints(getPoint(rect.X + rect.Width, Height / 2 - 3, 6, 6));graphics.FillClosedCurve(SelectorPen, RightPoints);Point[] BottomPoints = RPoints(getPoint(Width / 2 - 3, rect.Y + rect.Height, 6, 6));graphics.FillClosedCurve(SelectorPen, BottomPoints);Point[] LeftTopPoints = RPoints(getPoint(rect.X - 7, rect.Y - 7, 6, 6));graphics.FillClosedCurve(SelectorPen, LeftTopPoints);Point[] RightTopPoints =RPoints(getPoint(rect.X + rect.Width, rect.Y - 7, 6, 6));graphics.FillClosedCurve(SelectorPen, RightTopPoints);Point[] RightBottomPoints = RPoints(getPoint(rect.X + rect.Width, rect.Y + rect.Height, 6, 6));graphics.FillClosedCurve(SelectorPen, RightBottomPoints);Point[] LeftBottomPoints =  RPoints(getPoint(rect.X - 7, rect.Y + rect.Height, 6, 6));graphics.FillClosedCurve(SelectorPen, LeftBottomPoints);//边框_rectLeftSelector.X = rect.X-7;_rectLeftSelector.Y =Height/2-3;_rectLeftSelector.Height = 6;_rectLeftSelector.Width = 6;var leftRpoints = RPoints(getPoint(_rectLeftSelector.X, _rectLeftSelector.Y, 6, 6));graphics.DrawPolygon(borderPen, leftRpoints);_rectLeftSelector.X = leftRpoints[0].X;_rectLeftSelector.Y = leftRpoints[0].Y;//graphics.DrawRectangle(borderPen, _rectLeftSelector);
_rectTopSelector.X = Width/2 - 3;_rectTopSelector.Y =rect.Y-7;_rectTopSelector.Height = 6;_rectTopSelector.Width = 6;var topRpoints = RPoints(getPoint(_rectTopSelector.X, _rectTopSelector.Y, 6, 6));graphics.DrawPolygon(borderPen, topRpoints);_rectTopSelector.X = topRpoints[0].X;_rectTopSelector.Y = topRpoints[0].Y;//graphics.DrawRectangle(borderPen, _rectTopSelector);
_rectRightSelector.X = rect.X+rect.Width;_rectRightSelector.Y = Height/2-3;_rectRightSelector.Height = 6;_rectRightSelector.Width = 6;var rightRpoints = RPoints(getPoint(_rectRightSelector.X, _rectRightSelector.Y, 6, 6));graphics.DrawPolygon(borderPen, rightRpoints);_rectRightSelector.X = rightRpoints[0].X;_rectRightSelector.Y = rightRpoints[0].Y;//graphics.DrawRectangle(borderPen, _rectRightSelector);
_rectBottomSelector.X = Width/2-3;_rectBottomSelector.Y = rect.Y+rect.Height;_rectBottomSelector.Height = 6;_rectBottomSelector.Width = 6;var bottomRpoints = RPoints(getPoint(_rectBottomSelector.X, _rectBottomSelector.Y, 6, 6));graphics.DrawPolygon(borderPen, bottomRpoints);_rectBottomSelector.X = bottomRpoints[0].X;_rectBottomSelector.Y = bottomRpoints[0].Y;////graphics.DrawRectangle(borderPen, _rectBottomSelector);
_rectLeftTopSelector.X = rect.X-7;_rectLeftTopSelector.Y = rect.Y-7;_rectLeftTopSelector.Width = 6;_rectLeftTopSelector.Height = 6;var lefttopRpoints = RPoints(getPoint(_rectLeftTopSelector.X, _rectLeftTopSelector.Y, 6, 6));graphics.DrawPolygon(borderPen, lefttopRpoints);_rectLeftTopSelector.X = lefttopRpoints[0].X;_rectLeftTopSelector.Y = lefttopRpoints[0].Y;//graphics.DrawRectangle(borderPen, _rectLeftTopSelector);
_rectRightTopSelector.X = rect.X+rect.Width;_rectRightTopSelector.Y = rect.Y-7;_rectRightTopSelector.Width = 6;_rectRightTopSelector.Height = 6;var righttopRpoints= RPoints(getPoint(_rectRightTopSelector.X, _rectRightTopSelector.Y, 6, 6));graphics.DrawPolygon(borderPen, righttopRpoints);_rectRightTopSelector.X = righttopRpoints[0].X;_rectRightTopSelector.Y = righttopRpoints[0].Y;//graphics.DrawRectangle(borderPen, _rectRightTopSelector);
_rectRightBottomSelector.X = rect.X + rect.Width;_rectRightBottomSelector.Y = rect.Y+rect.Height;_rectRightBottomSelector.Width = 6;_rectRightBottomSelector.Height = 6;var rightbottomRpoints = RPoints(getPoint(_rectRightBottomSelector.X, _rectRightBottomSelector.Y, 6, 6));graphics.DrawPolygon(borderPen, rightbottomRpoints);_rectRightBottomSelector.X = rightbottomRpoints[0].X;_rectRightBottomSelector.Y = rightbottomRpoints[0].Y;//graphics.DrawRectangle(borderPen, _rectRightBottomSelector);
_rectLeftBottomSelector.X = rect.X-7;_rectLeftBottomSelector.Y = rect.Y + rect.Height;_rectLeftBottomSelector.Width = 6;_rectLeftBottomSelector.Height = 6;var leftbottompointRPoints =  RPoints(getPoint(_rectLeftBottomSelector.X, _rectLeftBottomSelector.Y, 6, 6));graphics.DrawPolygon(borderPen,leftbottompointRPoints);_rectLeftBottomSelector.X = leftbottompointRPoints[0].X;_rectLeftBottomSelector.Y = leftbottompointRPoints[0].Y;//graphics.DrawRectangle(borderPen, _rectLeftBottomSelector);
}catch (Exception E){throw E;}finally{SelectorPen.Dispose();borderPen.Dispose();}}public PointF Pcenter = new PointF();public Point[] rPoints = null;private PointF center = new PointF();private void ReDrawControl(Graphics graphics){try{var borderPen = new Pen(_BorderColor, 1);//绘制边框    var rectBorder = new Rectangle();rectBorder.X = 7;rectBorder.Y = 7;rectBorder.Height = Height - 15;rectBorder.Width = Width - 15;center = new PointF(this.Width/2, this.Height/2);//算出要平移的坐标Point RationPoint = new Point((int)(center.X - rectBorder.Width / 2), (int)(center.Y - rectBorder.Height / 2));//要绘制的矩形var picRect = new RectangleF(RationPoint.X, RationPoint.Y, (float)rectBorder.Width, (float)rectBorder.Height);//圆心坐标Pcenter = new PointF(picRect.X + picRect.Width/2, picRect.Y + picRect.Height/2);#region 最后修改PointF leftToppoint = new PointF(picRect.X,picRect.Y);PointF leftBottompoint = new PointF(picRect.X, (picRect.Y + picRect.Height));PointF rightToppoint = new PointF((picRect.X + picRect.Width), picRect.Y);PointF rightBottompoint = new PointF((picRect.X + picRect.Width), (picRect.Y + picRect.Height));rPoints = RPoints(Point.Ceiling(leftToppoint),Point.Ceiling(rightToppoint), Point.Ceiling(rightBottompoint), Point.Ceiling(leftBottompoint));RectangleF controlRect = new RectangleF(this.Location.X, this.Location.Y, this.Width, this.Height);getNewRectangle(rPoints);graphics.DrawPolygon(borderPen, rPoints);#endregion#region 旋转内,但是无法获取旋转后的坐标,程序失控// //绘图平面以图片的中心点旋转//graphics.TranslateTransform(Pcenter.X, Pcenter.Y);//graphics.RotateTransform(_ShapeExAngle);////恢复绘图平面在水平和垂直方向的平移//graphics.TranslateTransform(-Pcenter.X, -Pcenter.Y);//绘制图片//graphics.DrawRectangle(borderPen, Rectangle.Ceiling(picRect));//重置绘图平面的所有变换//graphics.ResetTransform();#endregion#region 图片旋转 图片超出边界////圆心坐标//var center = new PointF(rectBorder.Width/2, rectBorder.Height/2);////矩形左上坐标//float offsetX = 0;//float offsetY = 0;//offsetX = center.X - rectBorder.Width/2;//offsetY = center.Y - rectBorder.Height/2;////要画的图//var picRect = new RectangleF(offsetX, offsetY, rectBorder.Width, rectBorder.Height);//var Pcenter = new PointF(picRect.X + picRect.Width/2, picRect.Y + picRect.Height/2);////让图片绕中心旋转一周////for (int i = 0; i < 361; i += 10)
                ////{//var changeRect = new Rectangle((int) picRect.X, (int) picRect.Y, (int) picRect.Width,//                               (int) picRect.Height);////绘图平面以图片的中心点旋转//graphics.TranslateTransform(Pcenter.X, Pcenter.Y);//graphics.RotateTransform(_ShapeExAngle);////恢复绘图平面在水平和垂直方向的平移//graphics.TranslateTransform(-Pcenter.X, -Pcenter.Y);////绘制图片并延时//graphics.DrawRectangle(borderPen, changeRect);////重置绘图平面的所有变换//graphics.ResetTransform();////}#endregion//绘制编辑框if (_ReSizeble){DrawSelector(graphics,Rectangle.Ceiling(picRect),rPoints);}}catch (Exception E){throw E;}finally{graphics.Dispose();}}/// <summary>/// 根据数组坐标获取新的矩形/// </summary>/// <param name="rPoints"></param>private void getNewRectangle(Point[] rPoints){try{int maxCoorX = getPointCoorX(rPoints, true);int minCoorX = getPointCoorX(rPoints, false);int maxCoorY = getPointCoorY(rPoints, true);int minCoorY = getPointCoorY(rPoints, false);//获得width和heightdouble width = Math.Sqrt(maxCoorX*maxCoorX + minCoorX*minCoorX);double height = Math.Sqrt(maxCoorY*maxCoorY + minCoorY*minCoorY);_SelfWidth = (int) width;_SelfHeight   = (int) height;}catch (Exception){}}private PointF[] getPointF(int x, int y, int Width, int Height){var point1 = new PointF(x, y);var point2 = new PointF(x + Width, y);var point3 = new PointF(x + Width, y + Height);var point4 = new PointF(x, y + Height);PointF[] points = {point1, point2, point3, point4};return points;}private Point[] getPoint(int x, int y, int Width, int Height){ var point1 = new Point(x, y);var point2 = new Point(x + Width, y);var point3 = new Point(x + Width, y + Height);var point4 = new Point(x, y + Height);Point[] points = { point1, point2, point3, point4 };return points;}protected override void Dispose(bool disposing){if (disposing){if (components != null)components.Dispose();}base.Dispose(disposing);}#endregion#region 组件设计器生成的代码private void InitializeComponent(){components = new Container();Resize += ShapeEx_Resize;MouseDown += ShapeEx_MouseDown;MouseMove += ShapeEx_MouseMove;MouseLeave += ShapeEx_MouseLeave;MouseUp += ShapeEx_MouseUp;//this.GotFocus += new EventHandler(ShapeEx_GotFocus);//this.LostFocus += new EventHandler(ShapeEx_LostFocus);        
_ShapeExAngle = 30;_BorderColor = Color.Black;_BackColor = Color.FromName("Control");_ReSizeble = false;_SelectSelctedIndex = -1;SetStyle(ControlStyles.SupportsTransparentBackColor| ControlStyles.UserPaint| ControlStyles.AllPaintingInWmPaint| ControlStyles.Opaque, true);BackColor = Color.Transparent;}#endregion#region 事件protected override void OnPaint(PaintEventArgs pe){base.OnPaint(pe);ReDrawControl(pe.Graphics);}private void ShapeEx_Resize(object sender, EventArgs e){if (Width < 16 || Height < 16){Width = 16;Height = 16;}Invalidate();}private void ShapeEx_MouseDown(object sender, MouseEventArgs e){_ShapeExIsFocus = 1;if (_ReSizeble){if (_rectLeftSelector.Contains(e.X, e.Y) ||_rectRightSelector.Contains(e.X, e.Y) ||_rectTopSelector.Contains(e.X, e.Y) ||_rectBottomSelector.Contains(e.X, e.Y) ||_rectLeftTopSelector.Contains(e.X, e.Y) ||_rectRightTopSelector.Contains(e.X, e.Y) ||_rectRightBottomSelector.Contains(e.X, e.Y) ||_rectLeftBottomSelector.Contains(e.X, e.Y)){if (_rectLeftTopSelector.Contains(e.X, e.Y)){Cursor = Cursors.SizeNWSE;_SelectSelctedIndex = 1;}if (_rectTopSelector.Contains(e.X, e.Y)){Cursor = Cursors.SizeNS;_SelectSelctedIndex = 2;}if (_rectRightTopSelector.Contains(e.X, e.Y)){Cursor = Cursors.SizeNESW;_SelectSelctedIndex = 3;}if (_rectRightSelector.Contains(e.X, e.Y)){Cursor = Cursors.SizeWE;_SelectSelctedIndex = 4;}if (_rectRightBottomSelector.Contains(e.X, e.Y)){Cursor = Cursors.SizeNWSE;_SelectSelctedIndex = 5;}if (_rectBottomSelector.Contains(e.X, e.Y)){Cursor = Cursors.SizeNS;_SelectSelctedIndex = 6;}if (_rectLeftBottomSelector.Contains(e.X, e.Y)){Cursor = Cursors.SizeNESW;_SelectSelctedIndex = 7;}if (_rectLeftSelector.Contains(e.X, e.Y)){Cursor = Cursors.SizeWE;_SelectSelctedIndex = 8;}}else{Cursor = Cursors.SizeAll;_SelectSelctedIndex = 0;}_SelfLocation.X = Location.X;_SelfLocation.Y = Location.Y;_MouseLocation.X = Cursor.Position.X;_MouseLocation.Y = Cursor.Position.Y;_SelfWidth = Width;_SelfHeight = Height;}}private void ShapeEx_MouseMove(object sender, MouseEventArgs e){//move and resizeswitch (_SelectSelctedIndex){case 0:Location = new Point(Cursor.Position.X - (_MouseLocation.X - _SelfLocation.X),Cursor.Position.Y - (_MouseLocation.Y - _SelfLocation.Y));break;case 1:Height = _SelfHeight - (Cursor.Position.Y - _MouseLocation.Y);Width = _SelfWidth - (Cursor.Position.X - _MouseLocation.X);Location = new Point(Cursor.Position.X - _MouseLocation.X + _SelfLocation.X,Cursor.Position.Y - _MouseLocation.Y + _SelfLocation.Y);break;case 2:Height = _SelfHeight - (Cursor.Position.Y - _MouseLocation.Y);Location = new Point(_SelfLocation.X, Cursor.Position.Y - _MouseLocation.Y + _SelfLocation.Y);break;case 3:Height = _SelfHeight - (Cursor.Position.Y - _MouseLocation.Y);Width = _SelfWidth + (Cursor.Position.X - _MouseLocation.X);Location = new Point(_SelfLocation.X, Cursor.Position.Y - (_MouseLocation.Y - _SelfLocation.Y));break;case 4:Width = _SelfWidth + (Cursor.Position.X - _MouseLocation.X);break;case 5:Height = _SelfHeight + (Cursor.Position.Y - _MouseLocation.Y);Width = _SelfWidth + (Cursor.Position.X - _MouseLocation.X);break;case 6:Height = _SelfHeight + (Cursor.Position.Y - _MouseLocation.Y);break;case 7:Height = _SelfHeight + (Cursor.Position.Y - _MouseLocation.Y);Width = _SelfWidth - (Cursor.Position.X - _MouseLocation.X);Location = new Point(Cursor.Position.X - _MouseLocation.X + _SelfLocation.X, _SelfLocation.Y);break;case 8:Width = _SelfWidth - (Cursor.Position.X - _MouseLocation.X);Location = new Point(Cursor.Position.X - _MouseLocation.X + _SelfLocation.X, _SelfLocation.Y);break;}Invalidate();}private void ShapeEx_MouseLeave(object sender, EventArgs e){Cursor = Cursors.Default;_SelectSelctedIndex = -1;}private void ShapeEx_MouseUp(object sender, MouseEventArgs e){_ShapeExIsFocus = 0;Cursor = Cursors.Default;_SelectSelctedIndex = -1;}/// <summary>/// 用于减少画面闪烁效果及刷新控件/// </summary>/// <param name="e"></param>protected override void OnLocationChanged(EventArgs e){Visible = false;Visible = true;}#endregion/// <summary>  /// 对一个坐标点按照一个中心进行旋转  /// </summary>  /// <param name="center">中心点</param>  /// <param name="p1">要旋转的点</param>  /// <param name="angle">旋转角度,笛卡尔直角坐标</param>  /// <returns></returns>  private Point PointRotate(Point center, Point p1, double angle){Point tmp = new Point();double angleHude = angle * Math.PI / 180;/*角度变成弧度*/double x1 = (p1.X - center.X) * Math.Cos(angleHude) + (p1.Y - center.Y) * Math.Sin(angleHude) + center.X;double y1 = -(p1.X - center.X) * Math.Sin(angleHude) + (p1.Y - center.Y) * Math.Cos(angleHude) + center.Y;tmp.X = (int)x1;tmp.Y = (int)y1;return tmp;}/// <summary>/// 根据rectangle的4个顶点获取旋转后的坐标/// </summary>/// <param name="leftToppoint">左上角坐标</param>/// <param name="leftBottompoint">左下脚坐标</param>/// <param name="rightToppoint">右上角坐标</param>/// <param name="rightBottompoint">右下角坐标</param>/// <returns>旋转后的4点坐标</returns>private Point[] RPoints(Point leftToppoint, Point rightToppoint, Point rightBottompoint, Point leftBottompoint){//旋转后的点Point rationleftToppoint = PointRotate(Point.Ceiling(Pcenter), leftToppoint, _ShapeExAngle);Point rationleftBottompoint = PointRotate(Point.Ceiling(Pcenter), leftBottompoint, _ShapeExAngle);Point rationrightToppoint = PointRotate(Point.Ceiling(Pcenter), rightToppoint, _ShapeExAngle);Point rationrightBottompoint = PointRotate(Point.Ceiling(Pcenter), rightBottompoint, _ShapeExAngle);Point[] rPoints ={rationleftToppoint, rationrightToppoint, rationrightBottompoint, rationleftBottompoint};return rPoints;}/// <summary>/// 根据rectangle的4个顶点获取旋转后的坐标/// </summary>/// <param name="points">左上角坐标,左下脚坐标,右上角坐标,右下角坐标 </param>/// <returns>旋转后的4点坐标</returns>private Point[] RPoints(Point[] points){//旋转后的点 Point rationleftToppoint = PointRotate(Point.Ceiling(Pcenter), points[0], _ShapeExAngle);Point rationrightToppoint = PointRotate(Point.Ceiling(Pcenter), points[1], _ShapeExAngle);Point rationrightBottompoint = PointRotate(Point.Ceiling(Pcenter), points[2], _ShapeExAngle);Point rationleftBottompoint = PointRotate(Point.Ceiling(Pcenter), points[3], _ShapeExAngle);Point[] rPoints ={rationleftToppoint, rationrightToppoint, rationrightBottompoint, rationleftBottompoint};return rPoints;}private int getPointCoorX (Point[] arr,bool isMax){if (arr == null){throw new Exception();}int max = 0;int[] myarr = new int[5];for (int i = 0; i < arr.Length - 1; i++){myarr[i] = arr[i].X;}Array.Sort(myarr);if (isMax){return myarr[myarr.Length - 1];}else{return myarr[0];}}private int getPointCoorY(Point[] arr,bool isMax){if (arr == null){throw new Exception();}int max = 0;int[] myarr = new int[5];for (int i = 0; i < arr.Length - 1; i++){myarr[i] = arr[i].Y;}Array.Sort(myarr);if (isMax){return myarr[myarr.Length - 1];}else{return myarr[0];}}}}
View Code

 

转载于:https://www.cnblogs.com/anbylau2130/p/3174034.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/274166.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ux设计_UX设计101:

ux设计这是什么&#xff1f; (What is this?) This session is part of a learning curriculum that I designed to incrementally skill up and empower a team of Designers and Researchers whose skillset and ways of working needed to evolve to keep up with changes …

idea重要插件代码颜色_颜色在您的网站上的重要性和品牌形象

idea重要插件代码颜色Choosing the right colors for a website or a logo can be a perplexing and time-consuming task, unless you have the right knowledge of colors. Colors play a pivotal role in the success of some businesses and can make a huge impact on the…

【自己给自己题目做】之一:椭圆可点击区域

【题一】请实现以下需求&#xff0c;要做一个活动页面&#xff0c;页面上有一张图片&#xff08;假设是800x600&#xff09;&#xff0c;图片正中心有一个椭圆形的可点击区域&#xff0c;假设椭圆长轴为200px&#xff08;横向&#xff09;&#xff0c;短轴160px&#xff08;纵向…

信息保真度准则_设计保真度的新的非科学公式

信息保真度准则As designers, our audience is more than just our users. We keep our user’s needs top of mind while designing for their jobs-to-be-done, but sometimes we need to illustrate the problem and articulate solutions to a broader audience: our cross…

zend studio配置调试(Xdebug方式)

1.下载xdebug http://xdebug.org/download.php 我下的是PHP 5.4 VC9 (32 bit) 【当前系统php是php5.4.14(win32)版本】 2.配置php.ini 在文件最后配置 [Xdebug]zend_extension "C:/php5.4.14/ext/php_xdebug-2.2.3-5.4-vc9.dll" xdebug.auto_trace1xdebug.collect_p…

人物肖像速写_肖像学的基础

人物肖像速写More in the iconography series:• 7 Principles of Icon Design• 5 Ways to Create a Settings Icon• Icon Grids & Keylines Demystified• Pixel-Snapping in Icon Design• 3 Classic Icon FamiliesAn icon is a compact symbol that represents a disc…

产品设计的Kawaiization

重点 (Top highlight)在过去的一两年中&#xff0c;我注意到品牌和产品设计中出现了某种风格。 (Over the last year or two, I’ve noticed a certain style emerge in brand and product design.) (this article originally appeared on DESK magazine)(本文最初出现在DESK杂…

陌生人社会_陌生人之旅

陌生人社会The Last of Us Part II is a game that is deeply invested in the minutiae of its characters. The pain they cause, the things that drive them, and the particularities of their self-destruction and salvation. The game’s commitment to the true natur…

java数据类型及其说明

Java数据类型及其说明java基本数据类型&#xff1a; java数据类型分为基本数据类型和引用数据类型&#xff0c;基本数据类型就是4类8种&#xff0c;分为数值类型&#xff08;整数型[byte&#xff0c;short&#xff0c;int&#xff0c;long]&#xff09;&#xff0c;字符型&…

根据图片获得配色方案_配色系列(1)—从图片中获得配色灵感

根据图片获得配色方案前言 (Foreword) When we start designing mobile web pages, we always need to determine the color scheme of the web page first. Well, at this time, unless the customer proposes a color scheme, most of the situations we have to face is to …

七大查找算法

1. 顺序查找2. 二分查找3. 插值查找4. 斐波那契查找5. 树表查找6. 分块查找7. 哈希查找 查找是在大量的信息中寻找一个特定的信息元素&#xff0c;在计算机应用中&#xff0c;查找是常用的基本运算&#xff0c;例如编译程序中符号表的查找。本文简单概括性的介绍了常见的七种查…

HA2795Billboard 可用线段树

#include<iostream>using namespace std;#include<cstdio>#include<algorithm>#define maxn 200005int h,n,w;int root[maxn<<4];int ans;//标记void make_tree(int l,int r,int rt){if(lr){root[rt]w;return ;}int mid(rl)/2;make_tree(l,mid,rt*2);m…

axure下拉列表框单选框_如何在Axure中创建下拉菜单和组合框

axure下拉列表框单选框First, let’s clarify what exactly is a dropdown menu, and what is a combo box, aren’t they the same? Well … no, not really, let me explain.首先&#xff0c;让我们弄清楚什么是下拉菜单&#xff0c;什么是组合框&#xff0c;不是吗&#xf…

Android 第一课 Activity

以下说明基于Android Studio&#xff0c;简称AS。&#xff08;红色字体为自行添加&#xff0c;注在醒目&#xff09; 具体包括&#xff1a;创建活动创建项目 加载布局 在AndroidManifest文件中注册 活动中使用&#xff08;提醒&#xff09;Toast 在活动使用&#xff08;菜…

figma设计_一种在Figma中跟踪设计迭代的简单方法

figma设计As designers, telling a good story is always part of the job. A great story engages the client with the journey of decision making; it shows your team the breadth and depth of the exploration; it also encourages us to reflect on our own design pro…

latex 插图 上下放_专辑插图中上下文中的文本

latex 插图 上下放Especially if, like me, you’re not properly educated in the world of visual design, typography, and all those other things that a formal education can bring. We’re kind of playing around until something fits right, and doesn’t feel jarr…

视觉感知_产品设计中的视觉感知

视觉感知The role of the UX designer has evolved immensely over time, but at its core, it remains the same- UX设计人员的角色随着时间的流逝而发生了巨大的变化&#xff0c;但从本质上讲&#xff0c;它保持不变- to deliver information to users in an effective mann…

pb 插入报列在此处不_获取有关[在此处插入问题]的事实

pb 插入报列在此处不Twitter’s recent move to put notices on tweets themselves is one of the most controversial social media features during our times. As a design technologist, I can’t help but wonder the decision-making process behind it. It’s a perfect…

设计模式_单实体模式

Singleton 三要素&#xff1a;private 构造函数、 public 静态方法、 public 静态变量 单实例模式的三种线程安全实现方式&#xff08;&#xff23;&#xff0b;&#xff0b;&#xff09; &#xff11; 懒汉模式&#xff1a;即第一次调用该类实例的时候才产生一个新的该类实例…

c++编写托管dll_教程:如何编写简单的网站并免费托管

c编写托管dll本教程适用于谁&#xff1f; (Who is this tutorial for?) This tutorial assumes no prior knowledge and is suitable for complete beginners as a first project 本教程假定您没有先验知识&#xff0c;并且适合初学者作为第一个项目 您将需要什么 (What you w…