1.Canvas类

public class Canvas {
public static final int ALL_SAVE_FLAG = 31;
/** @deprecated */
@Deprecated
public static final int CLIP_SAVE_FLAG = 2;
/** @deprecated */
@Deprecated
public static final int CLIP_TO_LAYER_SAVE_FLAG = 16;
/** @deprecated */
@Deprecated
public static final int FULL_COLOR_LAYER_SAVE_FLAG = 8;
/** @deprecated */
@Deprecated
public static final int HAS_ALPHA_LAYER_SAVE_FLAG = 4;
/** @deprecated */
@Deprecated
public static final int MATRIX_SAVE_FLAG = 1; public Canvas()
public Canvas(Bitmap bitmap) ;
public boolean isHardwareAccelerated() ;
public void setBitmap(Bitmap bitmap) ;
public boolean isOpaque() ;
public int getWidth() ;
public int getHeight();
public int getDensity();
public void setDensity(int density) ;
public int getMaximumBitmapWidth() ;
public int getMaximumBitmapHeight() ;
public int save() ; /** @deprecated */
@Deprecated
public int save(int saveFlags) ;
/** @deprecated */
@Deprecated
public int saveLayer(RectF bounds, Paint paint, int saveFlags) ;
public int saveLayer(RectF bounds, Paint paint) ;
/** @deprecated */
@Deprecated
public int saveLayer(float left, float top, float right, float bottom, Paint paint, int saveFlags);
public int saveLayer(float left, float top, float right, float bottom, Paint paint) ;
/** @deprecated */
@Deprecated
public int saveLayerAlpha(RectF bounds, int alpha, int saveFlags) ;
public int saveLayerAlpha(RectF bounds, int alpha) ;
/** @deprecated */
@Deprecated
public int saveLayerAlpha(float left, float top, float right, float bottom, int alpha, int saveFlags);
public int saveLayerAlpha(float left, float top, float right, float bottom, int alpha);
public void restore() ;
public int getSaveCount() ;
public void restoreToCount(int saveCount);
public void translate(float dx, float dy);
public void scale(float sx, float sy);
public final void scale(float sx, float sy, float px, float py);
public void rotate(float degrees) ;
public final void rotate(float degrees, float px, float py);
public void skew(float sx, float sy) ;
public void concat(Matrix matrix) ; public void setMatrix(Matrix matrix) ;
/** @deprecated */
@Deprecated
public void getMatrix(Matrix ctm) ;
/** @deprecated */
@Deprecated
public final Matrix getMatrix() ;
/** @deprecated */
@Deprecated
public boolean clipRect(RectF rect, Op op);
/** @deprecated */
@Deprecated
public boolean clipRect(Rect rect, Op op) ;
public boolean clipRect(RectF rect) ;
public boolean clipOutRect(RectF rect);
public boolean clipRect(Rect rect);
public boolean clipOutRect(Rect rect) ; /** @deprecated */
@Deprecated
public boolean clipRect(float left, float top, float right, float bottom, Op op) ; public boolean clipRect(float left, float top, float right, float bottom); public boolean clipOutRect(float left, float top, float right, float bottom); public boolean clipRect(int left, int top, int right, int bottom); public boolean clipOutRect(int left, int top, int right, int bottom); /** @deprecated */
@Deprecated
public boolean clipPath(Path path, Op op); public boolean clipPath(Path path); public boolean clipOutPath(Path path) ; public DrawFilter getDrawFilter(); public void setDrawFilter(DrawFilter filter) ; public boolean quickReject(RectF rect, Canvas.EdgeType type); public boolean quickReject(Path path, Canvas.EdgeType type) ; public boolean quickReject(float left, float top, float right, float bottom, Canvas.EdgeType type); public boolean getClipBounds(Rect bounds) ; public final Rect getClipBounds() ; public void drawPicture(Picture picture) ; public void drawPicture(Picture picture, RectF dst); public void drawPicture(Picture picture, Rect dst) ; /***
oval : 圆弧的外轮廓矩形区域。
startAngle: 圆弧起始角度,单位为度。
sweepAngle: 圆弧扫过的角度,顺时针方向,单位为度
useCenter: 如果为True时,在绘制圆弧时将圆心包括在内,通常用来绘制扇形。如果为false会绘制切弦 看图吧
paint: 绘制圆弧的画板属性,如颜色,是否填充等。**/
public void drawArc(RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint paint);
public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, Paint paint) ; /** **/
public void drawARGB(int a, int r, int g, int b) ; public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) ; public void drawBitmap(Bitmap bitmap, Rect src, RectF dst, Paint paint); public void drawBitmap(Bitmap bitmap, Rect src, Rect dst, Paint paint); @Deprecated
public void drawBitmap(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, Paint paint) ; @Deprecated
public void drawBitmap(int[] colors, int offset, int stride, int x, int y, int width, int height, boolean hasAlpha, Paint paint); public void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint); public void drawBitmapMesh(Bitmap bitmap, int meshWidth, int meshHeight, float[] verts, int vertOffset, int[] colors, int colorOffset, Paint paint); /*** 绘制圆形,圆心坐标cx,cy,半径 radius,paint */
public void drawCircle(float cx, float cy, float radius, Paint paint) ; /*** 绘制椭圆 */
public void drawOval(RectF oval, Paint paint);
public void drawOval(float left, float top, float right, float bottom, Paint paint); public void drawColor(int color) ; public void drawColor(int color, Mode mode) ; /***** 绘制线段:pos 的数量需要是4个倍数 ******/
public void drawLine(float startX, float startY, float stopX, float stopY, Paint paint) ;
public void drawLines(float[] pts, int offset, int count, Paint paint) ;
public void drawLines(float[] pts, Paint paint) ; public void drawPaint(Paint paint); public void drawPath(Path path, Paint paint); public void drawPoint(float x, float y, Paint paint); public void drawPoints(float[] pts, int offset, int count, Paint paint) ;
public void drawPoints(float[] pts, Paint paint) ; @Deprecated
public void drawPosText(char[] text, int index, int count, float[] pos, Paint paint); @Deprecated
public void drawPosText(String text, float[] pos, Paint paint); /*** 绘制矩形 */
public void drawRect(RectF rect, Paint paint) ;
public void drawRect(Rect r, Paint paint);
public void drawRect(float left, float top, float right, float bottom, Paint paint); public void drawRGB(int r, int g, int b); /******** 绘制圆角矩形,REctF,x轴上的圆角半径,y轴上圆角半径,panint *******/
public void drawRoundRect(RectF rect, float rx, float ry, Paint paint);
public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint); /*** 绘制text文字,从text的start到end,绘制中心点在(x,y),*/
public void drawText(String text, int start, int end, float x, float y, Paint paint) ;
public void drawText(CharSequence text, int start, int end, float x, float y, Paint paint);
public void drawText(char[] text, int index, int count, float x, float y, Paint paint);
public void drawText(String text, float x, float y, Paint paint); /*** 绘制text文字,str ,path,(path是绘制的text的路径,如:path.addArc,文字会随着arc弧形绘制 )**/ public void drawTextOnPath(String text, Path path, float hOffset, float vOffset, Paint paint) ;
public void drawTextOnPath(char[] text, int index, int count, Path path, float hOffset, float vOffset, Paint paint) ; public void drawTextRun(char[] text, int index, int count, int contextIndex, int contextCount, float x, float y, boolean isRtl, Paint paint);
public void drawTextRun(CharSequence text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, Paint paint); public void drawVertices(Canvas.VertexMode mode, int vertexCount, float[] verts, int vertOffset, float[] texs, int texOffset, int[] colors, int colorOffset, short[] indices, int indexOffset, int indexCount, Paint paint) ; public static enum VertexMode {
TRIANGLES,
TRIANGLE_FAN,
TRIANGLE_STRIP; private VertexMode() {
}
} public static enum EdgeType {
AA,
BW; private EdgeType() {
}
}
}

