drawRect方法的官方API文档描述

drawRect
public void drawRect(int x,
int y,
int width,
int height)
Draws the outline of the specified rectangle. The left and right edges of the rectangle are at x and x + width. The top and bottom edges are at y and y + height. The rectangle is drawn using the graphics context's current color.
Parameters:
x - the x coordinate of the rectangle to be drawn.
y - the y coordinate of the rectangle to be drawn.
width - the width of the rectangle to be drawn.
height - the height of the rectangle to be drawn.

width和height的描述是错误的。

实践告诉我们,width,height参数应该是右下角的点的坐标。

graphics.drawRect()方法的更多相关文章

  1. UIView的layoutSubviews和drawRect方法何时调用

    首先两个方法都是异步执行.layoutSubviews方便数据计算,drawRect方便视图重绘. layoutSubviews在以下情况下会被调用: 1.init初始化不会触发layoutSubvi ...

  2. UIView的layoutSubviews和drawRect方法何时调用 ———转

    转自:http://jianyu996.blog.163.com/blog/static/112114555201305113018814/ 首先两个方法都是异步执行.layoutSubviews方便 ...

  3. ios中怎么样设置drawRect方法中绘图的位置

    其中drawRect方法中的参数rect就是用来设置位置的,

  4. [转] C# 绘制报表,使用Graphics.DrawString 方法

    原文 Graphics.DrawString 方法 在指定位置并且用指定的 Brush 和Font 对象绘制指定的文本字符串. public void DrawString( string s, Fo ...

  5. iOS的layoutSubviews和drawRect方法何时调用

    layoutSubviews在以下情况下会被调用: 1.init初始化不会触发layoutSubviews.2.addSubview会触发layoutSubviews.3.设置view的Frame会触 ...

  6. 关于layoutSubviews以及drawRect方法

    首先两个方法都是异步执行.layoutSubviews方便数据计算,drawRect方便视图重绘. layoutSubviews在以下情况下会被调用: 1.init初始化不会触发layoutSubvi ...

  7. UIView的layoutSubviews和drawRect方法

    UIView的layoutSubviews和drawRect方法   首先两个方法都是异步执行.layoutSubviews方便数据计算,drawRect方便视图重绘.   layoutSubview ...

  8. 【转】Graphics.DrawImage 方法 IntPtr 结构 GDI 句柄 知识收集

    Graphics.DrawImage 方法 在指定的位置使用原始物理大小绘制指定的 Image. 命名空间:System.Drawing 程序集:System.Drawing(在 system.dra ...

  9. iOS重写drawRect方法实现带箭头的View

    创建一个UIView的子类,重写drawRect方法可以实现不规则形状的View,这里提供一个带箭头View的实现代码: ArrowView.h #import <UIKit/UIKit.h&g ...

随机推荐

  1. ABAP_增强点查找

    *&---------------------------------------------------------------------* *& Report Z_FIND_EN ...

  2. 洛谷 P2787 语文1(chin1)- 理理思维

    题意简述 维护字符串,支持以下操作: 0 l r k:求l~r中k的出现次数 1 l r k:将l~r中元素赋值为k 2 l r:询问l~r中最大连续1的长度 题解思路 珂朵莉树暴力赋值,查询 代码 ...

  3. 实现API管理系统的几个重要关键词

    管理API的需求源自于Web API开展业务.从2006年开始,然后逐渐成熟,并在2016年之前进入市场.无论是通过代理现有API的管理网关.本身作为用于部署API本身的网关的一部分,还是作为连接层在 ...

  4. linux下搭建LJMT(图文版)

    一.  安装VM14 1.1 安装虚拟机vm14(略) 输入序列号:AC5XK-0ZD4H-088HP-9NQZV-ZG2R4(可自行百度) 二. 安装centos详细步骤 2.1安装centos.( ...

  5. 集成 Spring Boot 常用组件的后台快速开发框架 spring-boot-plus 国

    spring-boot-plus是一套集成spring boot常用开发组件的后台快速开发框架 Purpose 每个人都可以独立.快速.高效地开发项目! Everyone can develop pr ...

  6. C笔记_C语言环境、编译、预处理

    1.环境 gcc -v //查看环境变量 gcc 同 g++ gcc main.c -o main.exe gcc main.c //默认生成a.exe 2.编译 预处理:   gcc -E main ...

  7. Java之Exception

    Exception这个东西,程序中必须会有的,尽管我们很不乐意看到它,可是从另一个角度考虑,有异常则说明程序有问题,有助于我们及时改正.有的时候程序出错的原因有很多,比如不合法的输入.类型.空指针甚至 ...

  8. LightOJ - 1370 Bi-shoe and Phi-shoe 欧拉函数 题解

    题目: Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popula ...

  9. c3p0,dbcp与druid 三大连接池的区别[转]

    说到druid,这个是在开源中国开源项目中看到的,说是比较好的数据连接池.于是乎就看看.扯淡就到这. 下面就讲讲用的比较多的数据库连接池.(其实我最先接触的是dbcp这个) 1)DBCP DBCP是一 ...

  10. Oracle性能图表工具:awrcrt.sql 介绍,更新到了2.14 (2018年3月31日更新)

    2018-03-31 awrcrt更新到了2.14版本, 下载地址为 https://pan.baidu.com/s/1IlYVrBJuZWwOljomVfta5g https://pan.baidu ...