How to draw in C# using the Graphics Class - CSharp Programming
Vložit
- čas přidán 16. 07. 2024
- Today we are going to have fun drawing shapes in C#! I'm going to show you how to draw lines, rectangles, circles and images to the screen!!
We are going to build a simple Winforms app that will draw a scene of a cat(?) chasing a chicken(?) with lines and text!
We are going to use the System.Drawing library and more specifically the Graphics class. This isn't going to use Unity or any 3rd party library like MonoGame. This is all just built into the .Net Framework!
This should be a lot of fun and I hope you enjoy it! - Jak na to + styl
Thank you so much for this tutorial!! I was trying to find a way to render graphics in plain C# then i came accross this!
HOW IS THIS NOT AT 1.2 BILLI9M VEIWS? THIS IS LITIRALLY A GODSEND
thanks for uploading this bro, it's useful
Thanks for the tutorial kind man!
PSA : I suggest watching the video in >1.25x speed
thank you , i was looking for a way to convert a panel from windows form to pdf ,
i wasted alot time from other tutorial but they are very low quality pdf . now this method work
Hello, I would like to ask how to move the image? Is it possible to drag it with the mouse and place it somewhere else? I couldnt get it work since these images don't have any event like MouseClick, MouseDown etc
What about the performance? Instead of rendering in unity for example, could it still keep up with other engines?
Thank you so much
The adult graphics part doesn't work.I did what you did in this tutorial and it didn't work.Can you tell me why it didn't work
what is InitializeComponent();? it does not exist from what i can tell.
I can't find windows form app in VS 2022.
How do I know the file of the image I downloaded? And to code it into the Form
nice bro
Thanks!!
I learned a lot from this video, thanks, but how can I do this OUTSIDE the Form's Paint event? Let's say, when I click a button or menu strip, for example?
Simple plan: Create a variable "Should Draw Sprite"
It defaults to False
When the button is clicked, you flip it to True.
You still paint during the paint event but now your painting code checks that variable and if it is True, it will draw the sprite.
This makes it seem like it was drawn when you clicked the button but only the variable changed.
Your painting is still during the paint event and your button shows and hides the sprite. (if you toggle the variable)
Could the music be any louder? What omission, I still can hear your voice
2:56 i dont see the drawing
same
can't see anything either
its kinda stupid to have the music in bg when we really want to hear you
I'll keep that in mind. A lot of people suggested havnig music in my videos to fill dead space but you have a good point too. It's a tough balance. I may have made the music too loud or used bad music for this video also.
Agreed