2.Paint类

public class Paint {
public static final int ANTI_ALIAS_FLAG = 1;
public static final int DEV_KERN_TEXT_FLAG = 256;
public static final int DITHER_FLAG = 4;
public static final int EMBEDDED_BITMAP_TEXT_FLAG = 1024;
public static final int FAKE_BOLD_TEXT_FLAG = 32;
public static final int FILTER_BITMAP_FLAG = 2;
public static final int HINTING_OFF = 0;
public static final int HINTING_ON = 1;
public static final int LINEAR_TEXT_FLAG = 64;
public static final int STRIKE_THRU_TEXT_FLAG = 16;
public static final int SUBPIXEL_TEXT_FLAG = 128;
public static final int UNDERLINE_TEXT_FLAG = 8; public Paint(); public Paint(int flags); public Paint(Paint paint); public void reset(); public void set(Paint src); public int getFlags() ; public void setFlags(int flags) ; public int getHinting();
public void setHinting(int mode);
public final boolean isAntiAlias(); public void setAntiAlias(boolean aa); public final boolean isDither() ;
public void setDither(boolean dither);
public final boolean isLinearText() ;
public void setLinearText(boolean linearText);
public final boolean isSubpixelText();
public void setSubpixelText(boolean subpixelText);
public final boolean isUnderlineText(); public void setUnderlineText(boolean underlineText);
public final boolean isStrikeThruText();
public void setStrikeThruText(boolean strikeThruText);
public final boolean isFakeBoldText();
public void setFakeBoldText(boolean fakeBoldText);
public final boolean isFilterBitmap() ;
public void setFilterBitmap(boolean filter);
public Paint.Style getStyle() ; public void setStyle(Paint.Style style);
public int getColor();
public void setColor(int color) ;
public int getAlpha() ;
public void setAlpha(int a);
public void setARGB(int a, int r, int g, int b) ;
public float getStrokeWidth();
public void setStrokeWidth(float width);
public float getStrokeMiter() ;
public void setStrokeMiter(float miter); public Paint.Cap getStrokeCap();
public void setStrokeCap(Paint.Cap cap);
public Paint.Join getStrokeJoin() ;
public void setStrokeJoin(Paint.Join join);
public boolean getFillPath(Path src, Path dst) ;
public Shader getShader() ;
public Shader setShader(Shader shader) ;
public ColorFilter getColorFilter() ;
public ColorFilter setColorFilter(ColorFilter filter);
public Xfermode getXfermode() ;
public Xfermode setXfermode(Xfermode xfermode);
public PathEffect getPathEffect() ;
public PathEffect setPathEffect(PathEffect effect);
public MaskFilter getMaskFilter();
public MaskFilter setMaskFilter(MaskFilter maskfilter);
public Typeface getTypeface() ;
public Typeface setTypeface(Typeface typeface) ;
public void setShadowLayer(float radius, float dx, float dy, int shadowColor);
public void clearShadowLayer();
public Paint.Align getTextAlign();
public void setTextAlign(Paint.Align align);
public Locale getTextLocale() ;
public LocaleList getTextLocales() ;
public void setTextLocale(Locale locale);
public void setTextLocales(LocaleList locales);
public boolean isElegantTextHeight() ;
public void setElegantTextHeight(boolean elegant) ;
public float getTextSize();
public void setTextSize(float textSize);
public float getTextScaleX();
public void setTextScaleX(float scaleX);
public float getTextSkewX() ;
public void setTextSkewX(float skewX) ;
public float getLetterSpacing();
public void setLetterSpacing(float letterSpacing) ;
public String getFontFeatureSettings();
public void setFontFeatureSettings(String settings);
public String getFontVariationSettings() ;
public boolean setFontVariationSettings(String fontVariationSettings) ;
public float ascent() ;
public float descent();
public float getFontMetrics(Paint.FontMetrics metrics);
public Paint.FontMetrics getFontMetrics();
public int getFontMetricsInt(Paint.FontMetricsInt fmi);
public Paint.FontMetricsInt getFontMetricsInt();
public float getFontSpacing();
public float measureText(char[] text, int index, int count);
public float measureText(String text, int start, int end);
public float measureText(String text) ;
public float measureText(CharSequence text, int start, int end);
public int breakText(char[] text, int index, int count, float maxWidth, float[] measuredWidth);
public int breakText(CharSequence text, int start, int end, boolean measureForwards, float maxWidth, float[] measuredWidth);
public int breakText(String text, boolean measureForwards, float maxWidth, float[] measuredWidth) ;
public int getTextWidths(char[] text, int index, int count, float[] widths);
public int getTextWidths(CharSequence text, int start, int end, float[] widths);
public int getTextWidths(String text, int start, int end, float[] widths);
public int getTextWidths(String text, float[] widths);
public void getTextPath(char[] text, int index, int count, float x, float y, Path path);
public void getTextPath(String text, int start, int end, float x, float y, Path path) ;
public void getTextBounds(String text, int start, int end, Rect bounds) ;
public void getTextBounds(char[] text, int index, int count, Rect bounds);
public boolean hasGlyph(String string);
public float getRunAdvance(char[] text, int start, int end, int contextStart, int contextEnd, boolean isRtl, int offset);
public float getRunAdvance(CharSequence text, int start, int end, int contextStart, int contextEnd, boolean isRtl, int offset);
public int getOffsetForAdvance(char[] text, int start, int end, int contextStart, int contextEnd, boolean isRtl, float advance);
public int getOffsetForAdvance(CharSequence text, int start, int end, int contextStart, int contextEnd, boolean isRtl, float advance) ;
public static class FontMetricsInt {
public int ascent;
public int bottom;
public int descent;
public int leading;
public int top; public FontMetricsInt() {
throw new RuntimeException("Stub!");
} public String toString() {
throw new RuntimeException("Stub!");
}
} public static class FontMetrics {
public float ascent;
public float bottom;
public float descent;
public float leading;
public float top; public FontMetrics() {
throw new RuntimeException("Stub!");
}
} public static enum Align {
CENTER,
LEFT,
RIGHT; private Align() {
}
} public static enum Join {
BEVEL,
MITER,
ROUND; private Join() {
}
} public static enum Cap {
BUTT,
ROUND,
SQUARE; private Cap() {
}
} public static enum Style {
FILL,
FILL_AND_STROKE,
STROKE; private Style() {
}
}
}

