circle

JavaScript实现简单轮播图动画

我怕爱的太早我们不能终老 提交于 2019-12-02 11:08:37
运行效果: 源代码: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>轮播图</title> </head> <style type="text/css"> * { margin: 0px; padding: 0px } #container { margin: 30px auto; width: 1280px; height: 720px; position: relative; overflow: hidden; } #inner-list { width: 400%; position: absolute; top: 0; left: 0; } #inner-list li { float: left; } #dot-list { position: absolute; bottom: 20px; right: 20px; } #dot-list li { float: left; display: inline-block; width: 20px; height: 20px; border-radius: 50%; line-height: 20px; text-align: center; background: rgba(255, 255, 255, .3); cursor:

C++中多态实现的关键——虚函数

删除回忆录丶 提交于 2019-12-02 09:13:37
1.多态的作用 在面向对象程序设计中,使用多态能够增强代码的可扩充性,,即程序需要增加或修改部分功能时,只需修改少量代码就能够达到目的,此外多态也能起到精简代码的作用。 而实现多态的关键点,就是虚函数如何使用。 虚函数 1.虚函数的使用方法 .基同类与派生类同时拥有的同名同参数表的函数,在设计时,最好将其声明为虚函数,只需在函数前面加上关键字virtual即可 下面通过一个具体的例子来说明 #include<iostream> using namespace std; class Shape{ public: void Printf(){ cout<<" The Shape has been called"<<endl; } }; class Rectangle:public Shape{ public: void Printf(){ cout<<"The Rectangle has been called"<<endl; } }; class Circle:public Shape{ public: void Printf(){ cout<<"he Circle has been called"<<endl; } }; void Print(Shape &a) { a.Printf(); } void Print(Rectangle &a) { a.Printf(); }

传递基本类型参数和传递引用类型参数的区别

