Canvas learning diary 1: canvas learning Diary

Source: Internet
Author: User

Canvas learning diary 1: canvas learning Diary

As a result of my work, canvas is one of the most powerful elements of html5. Using it can do some wonderful things in the browser. You have heard more or less about the powerful use of canvas. I will not go into details here.

The powerful function of canvas is represented by the context object of canvas. This environment variable can be obtained from the canvas element.

Next, let's take a look at the canvas example for ease of explanation. A string is displayed on the canvas, which is roughly perpendicular to the canvas. The Code is as follows:

<!DOCTYPE HTML>

In the preceding html code, css is used to set the canvas background color and other css attributes. Therefore, you can set css styles like other div and h1 elements in canvas. Canvas is not interesting in that it can be set to be a style, but in javascript code. Below I wrote the canvas program in the above html. The Code is as follows:

<script type="text/javascript">    var canvas = document.getElementById('canvas'),        context = canvas.getContext('2d');            context.font = '38pt Arial';    context.fillStyle = 'cornflowerblue';    context.strokeStyle = 'blue';        context.fillText('Hello Canvas', canvas.width / 2 - 150, canvas.height / 2 + 15);    context.strokeText('Hello Canvas', canvas.width / 2 - 150, canvas.height / 2 + 15);</script>  

The preceding javascript code consists of three steps:
1. Use document. getElementById to obtain the canvas Element.
2. Call the getContext ('2d ') method on the canvas object to obtain the drawing environment variable.
3. Use the drawing environment object to draw on the canvas element.

FillStyle and strokeStyle specify the color, gradient, or pattern used when the image is filled and the path is stroke.

FillText () and strokeStyle both require three parameters: the content of the text to be drawn and the horizontal and vertical coordinates of the text displayed in the canvas.

Ps: You cannot use the px suffix when setting the width and height of a canvas. Although many browsers support the px suffix, it is not technically accepted by the canvas specification, these values can only be non-negative.

There are two ways to set the width and height of a canvas: one is to directly specify the attribute values for the width and height of a canvas, and the other is to set the width and height in css. However, this setting will produce unexpected results. This shows the size of the canvas element and the drawing surface.


The two elements are the same in size, but the plot is different. In fact, we mainly modify the width and height attributes to set the size of the canvas element. In this way, the size of the element itself and the painting surface will be set to the attribute value. The width and height values set through css only modify the element size and do not modify the painting surface size. Therefore, the browser will change the painting surface from the default value (300*150) stretch to the modified value (600*300 ).

Canvas is a very powerful element. All I know now is to understand the canvas element. It still takes a long time to learn, day up.

 


Find a learning Diary

A diary
I am about to enter the hall of knowledge and become a qualified middle school student, but I do not select a school. I chose an ordinary school close to my home.
During the summer vacation, many students are eager to choose a school. Their parents spend money to choose a school. My mood was quite dull, and I watched it with a cold eye. I have already convinced my mother not to choose a school. My family depends on my father to support his family. The money is hard to come. Every month, I have a high overhead and I have to pay for the loan. In addition, when my grandmother is ill, I cannot choose a school. I should save my mother's money for choosing a school to help my grandmother.
Even if you choose a school, your academic performance is not necessarily good. For example, some people think that they have entered a good resource School and think they have entered a safe deposit box. If you do not study well, your score will plummet. It is important to choose a good school. However, people are doing things. The development of everything depends on internal factors, and the final achievement depends on their own efforts. Therefore, I insisted on not selecting a school and made preparations for the school. As long as I work hard, earnestly, and modestly, I believe that I will become a good student with excellent performance.
The school is about to begin. To prove to everyone, I have developed a learning plan since the summer vacation. 1. Meet the new school with high enthusiasm, embrace my junior high school trip, put down the heavy ideological burden, smile, bring the ideal, and put it in the light. 2. Prepare for my studies. I have learned the primary course of my first day during the summer vacation, recorded the difficulties in my studies, sort out the outline of the course to be learned. 3. Buy an excerpt from an essay, roam in the article, accumulate some good words and sentences, and learn to apply them. 4. Buy a bicycle and go to school by yourself. 5. Make full use of every second.
The school is about to begin. I have prepared for a new school and a new start. Let sunshine take me into a good junior high school student!
Two diaries
I have two turtles in my house. They eat and play together. They are very cute.