简单几何图形绘制

3.drawRect矩形绘制

    /*** 绘制矩形 */
public void drawRect(RectF rect, Paint paint) ;
public void drawRect(Rect r, Paint paint);
public void drawRect(float left, float top, float right, float bottom, Paint paint);
/*** 绘制圆角矩形,REctF,x轴上的圆角半径,y轴上圆角半径,panint ****/
public void drawRoundRect(RectF rect, float rx, float ry, Paint paint);
public void drawRoundRect(float left, float top, float right, float bottom, float rx, float ry, Paint paint);

4.drawLine绘制线段

/*****  绘制线段:pts 的数量需要是4的倍数 ******/
public void drawLine(float startX, float startY, float stopX, float stopY, Paint paint) ;
public void drawLines(float[] pts, int offset, int count, Paint paint) ;
public void drawLines(float[] pts, Paint paint) ;
      Paint rectPaint = new Paint();
rectPaint.setAntiAlias(true);
rectPaint.setColor(Color.GRAY);
rectPaint.setStyle(Paint.Style.STROKE);
rectPaint.setStrokeWidth(5);
rectPaint.setAntiAlias(true);
rectPaint.setStyle(Paint.Style.FILL);
rectPaint.setColor(0x88FF0000);
/***** pos 的数量需要是4个倍数*/
float []pos=new float[]{10,10,10,100,100,100,100,240};
/***** pos 每4个一组,4个float代表2个点坐标,然后连接成线*/
// canvas.drawLines(pos,rectPaint);
/**** pos,从点pos[2]到pos[5]*/
canvas.drawLines(pos,rectPaint);

