189 8069 5689

android图片文字,手机图片文字

Android给图片添加竖排文字水印

就下载一个加水印的软件就可以了。

成都创新互联是一家集网站建设,云和企业网站建设,云和品牌网站建设,网站定制,云和网站建设报价,网络营销,网络优化,云和网站推广为一体的创新建站企业,帮助传统企业提升企业形象加强企业竞争力。可充分满足这一群体相比中小企业更为丰富、高端、多元的互联网需求。同时我们时刻保持专业、时尚、前沿,时刻以成就客户成长自我,坚持不断学习、思考、沉淀、净化自己,让我们为更多的企业打造出实用型网站。

文字水印代码:

privateBitmapcreateBitmap(Bitmapphoto,Stringstr,intmark_x,intmark_y){

intwidth=photo.getWidth(),hight=photo.getHeight();

System.out.println("宽"width"高"hight);

//建立一个空的BItMap

Bitmapicon=Bitmap.createBitmap(width,hight,Bitmap.Config.ARGB_8888);

//初始化画布绘制的图像到icon上

Canvascanvas=newCanvas(icon);

PaintphotoPaint=newPaint();//建立画笔

photoPaint.setDither(true);//获取跟清晰的图像采样

photoPaint.setFilterBitmap(true);//过滤一些

//创建一个指定的新矩形的坐标

Rectsrc=newRect(0,0,photo.getWidth(),photo.getHeight());

//创建一个指定的新矩形的坐标

Rectdst=newRect(0,0,width,hight);

//将photo缩放或则扩大到dst使用的填充区photoPaint

canvas.drawBitmap(photo,src,dst,photoPaint);

android怎样实现在图片上任意位置添加文字 要代码 急求。。

android在图片上任意位置添加文字,可以使用canvas类进行操作,实例如下:

@Override

protected void onDraw(Canvas canvas)

{

super.onDraw(canvas);

canvas.drawBitmap(m_LogInBmp, null, m_LogIndst, m_txBackPaint);

float tleft = m_LogIndst.left + (m_LogIndst.right - m_LogIndst.left - FontWidth*m_TextLogIn.length())/2;

float ttop = m_LogIndst.top + (m_LogIndst.bottom - m_LogIndst.top - FontHeight)/2 +FontHeight;

canvas.drawText( m_TextLogIn, tleft, ttop, mLogInPaint);

}

Android给图片添加文字和水印

话不多说 上图

在Activity中获取到ImageView对象,并且获取Bitmap对象,对Bitmap进行canva绘图,添加水印

添加一个布局,上面是原始图片,下面是添加水印后的图片


新闻标题:android图片文字,手机图片文字
网站网址:http://cdxtjz.cn/article/dsdosid.html

其他资讯