Every night, the first thing I do is get something delicious in the kitchen and feed the two clever turtles. You see, the two little guys seem to have heard of my footsteps. They have been crawling in a hurry and waiting for me to feed it. I saw it stretched out my neck and opened a sharp mouth, as if to say to me: "I haven't eaten for a day, so I have to eat it for me ." At this time, I deliberately Teased them. I put the food in the east and put it in the West. The two turtles ran with great effort and they looked really funny, call me to give them food after they are full of fun. They eat with relish. The big turtle is really arrogant. It has eaten a lot, for fear of not enough to eat, it will not small turtles to squeeze aside, their own mouth to eat. At this moment, I saw the turtle strange, so I pushed the turtle away and asked the turtle to eat enough. The turtle seemed very grateful to me and put a small tail while eating.

After eating the food, they played happily. You see, the little turtle is too brave to climb to the back of the big turtle, and the big turtle does not resist at all, but also crawls slowly carrying it. Maybe the big turtle felt too tired, And suddenly his neck stretched down to the bottom of the cylinder and turned over, the little turtle fell down. But the little turtle did not give up, or climbed to the big turtle body, the big turtle can not, had to let the little turtle to go, until enough to play, just in the glass cylinder corner of the sleeping.

The turtle has been raised for more than six years and has become my friend. It will accompany me to grow up. How nice it would be if I could live as long as it does! We can see a better world.

Summary of the learning diary for one semester

The end of the semester is over. This semester, I will strive to achieve my learning objectives, continuously improve my own quality, and improve my business level, while doing my job well, I do not forget to strengthen my learning. I will summarize my learning this semester as follows:

According to the requirements of the School for teachers, I learned new education and teaching concepts in many aspects in the spirit of the new curriculum reform this semester. be familiar with teaching work procedures, master teaching methods and art, train basic teaching skills, cultivate a rigorous work style, and lay a good foundation for academic research based on the existing professional settings. Effectively Realize the organic combination of work learning and work learning. I actively participate in political theory studies, earnestly understand the relevant principles and policies of the CPC Central Committee, and constantly improve my political quality. Make full use of your spare time, strengthen your learning, and absorb more new ideas and ideas. Use the spare time of this semester to expand your knowledge so that you can learn more and be comfortable in teaching. They have comprehensively improved their teaching level and business level. By studying theoretical knowledge, I am combined with practice to boldly try and seize every opportunity to exercise myself. At the same time, we will strengthen personal reflection and constantly improve our teaching practices based on our actual situation.

During my self-study this semester, I basically realized my own learning content. First, I improved my business level. I learned the books specified by the school leaders, to improve your professional skills. Secondly, I learned some knowledge about the new curriculum reform. Our country's full implementation of the new curriculum reform will not accelerate our own learning in this area, and our thoughts will lag behind. Therefore, it is essential to improve our own level. Finally, I learned some other books that help me to store my own knowledge. Now, students have a wide range of knowledge. as teachers, we cannot only understand our teaching materials and related content, on this basis, we must learn more about other aspects and strengthen our knowledge reserves to adapt to the rapid development of our country. My basic skills have also been well trained.

In my daily teaching work, I took all the time to charge myself. Actively participate in teaching and research activities to learn educational theories. In preparing lessons, I listened carefully to others' teaching opinions and made records to lay a solid foundation for improving the quality of teaching in the future. I also leave traces for my Self-study in the form of self-study notes, which will be of great help to my study summary today. In education and teaching, if you encounter problems that you do not understand, you dare to face them. Instead, you must never pass on wrong knowledge to students. If you do not understand them, you can ask questions and learn from them with an open mind. At the same time, I also asked other old teachers to learn more about the strengths of others in education and teaching, to make up for their own shortcomings and to continuously improve in practice.

After one semester of theoretical study, I have further improved my business level and knowledge reserve, and my practical ability has also been further improved.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.