5.绘制圆或椭圆

    /*** 绘制圆形,圆心坐标cx,cy,半径 radius,paint */
public void drawCircle(float cx, float cy, float radius, Paint paint) ; /*** 绘制椭圆 */
public void drawOval(RectF oval, Paint paint);
public void drawOval(float left, float top, float right, float bottom, Paint paint);

6.绘制弧形

    /***
oval : 圆弧的外轮廓矩形区域。
startAngle: 圆弧起始角度,单位为度。
sweepAngle: 圆弧扫过的角度,顺时针方向,单位为度
useCenter: 如果为True时,在绘制圆弧时将圆心包括在内,通常用来绘制扇形。如果为false会绘制切弦 看图吧
paint: 圆弧的画板属性,如颜色,是否填充等。**/
public void drawArc(RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint paint);
public void drawArc(float left, float top, float right, float bottom, float startAngle, float sweepAngle, boolean useCenter, Paint paint) ;

7.drawPath 绘制图形

 public void drawPath(Path path, Paint paint);

        Paint pathPaint = new Paint();
pathPaint.setARGB(70, 238, 18, 137);
pathPaint.setStyle(Paint.Style.FILL);
pathPaint.setAntiAlias(true);
pathPaint.setStrokeWidth(5);
pathPaint.setColor(Color.CYAN);
pathPaint.setStyle(Paint.Style.FILL);
Path path = new Path();
/*** 这个是上图的第三个 */
path.moveTo(100,100);
path.lineTo(50,300);
path.lineTo(300,100);
path.lineTo(350,300);
canvas.drawPath(path,pathPaint);