∥☆過路亽.° 提交于 2019-12-02 09:12:41
public class Circle { public double radius ; public Circle ( double newRadius ) { radius = newRadius ; } } public class Test { public static void main ( String [ ] args ) { Circle c1 = new Circle ( 1 ) ; Circle c2 = new Circle ( 2 ) ; swap1 ( c1 , c2 ) ; System . out . println ( "After swap1: c1= " + c1 . radius + " c2= " + c2 . radius ) ; swap2 ( c1 , c2 ) ; System . out . println ( "After swqp2: c1= " + c1 . radius + " c2= " + c2 . radius ) ; } public static void swap1 ( Circle x , Circle y ) { Circle temp = x ; x = y ; y = temp ; } public static void swap2 ( Circle x , Circle y ) { double

简单tirtle画笑脸

给你一囗甜甜゛ 提交于 2019-12-01 23:28:59
import turtle pen首字母大写 t = turtle.Pen() 先画圆 t.begin_fill() t.color("yellow") t.circle(115,360) t.end_fill() 换点的位置,画嘴 t.color('brown') t.up() t.goto(-90,90) t.down() t.pensize(3) t.seth(-80) t.circle(90,160) 再次换位置,画左眼 t.up() t.goto(-15,160) t.down() t.pensize(20) t.seth(165) t.color('white') t.circle(95,45) 左眼球 t.up() t.goto(-85,155) t.down() t.begin_fill() t.color("black") t.circle(2,360) t.end_fill() 重复上一过程,画右眼 t.up() t.goto(85,160) t.down() t.pensize(20) t.seth(165) t.color('white') t.circle(95,45) t.up() 右眼球 t.goto(15,155) t.down() t.begin_fill() t.color("black") t.circle(2,360) t.end_fill(

jQuery实现图片轮播

南楼画角 提交于 2019-12-01 11:23:42
html代码 <div id="banner"> <ul id="imgList"> <li><a href="#"><img src="img/1bg_shoulei.jpg" alt=""></a></li> <li><a href="#"><img src="img/2bg_xnet.jpg" alt=""></a></li> <li><a href="#"><img src="img/3bg_member.jpg" alt=""></a></li> <li><a href="#"><img src="img/4bg_xkn.jpg" alt=""></a></li> <li><a href="#"><img src="img/5bg_xav.jpg" alt=""></a></li> </ul> <div id="circle"> </div> <div id="focus"> <span id="focusLeft"><</span> <span id="focusRight">></span> </div> </div> css代码 *{ padding: 0; margin: 0; } #banner{ width: 730px; height: 454px; margin: 100px auto; border: 1px solid #ccc; overflow:

环状进度条progress bar circle

主宰稳场 提交于 2019-11-30 02:34:27
2014-08-05 https://ag3.sap.corp:44354/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sap/zprod_ui5/progress.htm 实现原理: index.js里以100毫秒为时间间隔定期执行一个匿名函数. 在这个函数里,动态设置当前progress circle的class。 可以在chrome console里观察到该函数周期性的执行: 在html file里,每个1%的进度都有一组对应的class。每个class通过transform 实现动画效果。 可以在chrome 里观察到degree的变化: 该例子来自: http://www.html5tricks.com/css3-3d-circle-progress.html 要获取更多Jerry的原创文章,请关注公众号"汪子熙": 来源: https://blog.csdn.net/i042416/article/details/101001336

OC1-OC面向对象新概念解释及其面向对象编程

牧云@^-^@ 提交于 2019-11-29 23:03:11
一.C语言主要是面向过程,OC中开始大量使用面向对象。对于在以后的问题中有了面向对象和面向过程两种思考模式。就五子棋而言,面向过程是具体操作步骤,设计思路就是首先分析问题的步骤:1、开始游戏 ,2、黑子先走,3、绘制画面,4、判断输赢,5、轮到白子,6、绘 制画面,7、判断输赢,8、返回步骤2,9、输出最后结果。把上面 每个步骤用分别的函数来实现,问题就解决了;面向对象是玩家,棋盘,规则这三个对象,比较宏观,面向对象的设计则是从另外的思路来解决问题。整个五子棋可以 分为 1、黑白双方,这两方的行为是一模一样的,2、棋盘系统,负 责绘制画面,3、规则系统,负责判定诸如犯规、输赢等。第一类对 象(玩家对象)负责接受用户输 入,并告知第二类对象(棋盘对象 )棋子布局的变化,棋盘对象接收到了棋子的i变化就要负责在屏幕 上面显示出这种变化,同时利用第三类对象(规则系统)来对 棋局 进行判定。 面向对象编程(Object-Oriented Progamming)的首字母缩写为OOP,这是一种常用的 编程技术,最初是为了编写模拟程序而开发的。 二.面向对象有三个概念类、对象、方法。类定义了事物中的属性和它的行为,对象是类的实例,方法是一个类能做的事情。 1、类(class)是一种表示对象类型的结构体,对象通 过它的类来获取自身的各种信息,尤其是执行每个操作都 需要运行的代码

《Thinking in Java》Eight 多态

牧云@^-^@ 提交于 2019-11-29 23:02:05
在OOP编程语言中,多态是继数据抽象和继承之后的第三种基本特征。 动态绑定(后期绑定/运行时绑定):在运行时根据对象的类型进行绑定。也就是编译器一直不知道对象的类型,但方法调用机制能找到正确的方法体并加以调用。draw()方法的所有调用都是通过动态绑定进行的,由随机产生几何形状可以看出,编译器事先不知道哪些对象会调用draw(),都是在运行时动态绑定的。 package Eight; import java.util.Random; class Shape{ public void draw(){ System.out.println("Shape draw"); } public void out(){ System.out.println("Shape"); } } class Circle extends Shape{ public void draw(){ System.out.println("Circle draw"); } public void out(){ System.out.println("Circle"); } } class Square extends Shape{ public void draw(){ System.out.println("Square draw"); } public void out(){ System.out.println

opencv中的按位运算

自作多情 提交于 2019-11-29 18:46:32
import numpy as np import cv2 import matplotlib.pyplot as plt def show(image): plt.imshow(image) plt.axis('off') plt.show() def imread(image): image=cv2.imread(image) image=cv2.cvtColor(image,cv2.COLOR_BGR2RGB) return image rectangle=np.zeros((300,300,3),dtype='uint8') #我们来画一个矩形 white=(255,255,255) cv2.rectangle(rectangle,(25,25),(275,275),white,-1) show(rectangle) circle=np.zeros((300,300,3),dtype='uint8') cv2.circle(circle,(150,150),150,white,-1) show(circle) #AND操作,有黑就变黑 image=cv2.bitwise_and(circle,rectangle) show(image) #or操作,有白就变白 image=cv2.bitwise_or(circle,rectangle) show(image) #XOR操作

svg实现圆环进度条

ⅰ亾dé卋堺 提交于 2019-11-29 10:31:59
<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <title>圆环进度条</title> <style type="text/css"> circle{ -webkit-transition: stroke-dasharray .25s; transition: stroke-dasharray .25s; } </style> <script> window.onload = function () { if (window.addEventListener) { var range = document.querySelector("#range"); var circle = document.querySelectorAll("circle")[1]; if (range && circle) { range.addEventListener("change", function () { console.log(this.value,2*Math.PI*50); var percent = this.value / 100, lineLength = 2*Math.PI * 50; circle.setAttribute('stroke-dasharray', lineLength* percent + " "