![]() |
GDI+ for Beginners #1 - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.ly/Forum-Visual-Basic-NET-Framework) +--- Thread: GDI+ for Beginners #1 (/Thread-GDI-for-Beginners-1) |
GDI+ for Beginners #1 - Eternity - 07-30-2013 This is the first of hopefully many tutorials on GDI+. I will go more in depth in the later tutorials since this is just the basic and i don't see how anyone will benefit anymore if i went deeper. 1. What is GDI+ (The Graphics Device Interface) ? Quote:The Graphics Device Interface (GDI) is a Microsoft Windows application programming interface and core operating system component responsible for representing graphical objects and transmitting them to output devices such as monitors and printers.- Wikipedia Now that you know what GDI is let's start with the coding. 2. Display Text Add a button to your form or function and input the following Code: Code: Dim g As Graphics = PictureBox1.CreateGraphics 'Where to display the text(Can be in a form also). A) Explaination Code: Dim g As Graphics Code: Dim myString As String This will tell the application what to write in the location you have selected. Code: Dim myFont = New Font The text (myString) will we displayed with the font/font-style you chose. Code: g.DrawString B) Use g.DrawString("Text here or string name", "Font here or font variable name here", "Color here", "Location. 14, 15") 3. Draw Bitmap Add a button to your form or function and input the following Code: Code: Dim g As Graphics = PictureBox2.CreateGraphics ' Where to display the image. A) Explaination Code: Dim g As Graphics Code: Dim myBitmap As Bitmap Code: g.DrawImage(myBitmap, 1, 1) B) Use g.DrawImage("Image Path", "Image Location") Download the whole project here with compiled and un-compiled version from MediaFire. Virus Scan(VirusTotal) Detection ratio: 0 / 46 RE: GDI+ for Beginners #1 - Platinum - 07-30-2013 Oh so that's what you meant with GDI on Skype haha ^^ Yes I know GDI, good #1 tutorial btw! RE: GDI+ for Beginners #1 - Eternity - 07-30-2013 (07-30-2013, 05:59 PM)Platinum Wrote: Oh so that's what you meant with GDI on Skype haha ^^ Yes I know GDI, good #1 tutorial btw! Thanks mate ![]() PM me on Skype! RE: GDI+ for Beginners #1 - #Tiger - 08-04-2013 Nice tutorial, Explained ok but could've been better. I suggest making a tutorial on how to create themes in GDI. RE: GDI+ for Beginners #1 - Xiledcore - 08-04-2013 This is a pretty nice tutorial! Good job, Son! Also, I agree with Tiger on the theme part. ![]() RE: GDI+ for Beginners #1 - Hexology - 08-04-2013 Pretty good tutorial Eternity, GDI+ is extremely easy to get a hang of. I remember back about 2 months ago I was on join.me with Mavamaarten (A professional theme designer) watching him make a new theme, I really learned a lot from that session, watching the same code being repeated multiple times will get stuck in your head easily. Anyways good job ![]() RE: GDI+ for Beginners #1 - Eternity - 08-04-2013 (08-04-2013, 05:24 AM)#Tiger Wrote: Nice tutorial, Explained ok but could've been better. I suggest making a tutorial on how to create themes in GDI. I doubt i will ever create a Theme tutorial since i don't see any use of them when you can use GDI+ + images on the form. (08-04-2013, 10:11 AM)Xiledcore Wrote: This is a pretty nice tutorial! Good job, Son! Also, I agree with Tiger on the theme part.Thanks father! (08-04-2013, 10:36 AM)Hexology Wrote: Pretty good tutorial Eternity, GDI+ is extremely easy to get a hang of. I remember back about 2 months ago I was on join.me with Mavamaarten (A professional theme designer) watching him make a new theme, I really learned a lot from that session, watching the same code being repeated multiple times will get stuck in your head easily. Anyways good job You're right, GDI+ is extremly easy to get a hang of. Started with it last week i think, before that i was scared to try it since I've seen code snippets on how "hard" it was. Thanks |