按上图drawpath绘制图形,有moveTo()作为起始点,lineTo连接到各个顶点。第四个图的梯形是moveTo(A),LineTo(B),LineTo(c) 然后再次moveTo(D),LineTo(B),LineTo(C)的

8.绘制drawText

    /*** 绘制text文字,从text的start到end,绘制起点在(x,y),*/
public void drawText(String text, int start, int end, float x, float y, Paint paint) ;
public void drawText(CharSequence text, int start, int end, float x, float y, Paint paint);
/*** 绘制text文字,从text的index,绘制count个字数,绘制起点在(x,y),*/
public void drawText(char[] text, int index, int count, float x, float y, Paint paint);
public void drawText(String text, float x, float y, Paint paint);

drawTextOnPath方法:

    /*** 绘制text文字,str ,path,(path是绘制的text的路径,如:path.addArc,文字会随着arc弧形绘制 )**/

    public void drawTextOnPath(String text, Path path, float hOffset, float vOffset, Paint paint) ;
public void drawTextOnPath(char[] text, int index, int count, Path path, float hOffset, float vOffset, Paint paint) ;
 Path path=new Path();
path.addRoundRect(100,100,300,300,10,10, Path.Direction.CW);
/*** path.addRoundRect(100,100,300,300,10,10, Path.Direction.CWW); */
canvas.drawTextOnPath("这里是drawTextOnPath方法", path, 20, 20, rectPaint);
       Paint rectPaint = new Paint();
rectPaint.setAntiAlias(true);
rectPaint.setColor(Color.RED);
rectPaint.setStrokeWidth(5);
rectPaint.setAntiAlias(true);
rectPaint.setStyle(Paint.Style.STROKE);
rectPaint.setColor(0x88FF0000);
rectPaint.setTextSize(40);

CW和CWW的区别:顺时针和逆时针

 

path.addArc()中没有Direction属性,绘制图形大致为下:

drawTextRun方法

 public void drawTextRun(char[] text, int index, int count, int contextIndex, int contextCount, float x, float y, boolean isRtl, Paint paint);
public void drawTextRun(CharSequence text, int start, int end, int contextStart, int contextEnd, float x, float y, boolean isRtl, Paint paint);

上面的CAN SHU 呢index开始下标,count绘制的数目,contextIndex和index一样(否则就异常退出了) contextCount>=count 。该方法要求api 23呢,isRtl改变了绘制的顺序,

false为正序,true为倒叙了。

   if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
canvas.drawTextRun("眼前风景不足停,不远之处是梦想".toCharArray(), 0, 7, 0, 7, 200, 500, false, rectPaint);
canvas.drawTextRun("眼前风景不足停,不远之处是梦想".toCharArray(), 0, 7, 0, 9, 200, 600, true, rectPaint);
canvas.drawTextRun("眼前风景不足停,不远之处是梦想".toCharArray(), 0, 4, 0, 9, 200, 700, false, rectPaint);
canvas.drawTextRun("眼前风景不足停,不远之处是梦想".toCharArray(), 0, 4, 0, 9, 200, 800, true, rectPaint); }

如图:

