File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change 2020
2121 <ItemGroup >
2222 <PackageReference Include =" GitInfo" Version =" 2.2.0" />
23+ <PackageReference Include =" SixLabors.ImageSharp" Version =" 2.0.0" />
24+ <PackageReference Include =" ZXing.Net" Version =" 0.16.8" />
2325 </ItemGroup >
2426
2527</Project >
Original file line number Diff line number Diff line change 1- using System ;
1+ using SixLabors . ImageSharp ;
2+ using SixLabors . ImageSharp . PixelFormats ;
23using System . Threading . Tasks ;
4+ using ZXing . Common ;
5+ using ZXing . Rendering ;
36
47namespace GithubActionsHelloWorld
58{
69 public class Program
710 {
8- public async static Task Main ( string [ ] args )
11+ public static async Task Main ( string [ ] args )
912 {
10- await Task . Delay ( 100 ) ;
11- Console . WriteLine ( "Hello World!" ) ;
13+ var barcodeWriter = new ZXing . BarcodeWriterPixelData
14+ {
15+ Format = ZXing . BarcodeFormat . CODE_128 ,
16+ Options = new EncodingOptions
17+ {
18+ Height = 300 ,
19+ Width = 300 ,
20+ } ,
21+ Renderer = new PixelDataRenderer
22+ {
23+ }
24+ } ;
25+
26+ var pixelData = barcodeWriter . Write ( "Hallo Barcode" ) ;
27+
28+ using ( var image = Image . LoadPixelData < Rgba32 > ( pixelData . Pixels , 300 , 300 ) )
29+ await image . SaveAsBmpAsync ( "barcode.bmp" ) ;
1230 }
1331 }
1432}
You can’t perform that action at this time.
0 commit comments