圆形矢量场field driven strength效果
/************中心环形矢量场*马鞍矢量场*****卷积白噪声纹理***********/#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <cv.h>
#include <ml.h>
#include <highgui.h>
#include <iostream>
using namespace std;//#define SQUARE_FLOW_FIELD_SZ 400
#define DISCRETE_FILTER_SIZE 2048 //离散的滤波尺寸,
#define LOWPASS_FILTR_LENGTH 10.00000f //低通滤波长度,滤波核kernel
#define LINE_SQUARE_CLIP_MAX 100000.0f //线性平方夹
#define VECTOR_COMPONENT_MIN 0.050000f //矢量分量最小值void CenterFiled(int n_xres, int n_yres, float* pVectr);
void NormalizVectrs(int n_xres, int n_yres, float* pVectr,float* vecSize,float*normMag);
void GenBoxFiltrLUT(int LUTsiz, float* p_LUT0, float* p_LUT1);
void MakeWhiteNoise(int n_xres, int n_yres, float* pNoise);
void nNoise(int n_xres, int n_yres, float* pNoise,float*pVectr,float*newNoise,float* normMag);
void FlowImagingLIC(int n_xres, int n_yres, float* pVectr, float* newNoise, float* pImage, float* p_LUT0, float* p_LUT1, float krnlen);
void WriteImage2PPM(int n_xres, int n_yres, float* pImage, char* f_name);
void gray(int n_xres,int n_yres,float * pImage);
void color(int n_xres, int n_yres,float *pImage,float* vecSize);
double maxvecmag;void main()
{
// int n_xres = SQUARE_FLOW_FIELD_SZ;
// int n_yres = SQUARE_FLOW_FIELD_SZ;
// float* pVectr = (float* ) malloc( sizeof(float ) * n_xres * n_yres * 2 );
// float* p_LUT0 = (float* ) malloc( sizeof(float ) * DISCRETE_FILTER_SIZE);
// float* p_LUT1 = (float* ) malloc( sizeof(float ) * DISCRETE_FILTER_SIZE);
// float* pNoise = (float* ) malloc( sizeof(float) * n_xres * n_yres );
// float* pImage = (float* ) malloc( sizeof(float) * n_xres * n_yres );//NormalizVectrs(n_xres, n_yres, pVectr);// int info[2];
// FILE* fp = fopen("fieldfile/Flow_16.vec", "rb"); //打开矢量场数据文件
// fread(info,sizeof(int),2,fp);int n_yres=400;int n_xres =400;float* pVectr = (float* ) malloc( sizeof(float ) *n_xres*n_yres* 2 );float* p_LUT0 = (float* ) malloc( sizeof(float ) * DISCRETE_FILTER_SIZE);//设置滤波器参数float* p_LUT1 = (float* ) malloc( sizeof(float ) * DISCRETE_FILTER_SIZE);float* pNoise = (float* ) malloc( sizeof(float) *n_xres*n_yres );float* pImage = (float* ) malloc( sizeof(float) * n_xres*n_yres );float* vecSize = (float* ) malloc( sizeof(float) * n_xres*n_yres );float* newNoise = (float* ) malloc( sizeof(float) *n_xres*n_yres );float* normMag = (float* ) malloc( sizeof(float) *n_xres*n_yres );// cout<<"row="<<n_xres<<";"<<"col="<<n_yres<<endl;// //float * pVectr = new float[row*col*2];//fread(pVectr,sizeof(float),n_xres*n_yres*2,fp);//读入矢量场数据,是未归一化的矢量场CenterFiled(n_xres, n_yres, pVectr);NormalizVectrs(n_xres, n_yres, pVectr,vecSize,normMag);//利用刘占平的数据文件必须有归一化MakeWhiteNoise(n_xres, n_yres, pNoise);nNoise(n_xres,n_yres,pNoise,pVectr,newNoise,normMag);GenBoxFiltrLUT(DISCRETE_FILTER_SIZE, p_LUT0, p_LUT1);FlowImagingLIC(n_xres, n_yres, pVectr, newNoise, pImage, p_LUT0, p_LUT1, LOWPASS_FILTR_LENGTH);gray(n_xres,n_yres,pImage);color(n_xres, n_yres,pImage,vecSize);//WriteImage2PPM(n_xres, n_yres, pImage, "LIC.ppm");//system("pause");
// fclose(fp);
// fp=NULL;free(pVectr); pVectr = NULL;free(p_LUT0); p_LUT0 = NULL;free(p_LUT1); p_LUT1 = NULL;free(pNoise); pNoise = NULL;free(pImage); pImage = NULL;}/// 中心环形矢量场图形 synthesize a saddle-shaped vector field ///
void CenterFiled(int n_xres, int n_yres, float* pVectr)
{ float vec_x = 0.0f;float vec_y = 0.0f;float vcMag = 0.0f;float scale = 0.0f;for(int i = 0; i < n_xres; i ++){for(int j = 0; j < n_yres; j ++){ int index = i*n_yres+j;vec_x = -(float)i/n_xres+0.5f;vec_y = (float)j/n_yres-0.5f;// vec_x = -i/n_xres+0.5f;//如果不进行float形式转化,生成的矢量场不正确// vec_y = j/n_yres-0.5f;// vcMag = sqrt(vec_x*vec_x+vec_y*vec_y);
// scale = (vcMag<0.001f)?0.0f:1.0f/vcMag;
// vec_x*=scale;
// vec_y*=scale;pVectr[2*index]=vec_x;pVectr[2*index+1]=vec_y;// int index = ( (n_yres - 1 - j) * n_xres + i ) << 1;//向左移动一位// pVectr[index ] = - ( j / (n_yres - 1.0f) - 0.5f );// cout<<"pVectr[index ]="<<pVectr[index ];// pVectr[index + 1] = i / (n_xres - 1.0f) - 0.5f; // cout<<"pVectr[index ]="<<pVectr[index +1 ];}}
}/// normalize the vector field ///
void NormalizVectrs(int n_xres, int n_yres, float* pVectr,float* vecSize,float*normMag)
{
// float* vecSize = (float* ) malloc( sizeof(float) * n_xres*n_yres );double magind;double scale;double mag;double x=10;;矢量归一化**与**矢量大小归一化不一样//矢量归一化如下:for(int j = 0; j < n_yres; j ++)for(int i = 0; i < n_xres; i ++)//图像时竖着绘制的,一列一列的画的{ int index = (j * n_xres + i) << 1;//0,2,4,6,8...向左移一位,index值加2,因为有vec_x,vec_y代表一个像素点的矢量值float vcMag = float( sqrt( double(pVectr[index] * pVectr[index] + pVectr[index + 1] * pVectr[index + 1]) ) );vecSize[j * n_xres + i]=vcMag;//存储矢量原始大小//cout<<"vcmag="<<vcMag<<endl;if (vcMag>maxvecmag){maxvecmag=vcMag;}//cout<<vcMag<<endl;float scale = (vcMag == 0.0f) ? 0.0f : 1.0f / vcMag;//矢量大小归一化后的矢量值//cout<<"scale"<<scale<<endl;//normMag[j*n_yres+i] = scale;pVectr[index ]=pVectr[index ]*scale;pVectr[index + 1] *= scale;}for(int j = 0; j < n_yres; j ++)for(int i = 0; i < n_xres; i ++)//图像时竖着绘制的,一列一列的画的{ //归一化矢量大小normMag[j * n_xres + i] = (float)vecSize[j * n_xres + i]/maxvecmag;//cout<< normMag[j * n_xres + i]<<endl;}
}/// make white noise as the LIC input texture ///
void MakeWhiteNoise(int n_xres, int n_yres, float* pNoise)
{ IplImage * NoiseImg=cvCreateImage(cvSize(n_yres,n_xres),IPL_DEPTH_8U,1);CvScalar s;for(int j = 0; j < n_yres; j ++){for(int i = 0; i < n_xres; i ++)// for(int j = 0; j < n_yres; j=j +10)//产生稀疏白噪声// {// for(int i = 0; i < n_xres; i=i+10){ int r = rand();r = ( (r & 0xff) + ( (r & 0xff00) >> 8 ) ) & 0xff;pNoise[j * n_xres + i] = (float) r;s = cvGet2D(NoiseImg,i,j);s.val[0]=r;s.val[1]=r;s.val[2]=r;cvSet2D(NoiseImg,i,j,s);}}}void nNoise(int n_xres, int n_yres, float*pNoise,float* pVectr,float*newNoise,float* normMag)
{for(int j = 0; j < n_yres; j ++){for(int i = 0; i < n_xres; i ++){ newNoise[j*n_yres+i]=255*normMag[j*n_yres+i]+pNoise[j*n_yres+i]-128;}}
}
/// generate box filter LUTs ///
void GenBoxFiltrLUT(int LUTsiz, float* p_LUT0, float* p_LUT1)
{ for(int i = 0; i < LUTsiz; i ++) p_LUT0[i] = p_LUT1[i] = i;
}/// flow imaging (visualization) through Line Integral Convolution ///
void FlowImagingLIC(int n_xres, int n_yres, float* pVectr, float* newNoise, float* pImage, float* p_LUT0, float* p_LUT1, float krnlen)
{ int vec_id; ///ID in the VECtor buffer (for the input flow field)int advDir; ///ADVection DIRection (0: positive; 1: negative)int advcts; ///number of ADVeCTion stepS per direction (a step counter)int ADVCTS = int(krnlen * 3); ///MAXIMUM number of advection steps per direction to break dead loops //跳出死循环的条件float vctr_x; ///x-component of the Vector at the forefront pointfloat vctr_y; ///y-component of the Vector at the forefront pointfloat clp0_x; ///x-coordinate of CLiP point 0 (current)float clp0_y; ///y-coordinate of CLiP point 0 (current)float clp1_x; ///x-coordinate of CLiP point 1 (next )float clp1_y; ///y-coordinate of CLiP point 1 (next )float samp_x; ///x-coordinate of the Sample in the current pixelfloat samp_y; ///y-coordinate of the Sample in the current pixelfloat tmpLen; ///Temporary Length of a trial clipped-segment实验剪辑片段的临时长度float segLen; ///Segment Lengthfloat curLen; ///Current Length of the streamlinefloat prvLen; ///Previous Length of the streamline float W_ACUM; ///Accumulated Weight from the seed to the current streamline forefrontfloat texVal; ///Texture Valuefloat smpWgt; ///Weight of the current Samplefloat t_acum[2]; ///two Accumulated composite Textures for the two directions, perspectively 两个方向的纹理卷积累加和float w_acum[2]; ///two Accumulated Weighting values for the two directions, perspectively 两个方向的权重和float* wgtLUT = NULL; ///WeiGhT Look Up Table pointing to the target filter LUT权重查找表float len2ID = (DISCRETE_FILTER_SIZE - 1) / krnlen; ///map a curve Length To an ID in the LUTdouble scale;//颜色映射表比例double maxmag;double magind;double mag;double x = 0.1;//x为非线性映射因子,且x!=1IplImage * licImage = cvCreateImage(cvSize(n_yres,n_xres),IPL_DEPTH_8U,3);CvScalar s;///for each pixel in the 2D output LIC image///对输出图像的每一个像素for(int j = 0; j < n_yres; j ++){for(int i = 0; i < n_xres; i ++){ ///init the composite texture accumulators and the weight accumulators///每一个像素点为起始点,初始化一次权重和卷积和t_acum[0] = t_acum[1] = w_acum[0] = w_acum[1] = 0.0f;//初始化正反方向卷积和及权重和///for either advection direction///分别计算正反方向的卷积和及权重和for(advDir = 0; advDir < 2; advDir ++){ ///init the step counter, curve-length measurer, and streamline seed/////初始化当前方向上前进的步数和当前流线的总长advcts = 0;//前进的步数curLen = 0.0f;clp0_x = i + 0.5f;//当前点的坐标clp0_y = j + 0.5f;///access the target filter LUT///LUT显示查找表wgtLUT = (advDir == 0) ? p_LUT0 : p_LUT1;//当前噪声点所对应的权重系数///until the streamline is advected long enough or a tightly spiralling center / focus is encountered///while( curLen < krnlen && advcts < ADVCTS ) //??????{///access the vector at the sample///vec_id = ( int(clp0_y) * n_xres + int(clp0_x) ) << 1;//vec_id相当于indexvctr_x = pVectr[vec_id ];//clp0_y相当于当前像素列坐标,clp0_x相当于当前像素的横坐标vctr_y = pVectr[vec_id + 1];///in case of a critical point///遇到零向量,结束循环if( vctr_x == 0.0f && vctr_y == 0.0f ){ t_acum[advDir] = (advcts == 0) ? 0.0f : t_acum[advDir]; ///this line is indeed unnecessaryw_acum[advDir] = (advcts == 0) ? 1.0f : w_acum[advDir];break;}///negate the vector for the backward-advection case///相反的方向取相反的方向vctr_x = (advDir == 0) ? vctr_x : -vctr_x;//因为矢量是用x,y方向的值合成的,所以反向的值就是负的vctr_y = (advDir == 0) ? vctr_y : -vctr_y;//这儿可以就计算矢量大小、归一化运算????????????前面已经归一化了//。。。。。。//
// mag= sqrt(vctr_x*vctr_x+vctr_y*vctr_y);
// if (mag>maxmag)
// {
// maxmag=mag;
// }///clip the segment against the pixel boundaries --- find the shorter from the two clipped segments//////replace all if-statements whenever possible as they might affect the computational speed///影响算法计算速度segLen = LINE_SQUARE_CLIP_MAX;segLen = (vctr_x < -VECTOR_COMPONENT_MIN) ? ( int( clp0_x ) - clp0_x ) / vctr_x : segLen;//int(0.5)=0segLen = (vctr_x > VECTOR_COMPONENT_MIN) ? ( int( int(clp0_x) + 1.5f ) - clp0_x ) / vctr_x : segLen;segLen = (vctr_y < -VECTOR_COMPONENT_MIN) ? ( ( ( tmpLen = ( int( clp0_y) - clp0_y ) / vctr_y ) < segLen ) ? tmpLen : segLen ) : segLen;segLen = (vctr_y > VECTOR_COMPONENT_MIN) ?( ( ( tmpLen = ( int( int(clp0_y) + 1.5f ) - clp0_y ) / vctr_y ) < segLen ) ? tmpLen : segLen ) : segLen;///update the curve-length measurers///prvLen = curLen;curLen+= segLen;//segLen是单步步长segLen+= 0.0004f;//步长???// segLen+= 0.0001f;//步长???///check if the filter has reached either end///segLen = (curLen > krnlen) ? ( (curLen = krnlen) - prvLen ) : segLen;///obtain the next clip point///clp1_x = clp0_x + vctr_x * segLen;clp1_y = clp0_y + vctr_y * segLen;///obtain the middle point of the segment as the texture-contributing sample///samp_x = (clp0_x + clp1_x) * 0.5f;samp_y = (clp0_y + clp1_y) * 0.5f;///obtain the texture value of the sample///texVal = newNoise[ int(samp_y) * n_xres + int(samp_x) ];///update the accumulated weight and the accumulated composite texture (texture x weight)///W_ACUM = wgtLUT[ int(curLen * len2ID) ];smpWgt = W_ACUM - w_acum[advDir]; w_acum[advDir] = W_ACUM; t_acum[advDir] += texVal * smpWgt;//当前噪声点的权重系数///update the step counter and the "current" clip point///advcts ++;clp0_x = clp1_x;clp0_y = clp1_y;///check if the streamline has gone beyond the flow field///if( clp0_x < 0.0f || clp0_x >= n_xres || clp0_y < 0.0f || clp0_y >= n_yres) break;} }///normalize the accumulated composite texture///texVal = (t_acum[0] + t_acum[1]) / (w_acum[0] + w_acum[1]);///clamp the texture value against the displayable intensity range [0, 255]texVal = (texVal < 0.0f) ? 0.0f : texVal/255;//cout<<"texval="<<texVal<<endl;texVal = (texVal > 255.0f) ? 255.0f : texVal; //cout<<texVal<<endl;pImage[j * n_xres + i] = (float) texVal;} }}
void gray(int n_xres,int n_yres,float *pImage)
{CvScalar s;IplImage * GrayImage = cvCreateImage(cvSize(n_yres,n_xres),IPL_DEPTH_8U,1);for (int i = 0;i<GrayImage->width;i++){for (int j = 0;j<GrayImage->height;j++){s.val[0] = pImage[i*n_xres+j]*255;s.val[1] = pImage[i*n_xres+j]*255;s.val[2] = pImage[i*n_xres+j]*255;//cout<<s.val[0]<<endl;cvSet2D(GrayImage,i,j,s);}}cvSaveImage("gray.jpg",GrayImage,0);cvWaitKey(0);IplImage *gray = cvLoadImage("gray.jpg",1);//直方图尺寸int r_bins =256, b_bins = 256; CvHistogram* hist; { int hist_size[] = { r_bins, b_bins }; float r_ranges[] = { 0, 255 }; // hue is [0,180] float b_ranges[] = { 0, 255 }; float* ranges[] = { r_ranges,b_ranges }; hist = cvCreateHist( 2, hist_size, CV_HIST_ARRAY, ranges,1); } cvReleaseImage(&GrayImage);}
// void color(int n_xres,int n_yres,float *pImage,float* vecSize)
// {
// IplImage * licImage = cvCreateImage(cvSize(n_yres,n_xres),IPL_DEPTH_8U,3);
// IplImage* img = cvLoadImage("11.jpg",1);
// //IplImage* destImg = cvCreateImage(cvSize(n_yres,n_xres),IPL_DEPTH_8U,3);
// //int length=img->width;
// int k = 0;
//
// double magind;
// double mag;
// double newMag;
// double x = 0.01;//x为非线性映射因子,且x!=1
//
// CvScalar colorTable[500];
// CvScalar s,s1;
// //cout<<"h="<<img->height<<";"<<"w"<<img->width<<endl;
// //system("pause");
// for (int i = 0;i < img->width;i++)
// {
// s = cvGet2D(img,1,i);
// colorTable[i] =s;
// //cout<<"colorTable[i]="<<colorTable[i].val[0]<<endl;
// }
// for (int i = 0;i<n_xres;i++)
// {
// for (int j= 0; j <n_yres;j++)
// {
//
// if (k>=img->width)
// {
// k=0;
// }
// double scale= pImage[j * n_xres + i];
//
//
// mag = vecSize[j * n_xres + i];
// //cout<<"mag="<<mag<<endl;
// //********矢量大小归一化******
// magind = mag/maxvecmag;
// //cout<<"maxvecmag="<<maxvecmag<<endl;
// //cout<<"magind="<<magind<<endl;
// //非线性颜色增强LIC
// newMag = (pow(x,magind)-1)/(x-1);
// //cout<<"newMag="<<newMag<<endl;
// // cout<<"scale="<<scale<<endl;
//
// //最终的输出颜色值计算如下
// /*color = table[newMag];*/
//
// s = cvGet2D(licImage,i,j);
//
// //渐变颜色映射表
// int k = int(newMag*446);
// s1.val[0]=colorTable[k].val[0]*(k+1-newMag*446)+colorTable[k+1].val[0]*(newMag*446-k);
// s1.val[1]=colorTable[k].val[1]*(k+1-newMag*446)+colorTable[k+1].val[1]*(newMag*446-k);
// s1.val[2]=colorTable[k].val[2]*(k+1-newMag*446)+colorTable[k+1].val[2]*(newMag*446-k);
// s1.val[0]*=scale;
// s1.val[1]*=scale;
// s1.val[2]*=scale;
//
//
// //离散型颜色映射表
// // int destcolorIndext=int(446*mag*100);
// // s1.val[0]=colorTable[destcolorIndext].val[0]*scale;
// // s1.val[1]=colorTable[destcolorIndext].val[1]*scale;
// // s1.val[2]=colorTable[destcolorIndext].val[2]*scale;
//
// cvSet2D(licImage,i,j,s1);
// //cout<<"s1.val[0]="<<s1.val[0]<<endl;
// }
// }
// cvSaveImage("color.jpg",licImage,0);
//
// cvNamedWindow("lic_three channles",0 );
// cvShowImage("lic_three channles",licImage);
// cvWaitKey(0);
// system("pause");
// cvDestroyWindow("lic_three channles");
//
// cvReleaseImage(&licImage);
// }
/// write the LIC image to a PPM file ///
void color(int n_xres,int n_yres,float *pImage,float* vecSize)
{IplImage * licImage = cvCreateImage(cvSize(n_yres,n_xres),IPL_DEPTH_8U,3);IplImage* img = cvLoadImage("11.jpg",1);//IplImage* destImg = cvCreateImage(cvSize(n_yres,n_xres),IPL_DEPTH_8U,3);//int length=img->width; int k = 0;double magind;double mag;double newMag;double x = 0.01;//x为非线性映射因子,且x!=1CvScalar colorTable[500];CvScalar s,s1;//cout<<"h="<<img->height<<";"<<"w"<<img->width<<endl;//system("pause");for (int i = 0;i < img->width;i++){s = cvGet2D(img,1,i);colorTable[i] =s;//cout<<"colorTable[i]="<<colorTable[i].val[0]<<endl;}for (int i = 0;i<n_xres;i++){for (int j= 0; j <n_yres;j++){if (k>=img->width){k=0;}double scale= pImage[j * n_xres + i];mag = vecSize[j * n_xres + i];//cout<<"mag="<<mag<<endl;//********矢量大小归一化******magind = mag/maxvecmag;//cout<<"maxvecmag="<<maxvecmag<<endl;//cout<<"magind="<<magind<<endl;//非线性颜色增强LICnewMag = (pow(x,magind)-1)/(x-1);//cout<<"newMag="<<newMag<<endl;
// cout<<"scale="<<scale<<endl;//最终的输出颜色值计算如下/*color = table[newMag];*/s = cvGet2D(licImage,i,j);//渐变颜色映射表int k = int(newMag*446);s1.val[0]=colorTable[k].val[0]*(k+1-newMag*446)+colorTable[k+1].val[0]*(newMag*446-k);s1.val[1]=colorTable[k].val[1]*(k+1-newMag*446)+colorTable[k+1].val[1]*(newMag*446-k);s1.val[2]=colorTable[k].val[2]*(k+1-newMag*446)+colorTable[k+1].val[2]*(newMag*446-k);s1.val[0]*=scale;s1.val[1]*=scale;s1.val[2]*=scale;//离散型颜色映射表
// int destcolorIndext=int(446*mag*100);
// s1.val[0]=colorTable[destcolorIndext].val[0]*scale;
// s1.val[1]=colorTable[destcolorIndext].val[1]*scale;
// s1.val[2]=colorTable[destcolorIndext].val[2]*scale;cvSet2D(licImage,i,j,s1);//cout<<"s1.val[0]="<<s1.val[0]<<endl;}}cvSaveImage("color.jpg",licImage,0);cvNamedWindow("lic_three channles",0 );cvShowImage("lic_three channles",licImage);cvWaitKey(0);system("pause");cvDestroyWindow("lic_three channles");cvReleaseImage(&licImage);
}
void WriteImage2PPM(int n_xres, int n_yres, float* pImage, char* f_name)
{ FILE* o_file;if( ( o_file = fopen(f_name, "w") ) == NULL ) { printf("Can't open output file\n"); return; }fprintf(o_file, "P6\n%d %d\n255\n", n_xres, n_yres);for(int j = 0; j < n_yres; j ++)for(int i = 0; i < n_xres; i ++){unsigned char unchar = pImage[j * n_xres + i];//某点像素的灰度纹理值CvScalar s;/*s.val[0]s.val[1]s.val[2]fprintf(o_file, "%c%c%c", s.val[0], s.val[1], s.val[2]);//*/fprintf(o_file, "%c%c%c", unchar, unchar, unchar);//}fclose (o_file); o_file = NULL;
}
圆形矢量场field driven strength效果相关推荐
- android圆形点击效果,Android 三种方式实现自定义圆形页面加载中效果的进度条
[实例简介] Android 三种方式实现自定义圆形页面加载中效果的进度条 [实例截图] [核心代码] ad376a86-a9aa-49bc-8cea-321bcff2c0c3 └── AnimRou ...
- html5圆形旋转菜单js,jquery 圆形旋转图片滚动切换效果
这个效果比较特别,可爱,所以在外面网站没怎么看到过,有兴趣的朋友可以下载后自己使用. PS: 经过修改已经兼容大众浏览器. 效果图: 在线演示:http://demo.jb51.net/js/Imag ...
- 精通Android自定义View(十八)自定义圆形菊花加载转圈效果
1 效果: 2 源码: public class LoadingView extends View {public LoadingView(Context context) {this(context ...
- jquery 圆点绕圆旋转_jquery 圆形旋转图片滚动切换效果
这个效果比较特别,可爱,所以在外面网站没怎么看到过,有兴趣的朋友可以下载后自己使用. PS: 经过修改已经兼容大众浏览器. 效果图: 在线演示:http://demo.jb51.net/js/Imag ...
- WPF实现圆形菜单动态展开折叠效果
实现效果如下: 思路:根据子菜单个数计算旋转角度动态生成子菜单,并设置展开折叠动画. 步骤: 1.自定义按钮MyButton,建立展示图像属性DisplayImage public class MyB ...
- Android 三种方式实现自定义圆形页面加载中效果的进度条
转载:http://www.eoeandroid.com/forum.php?mod=viewthread&tid=76872 一.通过动画实现 定义res/anim/loading.xml如 ...
- 精通Android自定义View(十七)自定义圆形鸟巢加载转圈效果
1 效果图 2 源码: public class LoadingView extends View {public LoadingView(Context context) {this(context ...
- 基于光线追踪的渲染中景深(Depth of field)效果的实现
图形学离线渲染中常用的透视摄像机模型时根据小孔成像的原理建立的,其实现通常是从向成像平面上发射ray,并把trace这条ray的结果作为成像平面上对应交点的采样结果.即: 图片来自<Fundam ...
- android 使用BitmapShader实现圆形以及放大镜效果
在一些显示用户头像的时候,大多数都是显示圆形的,而不是显示一个正方形或者长方形,这样显得很呆板,视觉效果也不好看,今天就用二种方式实现图片圆形显示的效果,在先讲这个效果实现之前,讲下BitmapSha ...
- HTML + CSS 实现矩形/圆形进度条效果 - SVG
本文记录通过 HTML + CSS + 部分原生 JS 使用 SVG 嵌入 HTML 文档的用法实现常见的圆形和矩形进度条效果,效果图如下:(实际运行效果是进度条从 0 过渡到一个目标值比如 100% ...
最新文章
- ASP.NET的(HttpModule,HttpHandler)
- 更改管理GPO的域控制器
- 【LeetCode】无重复字符的最长子串【滑动窗口法】
- Session对象的生命周期
- C# json解析字符串总是多出双引号_Python小白必备知识:Python字符串详解
- 一个电脑多个github、gitlab、oschina账户
- 大厂程序员年薪_程序员羡慕深圳老师的待遇:年薪25万起,请问哪个科技厂可以比...
- .Net之代码优先gRPC服务
- tickcount()修改成小时分钟_银行核心系统24小时机制实现总结
- CCF NOI1029 信息加密
- apollo local 模式_「架构」 - 配置中心 Apollo基本使用
- 构造AlertDialog弹出框,根据量值实现然用户选择列表。
- 清华排名首登亚洲第一,今年财务预算300亿
- Android Gradle指南系列
- R语言ETL工程:分组(group_by)
- ant design vue 中select默认选中(V2版本)
- 2022CCPC网络预选赛题解
- Mac苹果 M1配置cocoapods
- 来吧 兄弟萌 我们一起学做粥
- 团队管理_第一期干部训练营心得