Head first C # Chinese Version chapter 13th controls and graphics page601

Source: Internet
Author: User

Graphics can solve our transparency problems

You may have come up with drawimage.
() Method is the key to solving overlapping issues. Let's solve the problem!


Add a drawbee
() Method, which is used to use any
Graphics
Object To draw a bee. It uses
Drawimage
() Method, which accepts
Rectangle
To define where to draw and its size.


Below is the new click of the form
Event processor. It draws the upper left corner of the beehive outside the form and places it in (
-Width
,
-Height
). And
Drawbee
() Method to draw four bees.


... But there is a problem.

When you drag the form out of the screen and then drag it back, the image disappears! Return to the original "nectar here"
"Program, the same problem!

What do you think is wrong?

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.