Paint、Canvas的更多相关文章

  1. Android Paint、Canvas、Matrix使用讲解(一、Paint)

    http://blog.csdn.net/tianjian4592/article/details/44336949 好了,前面主要讲了Animation,Animator 的使用,以及桌面火箭效果和 ...

  2. Paint、Canvas、Matrix使用解说(一、Paint)

    username=tianjian4592">我正在參加 CSDN 2015博客之星评选 感恩分享活动,假设认为文章还不错,请投个票鼓舞下吧:http://vote.blog.csdn ...

  3. Paint、Canvas.2

    1:使用Cavans画个简单图形 2:过程 2.1:绘制最外部的圆 /*** 初始化 paint */ Paint paint; paint = new Paint(); paint.setColor ...

  4. Paint、Canvas.1

    Canvas 方法详解 1:translate(float dx, float dy) /**** 移动canvas的原点到(dx,dy),默认为(0,0) */ public void transl ...

  5. 安卓自定义控件(一)Canvas、Paint、Shader、Xfermode

    关于自定义控件,之前就写过一篇自定义控件,上图下字的Button,图片任意指定大小,但是使用效果还是让人感觉不幸福,这次索性彻彻底底地对自定义控件做一次彻彻底底的总结. 我会花4篇博客来介绍自定义控件 ...

  6. Android学习记录:Paint,Canvas和Bitmap

    在Java中,利用过双缓冲技术,先将画笔画在内存上,再转化为图片,调出来. 当画的东西过多造成处理不过来时,双缓冲技术将防止闪屏. 在Paint方法下,我们这样写: BufferedImage tmp ...

  7. 环形进度条的实现方法总结和动态时钟绘制(CSS3、SVG、Canvas)

    缘由: 在某一个游戏公司的笔试中,最后一道大题是,“用CSS3实现根据动态显示时间和环形进度[效果如下图所示],且每个圆环的颜色不一样,不需要考虑IE6~8的兼容性”.当时第一想法是用SVG,因为SV ...

  8. [Web 前端] VML、SVG、Canvas简介

    1.VML: VML的全称是Vector Markup Language(矢量可标记语言),矢量的图形,意味着图形可以任意放大缩小而不损失图形的质量,这在制作地图上有很大用途,VML只是被IE支持. ...

  9. VML、SVG、Canvas简介

    1.VML: VML的全称是Vector Markup Language(矢量可标记语言),矢量的图形,意味着图形可以任意放大缩小而不损失图形的质量,这在制作地图上有很大用途,VML只是被IE支持. ...

随机推荐

  1. MySQL出现:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure Last packet sent to the server was 0 ms ago.

    1.首先检查生产环境的机器是否ping的通和telnet的通数据库 2.排查数据库连接的参数 3.看数据量是否很大 参考: http://blog.csdn.net/sclxf/article/det ...

  2. SiteMesh2-sitemesh.xml的ConfigDecoratorMapper映射器的用法

    继上一次的示例工程http://www.cnblogs.com/EasonJim/p/7083165.html,使用的就是ConfigDecoratorMapper映射器,通过指定目录下的页面,都同一 ...

  3. 淘宝手机rem的如何使用

    1.主要介绍几个移动端常用的单位rem.vw.vh,配合传统的px.百分比.<viewport>标签,兼容适配移动端的各种分辨率的手机端. rm : 这个单位是以父元素为标准来进行计算 , ...

  4. android中读取通讯录学习笔记

    1.读取通讯录时一次读取时,尽量少读取全部属性.特别是列表展示的时候.会让你的列表载入速度变得难以忍受,建议先载入少量属性.然后在详情的时候载入全部属性. 2.在读取一类属性的时候,建议用一个游标,且 ...

  5. 终于理解java的classpath!

    JAVA 的CLASSPATH 上面这样是可以的!!!!哇, 再也不会出现编译或是运行的时候,class 找不到的问题了.终于明白为什么了. java -cp  /ysr/my-app  P  这条命 ...

  6. Spring MVC : Java模板引擎 Thymeleaf (二)

    本文原计划直接介绍Thymeleaf的视图解析,但考虑到学习的方便,决定先构建一个spring-mvc. 以下的全部过程仅仅要一个记事本和JDK就够了. 第一步,使用maven构建一个web app. ...

  7. HDOJ--1285--确定比赛名次

    确定比赛名次 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Sub ...

  8. C++学习之函数模板与类模板

    泛型编程(Generic Programming)是一种编程范式,通过将类型参数化来实现在同一份代码上操作多种数据类型,泛型是一般化并可重复使用的意思.泛型编程最初诞生于C++中,目的是为了实现C++ ...

  9. LeetCode 541. Reverse String II (反转字符串 II)

    Given a string and an integer k, you need to reverse the first k characters for every 2k characters ...

  10. oc71--NSArray2

    // // Person.h #import <Foundation/Foundation.h> @interface Person : NSObject - (void)say; - ( ...