英语:algolab photo vectorr,也称作矢量 题目。

vector是什么意思_vector在线翻译_vector什么意思_vector的意思_vector的翻译_英语单词大全_911查询
vector是什么意思
输入英文单词或中文词语查询其翻译
vector是什么意思 vector在线翻译 vector什么意思 vector的意思 vector的翻译 vector的解释 vector的发音 vector的同义词 vector的反义词 vector的例句
vector英 ['vekt?(r)] 美 ['v?kt?] 第三人称复数:vector 基本解释名词矢量; 航向; [生]带菌者; [天]矢径及物动词用无线电引导; 为…导航vectorvector 网络解释1. 载体:C.碱基改变发生在增强子上; D.碱基改变发生在微卫星上; E.碱基改变发生在酶切位点上o 三联密码(triplet)o Alu序列(Alu sequence)o 基因组(genome)o 引物(primer)o 原位分子杂交(in situ hybridization)o 载体(Vector)o 锌指蛋白(zivector 双语例句1. It is a distance vector protocol that uses a hop count metric.&&&&它是使用跃过路由器的计数做为度量值的距离向量协定。2. vector的近义词2. Theoretically, this method can be used to construct dislocations with any shape and any Burgers vector.&&&&利用该方法,选用FCC单晶铜为模拟介质,构造Burgers矢量为b=[1 1 0]/2的刃型全位错和Burgers矢量为b=[11 2]/6圆环形不完全位错环,并使用分子动力学方法模拟全位错的扩展分解过程和不全位错环在自应力作用下的收缩过程,模拟结果与理论分析一致。3. The loops are identified to have the Burgers vector[100] and lie on(100)planes due to vacancy condensation.&&&&经确定,方形位错环位于(100)面,Burgers矢量为[100],是由空位聚集造成的。4. It was found that grown-in dislocations and growth sector boundaries are the predominant defects in the crystals. the majority of dislocations are along the [100] lines, and Burgers vector is [001] direction.&&&&发现该晶体中的生长缺陷主要为生长位错和生长扇界,大部分位错沿[100]方向,Burgers矢量为[001]。5. 5. The needed stress of developing twin is less than the needed stress of slip, the Burgers vector of twinning dislocation is less than the normal dislocation, so the Peier...&&&&试验表明:以上组织结构的变化,提高了合金抗高温塑性变形能力,减轻了高温焊接时粘焊现象的发生,电极的耐磨性明显提高。6. A linear crystalline defect associated with the lattice distortion produced in the vicinity of the end of an extra half plane of atoms within a crystal. The Burgers vector is perpendicular to the dislocation line.&&&&一种一维线型晶体缺陷,形态上可是描述为晶体中存在的多余半原子面的末端附近区域所形成的原子错排组态,刃型位错的柏氏矢量垂直与其位错线。7. For verification purpose, we construct a linear edge perfect dislocation with Burgers vector b=[110]/2 and a partial dislocation ring with b= [112]/6 in FCC copper.&&&&该方法的优点在于可以方便地构造出其他传统方法难以构造的位错闭合结构-位错环,从而使位错环的细致研究成为可能。8. The Burgers vector of it is [11 –1]β/2([2 –1 –1 –3]α/6). Based on the observation, a 3D model of morphology and dislocation structures of α plate was constructed. The observed OR and dislocation structure on the habit plane was explained by an analytical O-line model.&&&&惯习面的位错与侧面上大间距位错和小间距位错在端面上发生位错反应形成位错的Burgers矢量分别为[1 1 –1]β/2([2 –1 –1 –3]α/6)和[0 1 0]β([0 1 –1 –1]α/2)。9. \u\u006E\u\u002E\u\u\u\u002E\uF\u006D9. Then, making use of vector ordering based on set theory, designing new method for color image segmentation.&&&&随后,利用格论中的矢量排序的方法,重新的设计脉冲耦合神经网络的计算方程和神经单元的选择条件,得到更优秀的PCNN彩色图像分割算法。10. After analyzing, this paper proposes a new method to determine the ordering vector of fuzzy complementary matrix, and the new method can be used by a formula when decision makers give positive reciprocal matrices.&&&&通过分析研究,论文提出一种确定模糊互补判断矩阵排序向量的新方法,通过转化公式,新排序方法可以应用于决策者给出正互反判断矩阵的情况。11. By combining the weight vector of all the attributes and the large group preference matrix, an integration evaluation value vector of all the schemes is obtained. From the integration evaluation values in this vector, the ordering result of each scheme is got. The methood solves the problem of multi-attributes and multi-schemes large group decision making better.&&&&&&将各个属性权重向量和大群体偏好矩阵进行合成,获得各个方案的综合评价值向量,由该向量中的综合评价值得出各方案的综合排序结果,较好地解决了多属性多方案大群体决策问题。12. A theorem on sufficiency and necessity of fuzzy positive matrix is proposed after much analysis. Based on the thought of minimun deviationan, an optimization model is constructed first, and then a formula with parameter is taken advantage to approximate the corresponding element in the fuzzy complementary matrix and results in obtaining a fuzzy positive matrix. Meanwhile, the ordering vector of the fuzzy positive matrix is calculated.&&&&&&经过深人分析,论文首先提出一个模糊一致矩阵的充要条件,再根据差异最小化的思想,构建一个最优化模型,利用一个含有参数的矩阵逼近原模糊互补判断矩阵,得到一个新的模糊一致矩阵,然后再求出这个模糊一致矩阵的排序向量。13. 13. The transfer vector was then recombined into a baculovirus expression vector and expressed in Trichoplusia ni cells.&&&&&&将去信号肽片段克隆入pFastBacb转移载体,重组到杆状病毒Bac-to-Bac表达系统,在粉纹夜蛾细胞系(Tn-5B1-4)中进行融合表达。14. The FABP gene cDNA fragment was amplified by RT-PCR and cloned into pMD19-T vector for sequencing and analyzing.&&&&&&FABP基因cDNA亚克隆到pcDNA3.1中,构建核酸疫苗pcDNA3.1-FABP-NM,经测序验证,结果正确。15. In this thesis, Chapter 4 develops a novel support vector machine, i. e. multiple kernels learning multicategory support vector machine, for the faults diagnosis in transformers.&&&&&&提出一种新颖的多分类多核学习支持向量机变压器故障诊断方法,相对于传统的两分类支持向量机,该方法具备诸多优点。16. Support Vector Machine is one of the learning methods that developed from SLT.&&&&&&同时,在其理论基础上发展出了很多实际的学习方法。17. 17. Support Vector Machines is an important area of SLT, which developed after the neural networks.&&&&&&支持向量机是在神经网络之后,建立在统计学习理论基础上的一种新的机器学习技术。18. 18. Support Vector Machine is a novel powerful machine learning method based on SLT.&&&&&&支持向量机是在该理论体系下产生的一种新的、非常有力的机器学习方法。19. In this method, Field vector are first sampled on the certain plane, and then the existed scattering modal voltages are obtain by means of orthogonal expanding integration. Those scattering modal voltages are used as sources to calculate the boundary condition at the porter plane of the waveguide, thus the finite element method time domain can carry out for every time iterative step.&&&&&&依据取样平面上获得的散射模电压幅度,应用有限差分方法计算出接头端面处的边界条件来实现时域有限元法的迭代计算,由于本文采用无结构网格来模拟计算模型,使得本文的混合时域有限元方法可以用来计算复杂的波导接头问题。20. 20. Presents an efficient method of fabric defect classification based on cluster analysis and support vector machine.&&&&&&提出一种基于聚类分析和支持向量机的布匹瑕疵分类方法。vector 词典解释1. 矢量;向量&&&&A vector is a variable quantity, such as force, that has size and direction.2. (传播疾病的)媒介昆虫,带菌生物&&&&A vector is an insect or other organism that causes a disease by carrying a germ or parasite from one person or animal to another.vector 单语例句1. A carrier molecule called a vector must be used to deliver the therapeutic gene to the patient's target cells.2. The index reflects the distribution of the mosquito vector for Dengue fever transmission.3. Target cells such as the patient's liver or lung cells are infected with the viral vector.4. They started with the careful choice of what they thought would be the right vector, proper target diseases and careful dosages of the injection.5. The vector then unloads its genetic material containing the therapeutic human gene into the target cell.6. " The attack vector that they used wasn't very sophisticated, " he said.vector的意思vector 英英释义vectornoun1. (genetics) a virus or other agent that is used to deliver DNA to a cell2. a variable quantity that can be resolved into components3. any agent (person or animal or microorganism) that carries and transmits a disease&&&&e.g. mosquitos are vectors of malaria and yellow fever&&&&&&&&&&&fleas are vectors of the plague&&&&&&&&&&&aphids are transmitters of plant diseases&&&&&&&&&&&when medical scientists talk about vectors they are usually talking about insects&&&&Synonym: 4. a straight line segment whose length is magnitude and whose orientation in space is directionvector是什么意思,vector在线翻译,vector什么意思,vector的意思,vector的翻译,vector的解释,vector的发音,vector的同义词,vector的反义词,vector的例句,vector的相关词组,vector意思是什么,vector怎么翻译,单词vector是什么意思常用英语教材考试英语单词大全 (7本教材)
出国英语单词大全 (5本教材)
大学英语单词大全 (13本教材)
高中英语单词大全 (6本教材)
初中英语单词大全 (13本教材)
小学英语单词大全 (33本教材)
别人正在查
911查询 全部查询 网址:
(共20个)占卜求签
(共17个)民俗文化
(共16个)交通出行
(共10个)学习应用
(共26个)休闲娱乐
(共10个)站长工具
(共8个)身体健康
&2017  京ICP备号-6 京公网安备30 您所在位置: &
&nbsp&&nbsp&nbsp&&nbsp
矢量量化技术在高光谱图像中的应用研究.pdf 62页
本文档一共被下载:
次 ,您可全文免费在线阅读后下载本文档。
下载提示
1.本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。
2.该文档所得收入(下载+内容+预览三)归上传者、原创者。
3.登录后可充值,立即自动返金币,充值渠道很便利
需要金币:200 &&
检测 启发 衍生 BOC 芯片 单片机 雷达
你可能关注的文档:
··········
··········
分类号TN919.81
重庆邮电大学硕士学位论文
矢量量化技术在高光谱图像中的应用研究
ResearchonVector
Quantization
.A...............p.........plica—t—ion HyperspectralImage
陈善学教授
论文提交日期
论文答辩日期
论文评阅人
答辩委员会主席
田增山教授
重庆邮电大学
独创性声明
本人声明所呈交的学位论文是本人在导师指导下进行的研究工作及取得的研
究成果。据我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其他
人已经发表或撰写过的研究成果,也不包含为获得重麽自E电太堂或其他教育
机构的学位或证书而使用过的材料。与我一同工作的同志对本研究所做的任何贡
献均己在论文中作了明确的说明并表示谢意。
学位敝作者龆社嘲
签字日期.
加f乡年6月r日
学位论文版权使用授权书
本学位论文作者完全了解
重麽邮电太堂
有关保留、使用学位论文的规
定,有权保留并向国家有关部门或机构送交论文的复印件和磁盘,允许论文被查
阅和借阅。本人授权
重迭由E电太堂 可以将学位论文的全部或部分内容编入
有关数据库进行检索,可以采用影印、缩印或扫描等复制手段保存、汇编学位论
(保密的学位论文在解密后适用本授权书)
学位论文作者签名:午鼋嘞
新签名似/、‘争
签字日期:硎乡年6月Jf-日
签字日期:加D年‘月8日
矢量量化技术是70年代后期发展起来的一种数据压缩技术,因其具有压缩比
大、解码简单以及失真较小等优点,现已被广泛应用于图像压缩和语音编码中。
本文围绕矢量量化技术在图像压缩处理中的应用,主要阐述了矢量量化的研
究现状、基本原理以及相关技术,重点探讨了矢量量化的码书设计和码字搜索算
法两大关键技术,并在分析已有算法的基础上,提出改进算法,运用于图像处理
1.码书设计方面:分析矢量量化码书设计经典算法--LBG算法,针对初始码书
的选择影响LBG算法的最终码书性能的缺点,采用粒子群算法来处理图像。在分
析标准粒子群码书设计算法的基础之上,利用惯性权重系数能够调节寻找全局最
优码书的能力,本文提出一种改进惯性权重系数的粒子群算法,实现在算法初期
粒子具有较好的全局搜索能力,在粒子群算法的晚期具有很强的局部收敛能力。
经过仿真实验对比,改进算法能够实现对恢复图像质量的提高。
2.码字搜索方面:由于高光谱图像较大的数据量和较高的数据维数的特点,
传统的LBG算法在高光谱图像压缩处理中的计算量将变得非常巨大。为此,在哈
达玛变换域引进统计矢量对矢量分量的能量进行估计,选取能量聚集的高的维作
为子矢量,降低了搜索的矢量维数。同时,在子矢量域中利用快速排除不等式来
搜索码字。仿真
正在加载中,请稍后...矢量,vector英语短句,例句大全
矢量,vector
1)vector[英]['vekt?(r)][美]['v?kt?]矢量
1.Research on water flooding effect improved by vectorial well arrangement for reservoirs with permeability he矢量井网改善平面非均质油藏水驱开发效果研究
2.Random Directive Vector Dimension Chain and Its Application in Machine Tool Design and M随机方向矢量尺寸链及其在机床设计制造中的应用
英文短句/例句
1.A one - dimensional array.矢量,矢径一维数组
2.An axial vector may itself enter into a vector product.轴矢量自身可参与矢积。
3.A vector multiplied by a scalar quantity is a vector in the same direction as the original vector.乘以标量的矢量是一个与原矢量同向的矢量。
4.Notes on the Bra Vector and Ket Vector, Reciprocal Basis Vectors and Reciprocal Vectors, Covariant Vectors and Contravariant V关于左矢、右矢和相伴基矢、相伴矢量以及协变矢量、逆变矢量的几点注记
5.unbalance vector measuring device不平衡矢量测量装置
6.vector analysis矢量分析, 向量解析
7.array vector数组向量,数组矢量
8.Angular momentum is an axial vector quantity.角动量是一种轴矢量。
9.Research on Vector Quantization Codebook Design and A矢量量化码书设计与矢量量化应用研究
10.Establish displacement vector equation of mechanism using vector method to infer the speed and the acceleration vector equation.运用矢量法建立机构的位移矢量方程,推导出速度、加速度矢量方程。
11.The dot product of a pseudovector and a vector is called a pseudoscalar.一个赝矢量和一个矢量的标识称为赝标量。
12.Directional physical quantity measurement instrument based on VMM principle基于矢量调制法的矢性物理量测量仪器
13.Determination of Vector Acceleration for Airborne Vector Gravimetry航空矢量重力测量中载体加速度矢量的确定
14.Any two vectors whose vector sum equals a given vector are called the components of that vector.假如任意两个矢量的和等于一个给定的矢量,这两个矢量就称为该给定矢量的分量。
15.An operator represented as a pair of vectors juxtaposed without multiplication.并矢一种代表一对矢量的运算子,矢量并置但不增值
16.vector Liapunov function矢量李亚甫诺夫函数
17.VILP (Vector Impedance Locus Plotter)矢量阻抗轨迹测绘器
18.vector scan electron beam lithography矢量扫描电子束光刻
相关短句/例句
vectors矢量
1.To solve the problems associated with Direct Torque Control(DTC) of Permanent Magnet Synchronous Mo-tor(PMSM) using conventional voltage space vectors,such as high current,flux and torque ripple,a novel DTC strategy based on voltage space vectors and stator flux linkage sectors subdivision is proposed.由于采用传统的电压空间矢量开关表控制逆变器动作的永磁同步电机(Permanent Magnet Synchronous Motor,简称PMSM)直接转矩控制(Direct Torque Control,简称DTC)存在着电流畸变、磁链和转矩脉动大的缺陷。
2.This paper presents a novel speed-sensorless direct torque control method based on vectors subdivision,analyses and compares the performance of traditional six-voltage vector control and twelve-voltage vector s,finally provides the experimental results of the system implementation using dsPIC30F6010.传统的直接转矩控制在进行矢量切换时会造成磁链幅值的显著变化,从而引起磁链轨迹畸变。
3)vectorial矢的,矢量的
4)vector quantization(VQ)矢量量化
1.To overcome problems of steel water continuous casting slag detection system(SWCC-SDS),such as high cost and equipment inconvenience,a new SDS based on vector quantization(VQ) technology was put forward.针对当前钢水连铸下渣检测系统(SWCC-SDS)成本高、难于安装等问题,提出了一种基于矢量量化(VQ)技术的钢水下渣检测方法。
2.An integral projection algorithm for Vector Quantization(VQ) is proposed in this paper,integral projection is used in every 4×4 block firstly,and then carry on vector quantity with the integral codebook.提出了一种积分投影和矢量量化(VQ)相结合的图像压缩算法,将图像的每一个4×4分块先进行积分投影,然后再与积分投影后的码书进行量化匹配,大大减少运算量和码书存储面积,而图像的质量只有轻微损失。
3.Vector Quantization(VQ)is one of the popular codebook design methods for text-independent speaker identification.矢量量化(VQ)方法是文本无关说话人识别中广泛应用的建模方法之一,它的主要问题是码本设计问题。
5)vector measurement矢量测量
6)vector quantification矢量量化
1.Design of vector quantification矢量量化编码的码书设计研究
2.A Fast Vector Quantification Image Coding Scheme Based on Wavelet T基于小波变换的快速矢量量化(VQ)编码
3.The algorithm is based on a sinusoidally excited linear prediction model and uses multi frame joint vector quantification, multi band mixing excitation, sub band voicing strength parameter prediction, and adaptive spectral enhancement to obtain high quality synthetic speech with a low bit rate.此算法基于线性预测正弦激励模型 ,在极低码率下获得高质量的合成语音 ,提出清浊音定位和量化方法 ,应用了多帧参数联合矢量量化技术 ,以及多带正弦混合激励、谱增强等技术。
矢量即“向量①”(51页)。君,已阅读到文档的结尾了呢~~
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer--144.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口Android使用矢量图(SVG, VectorDrawable)实践篇 - 简书
Android使用矢量图(SVG, VectorDrawable)实践篇
是时候全面使用矢量图了。——哲鸠斯·沃硕德
本文是以读者对SVG有一定了解为前提的,否则请先百(谷)度(歌)了解下。
实践都是从坑里爬出来的,因此本文的子题目也可叫做Android使用矢量图填坑记。
文章开始前,先墙裂安利一个网站,阿里的,海量在线矢量图,早收藏早致富。本文主要涉及到的矢量图资源均来自该网站。放图镇楼:
iconfont首页
可缩放矢量图形(英语:Scalable Vector Graphics,SVG)是一种基于可扩展标记语言(XML),用于描述二维矢量图形的图形格式。SVG由W3C制定,是一个开放标准。——摘自
.svg格式相对于.jpg、.png甚至.webp具有较多优势,我认为核心有两点:
省时间。图像与分辨率无关,收放自如,适配安卓机坑爹的分辨率真是一劳永逸;
省空间。体积小,一般复杂图像也能在数KB搞定,图标更不在话下。
VectorDrawable
VectorDrawable是Google从Android 5.0开始引入的一个新的Drawable子类,能够加载矢量图。到现在通过support-library已经至少能适配到Android 4.0了(通过统计的Android版本分布来看,Android 4.1以下(api&15)几乎可以不考虑了)。Android中的VectorDrawable只支持SVG的部分属性,相当于阉割版。
它虽然是个类,但是一般通过配置xml再设置到要使用的控件上。在Android工程中,在资源文件夹res/drawable/的目录下(没有则需新建),通过&vector&&/vector&标签描述,例如svg_ic_arrow_right.xml:
&vector xmlns:android="/apk/res/android"
android:width="8dp"
android:height="8dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0"&
android:fillColor="#ffffff"
android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/&
基本属性说明:
width, height:图片的宽高。可手动修改到需要尺寸;
viewportHeight, viewportWidth:对应将上面height width等分的份数。以svg_ic_arrow_right.xml举例,可以想象将长宽都为8dp的正方形均分为24x24的网格,在这个网格中就可以很方便地描述点的坐标,图像就是这些点连接起来构成的。
fillColor:填充颜色。最好直接在这里写明色值#xxxxxxxx,而不要用@color/some_color的形式,避免某些5.0以下机型可能会报错。
pathData:在2中描述的网格中作画的路径。具体语法不是本文的重点,故不展开。
这段代码描述出来的是一个白色箭头,可以从Android Studio的preview功能栏里预览到它的样子:
vector preview
获取矢量图
前言部分已经墙裂推荐过,感觉我已经离不开它了= ̄ω ̄=第一步,搜索你要的资源名字,中英文一般都会有结果。比如“arrow”,结果:
第二步,鼠标移动到某一图标上点击,比如上面第一排第二个,出现:
三个选项,第一相当于购物车,可不用登录,第二是收藏,第三是下载,均需要登录。如果未登录,点击后出现:
选择GitHub或微博都行。第三步,登录成功,点击下载,弹出:
可以对图标属性进行编辑,如色值和大小(单位dp),然后点按钮“SVG下载”。下载成功后在下载目录找到一个.svg格式的文件,我的是:
这个文件可以用浏览器打开-&查看网页源码,或者用NotePad++等编辑器打开看到里面的内容,格式化后是这样:
&?xml version="1.0" standalone="no"?&
&!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"&
&svg t="3" class="icon" style="" viewBox="0 0 " version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1010" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"&
&style type="text/css"&&/style&
&path d="M288.601C272.......068 212.425 228.......03 994..1..8..8..................601Z" p-id="1011"&&/path&
问题是,文件里好多标签Android是不认识的。不过没关系,有三种解决办法:
大招。先放大招,大招之下,后两种可以自动忽略。经大神在评论区力荐的插件,用过之后果然神清气爽。安装:File -& Setting -& Plugins -& Browser repositories -& 搜“svg2VectorDrawable” -& 安装并重启Android Studio,再次进来后顶部工具栏会多一个图标:
点击图标弹出对话框:
勾选Batch选项,将对被选中文件夹中的.svg文件进行批量转换。nodpi会自动添加到没有后缀的drawable文件夹中。
网上下载的svg资源往往一步到位,有个这个插件将会事半功倍。导入第一个svg文件时就命名成我们想要的名字,如果不满意再导入时无需再关注命名,将后面导入的pathData覆盖第一个观察效果,直到满意后删除不需要的文件。
手动。新建一个&vector&&/vector&标签的xml文件,通过观察文件内容,很容易获取到关键信息。width height自然对应&vector/&中宽高,viewBox后两位数字是分别对应&vector/&中的viewportWidth和viewportHeight,往下&path/&中的d的数据的对应&vector/&中&path/&中的pathData。fillColor自己手动设置。
自动。Android Studio大发神威的时候到了。
鼠标选中drawable文件夹,右键, New, Vector Asset, Local file,然后出现:
先选本地文件(还能支持PSD,强吧),再到磁盘中找到之前下载的.svg矢量图。导入后可以为文件重命名(建议用svg_或者有区别于其它格式的前缀),默认导入宽高均为24dp,选中Override框则读取文件本来宽高,其它配置视需求而定。点击Next到下一页最后点Finish就导入了。自动导入需要格式化一下就是前面svg_ic_arrow_right.xml的样子了。
海搜比较耗时间,线条粗细啦,位置没居中啦,大小不搭配啦,关键是这些问题都是导入项目或者运行到手机后才能发现(非强迫症当我没说)。iconfont还有诸多成套的图标库,优点是风格大小一致,或者多彩图标。
方式二:Android Studio的Material Icon入口
鼠标选中drawable文件夹,右键, New, Vector Asset,然后出现:
点击机器人进入搜索筛选:
左侧的搜索和分类可以快速索引。这里应该都是由谷歌官方制作的MD标准图标,建议先到这里搜索,如果没有再到网上搜索。
方式三:用软件或工具导出
对本人来说,方式一基本可以搞定一个App了。但如果以上两种方式均不能满足你的需求,下面祭出求矢量图三式:
求美工。有好吃的出好吃的,有美色的出美色(诶?),据说PS+AI就能分分钟导出SVG(我试了怎么不行呢,姿势不对?)。
求自己。自学作画技能,到在线制作SVG的网站自己画去(不开玩笑,技多不压身啊)。
求Vector Magic。这是一个黑科技软件,可以读取.png或.jpg的路径,进而转化为SVG,用过一次,还原度还不错(支持正版,请不要点击任何带“破解”关键字的链接[正经脸])。
前提:项目的build.gradle配置有:
defaultConfig {
vectorDrawables.useSupportLibrary = true
dependencies {
compile "com.android.support:appcompat-v7:21+" // 至少Api21
项目的Activity中都包含(通用做法是在BaseActivity中加):
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
AppCompatImageView
这是继承自ImageView用于5.0以下加载矢量图的控件,只需要替换src为srcCompat属性,其它没什么不同。例如:
&android.support.v7.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/svg_ic_arrow_right"/&
如果你的Activity直接或间接继承自AppCompatActivity,当前视图中的ImageView在编译过程中会被自动转为AppCompatImageView(support包中所有含有AppCompat前缀的控件均受相同处理),因而在Activity中通过findViewById()的实例用ImageView或AppCompatActivity接收是没有区别的。
用以上条件的Activity中装载的Fragment,或者通过动态注入(如Dialog的contentView)的ImageView,均将被自动转为AppCompatActivity。
从xml文件中初始化ImageView并加载矢量图,必须使用AppCompatImageView的srcCompat属性。
ImageView的染色属性tint同样适合矢量图。
在我的经验中,TextView可以用到矢量图的场景是最多的,主要是设置CompoundDrawable。例如:
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/svg_ic_arrow_right"
android:drawablePadding="4dp"
android:text="drawable right"/&
这样设置后,没有任何不适,编译器也不报错,可能你自己运行也没问题。但是!这才是深坑啊。5.0以下某些机型可能会崩溃的。
AppCompatTextView是没有对CompoundDrawable进行适配的,所以需要自己动手才能丰衣足食。简单原理是,判断系统版本如果小于5.0,就用ContextCompat.getDrawable获取到Drawable实例,再setCompoundDrawablesWithIntrinsicBounds。
这个部分本人已经做好并开源了,地址:,轻松compile到项目中使用。还特意添加了一个实用功能——tint染色——可以选择是否让图标与文字颜色一样,这样就不必关心xml里的fillColor属性了。用例:
&com.xw.repo.VectorCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_gray_light"
android:gravity="center_vertical"
android:padding="16dp"
android:text="Next"
android:textSize="16sp"
app:drawableRightCompat="@drawable/svg_ic_arrow_right"
app:tintDrawableInTextColor="true"/&
Tips:存在这样一种情形,连续两个控件(编号1和2)都来加载同一张svg图,svg的本来颜色是A,控件1将颜色改为了B,控件2也加载这张svg,颜色却变为了B,这应该是Android系统对矢量图的缓存造成的。解决办法是把svg的本来颜色改为B,控件2再改为颜色A。(好绕,不过一般不会遇到)
MenuItem就是在res/menu/目录下通过xml配置的菜单,适用于NavigationView的menu属性和Activity中onCreateOptionsMenu()注入的选项菜单。
前一阵做了一个小应用叫“简影讯”,发现MenuItem是可以完美支持矢量图的,而且也可以自动跟随文字颜色改变颜色。且看证明:
自适应颜色
简影讯(开源地址:),是一枚基于Retrofit+RxJava+MVP+Colorful多彩主题框架开发的高颜值影讯app。简约,优雅,精彩,即看即走。欢迎在应用宝或360手机助手下载围观。该项目除ic_launcher外,所有的图标都是矢量图。“是时候全面使用矢量图了。”
VectorDrawable 转 Bitmap
自定义View中也可以自由使用矢量图。首先需要将VectorDrawable 转为 Bitmap,看码:
public Bitmap getBitmapFromVectorDrawable(Context context, int drawableId) {
Drawable drawable = ContextCompat.getDrawable(context, drawableId);
if (Build.VERSION.SDK_INT & Build.VERSION_CODES.LOLLIPOP) {
drawable = (DrawableCompat.wrap(drawable)).mutate();
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(),
Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
执行以上方法获得一个Bitmap的实例(设为mVectorBitmap),然后再在ondraw()里根据你的需求画出bitmap:
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawBitmap(mVectorBitmap, left, top, paint);
矢量图的优点一大把,但也不是万能的。矢量图特别适合icon图标的应用场景,但是不能用于比如加载相册时,设置的placeholder或者error这类需要频繁切换回收的应用场景,否则会造成非常明显的卡顿,因为矢量图是不被硬件加速支持的。
Android 5.0推出已经有些年份了,也不知道Android开发圈对矢量图的使用情况,但知道比如微信这些大厂早已全面推广使用。然而在本人周边似乎自己算先驱了,所以才有了把过程中的一些经验总结分享出来的想法。
毕竟本人才疏学浅,难免有纰漏之处,请大神轻拍砖,并不吝赐教。若对后来学习者有帮助,那花这一天码的字自然也超值了,希望共勉。
关于我:GitHub: e-mail: 梯子推荐:最近打算换工作,若有工作机会,请给我发邮件,坐标成都,谢谢。
/woxingxiao}

我要回帖

更多关于 vector c 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信