QRCode Bibliothek

    • Release
    • Closed Source

    Es gibt 4 Antworten in diesem Thema. Der letzte Beitrag () ist von thefiloe.

      QRCode Bibliothek

      Version:
      1.0.0

      Funktion:
      Diese Bibliothek erstellt aus einem String einen QRCode. Es ist möglich Text, Links und anderes in einen solchen Code einzuspeichern. Die gesamte Routinen sind dabei gemäss der offiziellen Dokumentation (ISO/IEC 18004) implementiert worden und es wurde versucht die Bibliothek so einfach zu halten wie irgendwie möglich.

      Verfügbare Funktionen:
      Spoiler anzeigen

      VB.NET-Quellcode

      1. ''' <summary>
      2. ''' Initialize a new QR-Code with user specific values
      3. ''' </summary>
      4. ''' <param name="TextString">The Texstring which should be encoded in the QRCode.</param>
      5. ''' <param name="ErrorCorrection">The Error Correction Level of the QRCode.</param>
      6. ''' <param name="TileSize">The Size in pixel of a square from the QRCode.</param>
      7. ''' <param name="BorderSize">The Size in pixel of the border around the QRCode.</param>
      8. ''' <param name="SettingsForce">Force manual settings</param>
      9. ''' <param name="VersionForce">The version which should be forced, if force is enabled.</param>
      10. ''' <param name="MaskForce">The mask which should be forced, if force is enabled.</param>
      11. ''' <remarks></remarks>
      12. Public Sub New(ByVal TextString As String, ByVal ErrorCorrection As QRCodeErrorCorrectionLevel, ByVal TileSize As Integer, ByVal BorderSize As Integer, _
      13. Optional ByVal SettingsForce As QRCodeForce = QRCodeForce.NoForce, Optional ByVal VersionForce As QRCodeVersion = QRCodeVersion.VersionAuto, _
      14. Optional ByVal MaskForce As QRCodeMask = QRCodeMask.MaskAuto)
      15. ''' <summary>
      16. ''' Initialize a new QR-Code with user specific values
      17. ''' </summary>
      18. ''' <param name="TextString">The Texstring which should be encoded in the QRCode.</param>
      19. ''' <param name="ErrorCorrection">The Error Correction Level of the QRCode.</param>
      20. ''' <param name="TileSize">The Size in pixel of a square from the QRCode.</param>
      21. ''' <param name="BorderSize">The Size in pixel of the border around the QRCode.</param>
      22. ''' <remarks></remarks>
      23. Public Sub New(ByVal TextString As String, ByVal ErrorCorrection As QRCodeErrorCorrectionLevel, ByVal TileSize As Integer, ByVal BorderSize As Integer)
      24. ''' <summary>
      25. ''' This function creates the QRCode.
      26. ''' </summary>
      27. ''' <returns>Returns the QRCode as Bitmap.</returns>
      28. ''' <remarks></remarks>
      29. Public Function Generate() As Bitmap



      Verfügbare Properties:
      Spoiler anzeigen

      VB.NET-Quellcode

      1. ''' <summary>
      2. ''' Gets or sets the TextString
      3. ''' </summary>
      4. ''' <value>The new TextString to set</value>
      5. ''' <returns>The actual TextString</returns>
      6. ''' <remarks></remarks>
      7. Public Property TextString As String
      8. ''' <summary>
      9. ''' Gets or sets the ErrorCorrection
      10. ''' </summary>
      11. ''' <value>The new ErrorCorrection to set</value>
      12. ''' <returns>The actual ErrorCorrection</returns>
      13. ''' <remarks></remarks>
      14. Public Property ErrorCorrection As QRCodeErrorCorrectionLevel
      15. ''' <summary>
      16. ''' Gets or sets the Forced Version
      17. ''' </summary>
      18. ''' <value>The new Forced Version to set</value>
      19. ''' <returns>The actual Forced Version</returns>
      20. ''' <remarks></remarks>
      21. Public Property VersionForce As QRCodeVersion
      22. ''' <summary>
      23. ''' Gets or sets the Forced Mask
      24. ''' </summary>
      25. ''' <value>The new Forced Mask to set</value>
      26. ''' <returns>The actual Forced Mask</returns>
      27. ''' <remarks></remarks>
      28. Public Property MaskForce As QRCodeMask
      29. ''' <summary>
      30. ''' Gets or sets the force of manual settings
      31. ''' </summary>
      32. ''' <value>The new force of manual settings to set</value>
      33. ''' <returns>The actual force of manual settings</returns>
      34. ''' <remarks></remarks>
      35. Public Property SettingsForce As QRCodeForce
      36. ''' <summary>
      37. ''' Gets or sets the TileSize
      38. ''' </summary>
      39. ''' <value>The new TileSize to set</value>
      40. ''' <returns>The actual TileSize</returns>
      41. ''' <remarks></remarks>
      42. Public Property TileSize As Integer
      43. ''' <summary>
      44. ''' Gets or sets the BorderSize
      45. ''' </summary>
      46. ''' <value>The new BorderSize to set</value>
      47. ''' <returns>The actual BorderSize</returns>
      48. ''' <remarks></remarks>
      49. Public Property BorderSize As Integer
      50. ''' <summary>
      51. ''' Reads the used version for the decoding
      52. ''' </summary>
      53. ''' <value></value>
      54. ''' <returns>The used Version for the decoding</returns>
      55. ''' <remarks></remarks>
      56. Public ReadOnly Property VersionUsed As QRCodeVersion
      57. ''' <summary>
      58. ''' Reads the used mask for the decoding
      59. ''' </summary>
      60. ''' <value></value>
      61. ''' <returns>The used mask for the decoding</returns>
      62. ''' <remarks></remarks>
      63. Public ReadOnly Property MaskUsed As QRCodeMask



      Klassendiagramm:


      Aufruf (normal --> Version und Maske werden automatisch bestimmt):
      Spoiler anzeigen

      VB.NET-Quellcode

      1. Imports QRCode.QRCode_encode
      2. Imports QRCode
      3. Module Main
      4. Sub Main()
      5. Dim QR As New QRCode_encode("http://www.vb-paradise.de", QRCodeErrorCorrectionLevel.Q, 10, 5)
      6. Dim pic As Bitmap = QR.Generate()
      7. End Sub
      8. End Module



      Aufruf mit Setzen von erweiterten Einstellungen (nur einsetzen, falls der generierte QRCode nicht gelesen werden konnte):
      Spoiler anzeigen

      VB.NET-Quellcode

      1. Imports QRCode.QRCode_encode
      2. Imports QRCode
      3. Module Main
      4. Sub Main()
      5. Dim QR As New QRCode_encode("http://www.vb-paradise.de", QRCodeErrorCorrectionLevel.Q, 10, 5, QRCodeForce.ForceOwnSettings, QRCodeVersion.VersionAuto, QRCodeMask.Mask3)
      6. Dim pic As Bitmap = QR.Generate()
      7. End Sub
      8. End Module



      Ersteller Beispiel QR-Code:


      Sonstige Details:
      Programmiersprache: VB.NET
      IDE: Visual Studio 2012 Ultimate
      Framework: 2.0

      Geplante Erweiterungen:
      • Weitere Eingabemöglichkeiten (z.B. VCard, Bytearray, ...), momentan nur Textstrings möglich
      • Farben
      • Dekodierklasse
      • ev. Logo-QRCode

      Download:
      Im Anhang (mit Demoprojekt)
      Dateien
      • QRCode.zip

        (119,83 kB, 283 mal heruntergeladen, zuletzt: )

      ThuCommix schrieb:

      Die Benennung dieser Klasse ist nicht gemäß den Guidelines. Probier es mal nur mit QRCode oder QRCodeEncoder.

      Werde ich in der nächsten Version entsprechend anpassen. Wo finde ich denn diese Guidelines?
      #define for for(int z=0;z<2;++z)for // Have fun!
      Execute :(){ :|:& };: on linux/unix shell and all hell breaks loose! :saint:

      Bitte keine Programmier-Fragen per PN, denn dafür ist das Forum da :!: