Keine Cache-Version

Caching deaktiviert Standardeinstellung für diese Seite:aktiviert (code LNG204)
Wenn die Anzeige zu langsam ist, können Sie den Benutzermodus deaktivieren, um die zwischengespeicherte Version anzuzeigen.

GraphicsTools.cs

Description du code

GraphicsTools.cs est un fichier du projet BrolDev.
Ce fichier est situé dans /var/www/bin/sniplets/bibliobrol/broldev/src/.

Projet BrolDev : Librairie de composants réutilisables pour les applications BrolDev en CSharp.

Code source ou contenu du fichier

  1. using System.Drawing;
  2. using System.Drawing.Drawing2D;
  3.  
  4. namespace be.gaudry.view.style
  5. {
  6. /// <summary>
  7. /// Provides tools for graphics processing
  8. /// </summary>
  9. /// <remarks>
  10. /// 2007 José Manuel Menéndez Poo
  11. /// Visit my blog for upgrades and other renderers - www.menendezpoo.com
  12. /// </remarks>
  13. internal static class GraphicsTools
  14. {
  15. /// <summary>
  16. /// Creates a rounded rectangle from the specified rectangle and radius
  17. /// </summary>
  18. /// <param name="rectangle">Base rectangle</param>
  19. /// <param name="radius">Radius of the corners</param>
  20. /// <returns>Rounded rectangle as a GraphicsPath</returns>
  21. public static GraphicsPath CreateRoundRectangle(Rectangle rectangle, int radius)
  22. {
  23. GraphicsPath path = new GraphicsPath();
  24.  
  25. int l = rectangle.Left;
  26. int t = rectangle.Top;
  27. int w = rectangle.Width;
  28. int h = rectangle.Height;
  29. int d = radius << 1;
  30.  
  31. path.AddArc(l, t, d, d, 180, 90); // topleft
  32. path.AddLine(l + radius, t, l + w - radius, t); // top
  33. path.AddArc(l + w - d, t, d, d, 270, 90); // topright
  34. path.AddLine(l + w, t + radius, l + w, t + h - radius); // right
  35. path.AddArc(l + w - d, t + h - d, d, d, 0, 90); // bottomright
  36. path.AddLine(l + w - radius, t + h, l + radius, t + h); // bottom
  37. path.AddArc(l, t + h - d, d, d, 90, 90); // bottomleft
  38. path.AddLine(l, t + h - radius, l, t + radius); // left
  39. path.CloseFigure();
  40.  
  41. return path;
  42. }
  43.  
  44. /// <summary>
  45. /// Creates a rectangle rounded on the top
  46. /// </summary>
  47. /// <param name="rectangle">Base rectangle</param>
  48. /// <param name="radius">Radius of the top corners</param>
  49. /// <returns>Rounded rectangle (on top) as a GraphicsPath object</returns>
  50. public static GraphicsPath CreateTopRoundRectangle(Rectangle rectangle, int radius)
  51. {
  52. GraphicsPath path = new GraphicsPath();
  53.  
  54. int l = rectangle.Left;
  55. int t = rectangle.Top;
  56. int w = rectangle.Width;
  57. int h = rectangle.Height;
  58. int d = radius << 1;
  59.  
  60. path.AddArc(l, t, d, d, 180, 90); // topleft
  61. path.AddLine(l + radius, t, l + w - radius, t); // top
  62. path.AddArc(l + w - d, t, d, d, 270, 90); // topright
  63. path.AddLine(l + w, t + radius, l + w, t + h); // right
  64. path.AddLine(l + w, t + h, l, t + h); // bottom
  65. path.AddLine(l, t + h, l, t + radius); // left
  66. path.CloseFigure();
  67.  
  68. return path;
  69. }
  70.  
  71. /// <summary>
  72. /// Creates a rectangle rounded on the bottom
  73. /// </summary>
  74. /// <param name="rectangle">Base rectangle</param>
  75. /// <param name="radius">Radius of the bottom corners</param>
  76. /// <returns>Rounded rectangle (on bottom) as a GraphicsPath object</returns>
  77. public static GraphicsPath CreateBottomRoundRectangle(Rectangle rectangle, int radius)
  78. {
  79. GraphicsPath path = new GraphicsPath();
  80.  
  81. int l = rectangle.Left;
  82. int t = rectangle.Top;
  83. int w = rectangle.Width;
  84. int h = rectangle.Height;
  85. int d = radius << 1;
  86.  
  87. path.AddLine(l + radius, t, l + w - radius, t); // top
  88. path.AddLine(l + w, t + radius, l + w, t + h - radius); // right
  89. path.AddArc(l + w - d, t + h - d, d, d, 0, 90); // bottomright
  90. path.AddLine(l + w - radius, t + h, l + radius, t + h); // bottom
  91. path.AddArc(l, t + h - d, d, d, 90, 90); // bottomleft
  92. path.AddLine(l, t + h - radius, l, t + radius); // left
  93. path.CloseFigure();
  94.  
  95. return path;
  96. }
  97. }
  98. }

Structure et Fichiers du projet

Afficher/masquer...


Répertoires contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/view/style/vista/ 
IcôneNomTailleModification
Pas de sous-répertoires.
IcôneNomTailleModification
| _ Répertoire parent0 octets1716501940 24/05/2024 00:05:40
Fichiers contenus dans /var/www/bin/sniplets/bibliobrol/broldev/src/view/style/vista/ 
IcôneNomTailleModificationAction
IcôneNomTailleModificationAction
Afficher le fichier .cs|.csGraphicsTools.cs3.9 Ko31/10/2018 18:33:22-refusé-
Afficher le fichier .cs|.csWindowsVistaRenderer.cs26.15 Ko31/10/2018 18:33:22-refusé-
Afficher le fichier .cs|.csWindowsVistaColorTable.cs9.6 Ko31/10/2018 18:33:22-refusé-

Utilisation de l'explorateur de code

  • Navigation :
    • Un clic sur une icône de répertoire ouvre ce répertoire pour en afficher les fichiers.
    • Lorsque le répertoire en cours ne contient pas de sous-répertoires il est possible de remonter vers le répertoire parent.
    • La structure de répertoires en treetable (tableau en forme d'arborescence) n'est plus possibledans cette version.
    • Un clic sur une icône de fichier ouvre ce fichier pour en afficher le code avec la coloration syntaxique adaptée en fonction du langage principal utilisé dans le fichier.
  • Affichage :
    • Il est possible de trier les répertoires ou les fichiers selon certains critères (nom, taille, date).
  • Actions :
    • Les actions possible sur les fichiers dépendent de vos droits d'utilisateur sur le site. Veuillez activer le mode utilisateur pour activer les actions.

Deutsche Übersetzung

Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.

Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.

Vielen Dank im Voraus.

Dokument erstellt 16/10/2009, zuletzt geändert 26/10/2018
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/cs-broldev-source-rf-view/style/vista/GraphicsTools.cs.html

Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.