![]() |
|
[.NET] Advanced Curved Rectangle and Pill Functions - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Advanced Curved Rectangle and Pill Functions (/showthread.php?tid=3938817) Pages: Pages
1
2
|
Advanced Curved Rectangle and Pill Functions - Tedd - Dec 19, 2013 The use of it should be pretty self-explanatory, here is a preview: ![]() I'm guessing a lot of you don't know why you would need this.. Well, to make curved buttons like this: ![]() You need to use arcs (well, it's the easiest and only way I know). However, say you didn't want ALL of the corners to be rounded? This function lets you do just that. Source: Code Class CornerStyleYes, I know I don't need to use a class, but it's a whole lot more easy for me to understand it when I can say ".TopLeft = False", than just using AdvRectangle(New Rectangle(1,2,3,4), 5, False, False, True, False, 5)... So deal with it, or change it yourself. EDIT: Here is a new function called "Pill". It's used to create a "Pill" shape, which means a half-circle on the side of the button (as opposed to just a rounded edge). ![]() Code: Code Class PillStyleIf you want my complete Design Functions module (which makes GDI a hell of a lot easier) you can get it here: http://pastebin.com/JXFrCdMU * - ident - Dec 19, 2013 "Yes, I know I don't need to use a class," what do you mean by that? * - Tedd - Dec 19, 2013 (Dec 19, 2013 05:56 PM)ident Wrote: "Yes, I know I don't need to use a class," Instead of requiring the use of the class CornerStyle, I could have just made the function take four boolean variables. The class just seemed a lot easier to understand, at least to me anyway. * - webdev77 - Dec 19, 2013 (Dec 19, 2013 05:56 PM)ident Wrote: "Yes, I know I don't need to use a class," It isn't necessary to encapsulate the function into a class. You can use the function as is. * - Hawk HF - Dec 19, 2013 Thanks for this! Hopefully I won't depend on Aeonhack's themebase forever. * - Temploit - Dec 20, 2013 Looks neat ^^ (Dec 19, 2013 09:24 PM)Hawk HF Wrote: Thanks for this!It's pretty to switch over actually. * - Tedd - Dec 20, 2013 (Dec 19, 2013 09:24 PM)Hawk HF Wrote: Thanks for this! His themebase isn't bad, but using pure GDI and custom made controls just adds a little bit more flexibility. (Dec 20, 2013 02:30 AM)Temploit Wrote: Looks neat ^^ Yea and it's actually really easy to switch over if you already know the basics of GDI * - Nextrum - Dec 20, 2013 (Dec 19, 2013 05:46 PM)Tedd Wrote: The use of it should be pretty self-explanatory, here is a preview: Good share matey, bookmarked for future reference. You should come to the GDI side and have loads of fun. Easy if you have previous experience. * - Tedd - Dec 20, 2013 (Dec 20, 2013 10:44 AM)Xertz Wrote: Good share matey, bookmarked for future reference. You should come to the GDI side and have loads of fun. Easy if you have previous experience. Oh I have, I just don't release a lot. I am about to start pushing out some new themes though. I've been working more on perfecting custom controls than making new themes though. * - AgedPeanuts - Dec 20, 2013 (Dec 19, 2013 09:24 PM)Hawk HF Wrote: Thanks for this! Try playing around with it, start by creating something simple like a button, but instead of inheriting the 'ThemeControl' class use 'Control' instead. Then look at how the 'ThemeControl' handles everything, follow every step it takes, and attempt to mimic that in your control. Soon you will have figured out which steps to take without using the 'ThemeBase'. AS for its VERY useful functions, well just because you don't wanna use the 'ThemeBase' doesn't mean you cant use the functions. Create a static class for every function you find useful inside the 'ThemeBase', and port them over, you will just have to add an extra 'Graphics' parameter to each function though. All-in-all you can't be the best 'Theme Creator' without having the tools/creativity to do so. * - Hawk HF - Dec 20, 2013 (Dec 20, 2013 10:52 AM)AgedPeanuts Wrote: Try playing around with it, start by creating something simple like a button, but instead of inheriting the 'ThemeControl' class use 'Control' instead. Then look at how the 'ThemeControl' handles everything, follow every step it takes, and attempt to mimic that in your control. Soon you will have figured out which steps to take without using the 'ThemeBase'. AS for its VERY useful functions, well just because you don't wanna use the 'ThemeBase' doesn't mean you cant use the functions. Create a static class for every function you find useful inside the 'ThemeBase', and port them over, you will just have to add an extra 'Graphics' parameter to each function though. All-in-all you can't be the best 'Theme Creator' without having the tools/creativity to do so. I know how to do it, I just never took the time to dig into it. My next theme, whenever I decide to make it, is going to be 100% GDI. * - Banksу - Dec 20, 2013 (Dec 19, 2013 05:58 PM)Tedd Wrote: Instead of requiring the use of the class CornerStyle, I could have just made the function take four boolean variables. The class just seemed a lot easier to understand, at least to me anyway. This is exactly why you should use OOP. Four booleans is hard to read on first glance - you'd have to look at the method definition to find out exactly what each boolean was for. This approach is much simpler, easier to understand, and just overall better. You should be using a class in cases such as this. * - Madara-Uchiha - Dec 20, 2013 Great share, thanks. HQ User and work! 😉 * - gigajew - Dec 20, 2013 Don't forget to dispose your graphics once you're done with them. * - Hawk HF - Dec 20, 2013 (Dec 20, 2013 03:36 PM)gigajew Wrote: Don't forget to dispose your graphics once you're done with them. How come? Does it improve performance or speed? serious question. |