Drawing Images in C#? [closed]
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
精彩评论