开发者

Drawing Images in C#? [closed]

开发者 https://www.devze.com 2023-02-05 09:02 出处:网络
It's difficult to tell what is being asked here开发者_Python百科. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current for
It's difficult to tell what is being asked here开发者_Python百科. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

I got a image which is loaded from a file and I want to add it to my Windows Form, however I don't just want to draw it on the form, I am looking for a nice effet to draw it.

I thought of drawing line by line of the image, any ideas?


You can simply draw an image on the form in its paint event by using its Graphics.

use this:

      Image newImage = Image.FromFile("<path to your image>");
      this.Graphics.DrawImage(newImage, new Point(100, 100));

Instead of 100,100 give the x,y position of your form where you want the top-left corner of the image to be

Update

To do animation you have two options and both of them requires that you have your Processor Intensive task to be on another thread(If you have any)

1) First would be to have an Animated GIF and then draw it on your Form

2) Second way is to draw Time based images on the form with a timer to create a animated effect. just update the image on on each tick/interval and have it in a loop if you want to repeat it. here is a link that explains the second approach with an example (just Googled).

http://www.c-sharpcorner.com/UploadFile/mgold/AnimationComponent09142005062332AM/AnimationComponent.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消