Automap (client) [VS plugin mod]
Revision | 84763f54eb025caac874ae5ae57f23a808cc1e8a (tree) |
---|---|
Time | 2020-06-04 06:58:59 |
Author | melchior <melchior@user...> |
Commiter | melchior |
Updates for Snapshots branch, Transparency setting
@@ -97,6 +97,7 @@ | ||
97 | 97 | <Compile Include="Data\PersistedConfiguration.cs" /> |
98 | 98 | <Compile Include="Data\DisplayNameAttribute.cs" /> |
99 | 99 | <Compile Include="Subsystems\JsonGenerator.cs" /> |
100 | + <Compile Include="Subsystems\Snapshot.cs" /> | |
100 | 101 | </ItemGroup> |
101 | 102 | <ItemGroup> |
102 | 103 | <Folder Include="VS_libs\" /> |
@@ -116,6 +117,5 @@ | ||
116 | 117 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
117 | 118 | </None> |
118 | 119 | </ItemGroup> |
119 | - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | |
120 | - <Compile Include="Subsystems\Snapshot.cs" /> | |
120 | + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | |
121 | 121 | </Project> |
\ No newline at end of file |
@@ -6,6 +6,7 @@ using System.Linq; | ||
6 | 6 | using System.Threading; |
7 | 7 | using System.Threading.Tasks; |
8 | 8 | using Hjg.Pngcs; |
9 | +using Hjg.Pngcs.Chunks; | |
9 | 10 | |
10 | 11 | namespace Automap |
11 | 12 | { |
@@ -43,9 +44,27 @@ namespace Automap | ||
43 | 44 | |
44 | 45 | ImageInfo info = new ImageInfo(Width * chunkSize, Height * chunkSize, 8, false); |
45 | 46 | PngWriter snapWriter = FileHelper.CreatePngWriter(path, info, true); |
47 | + PngMetadata meta = snapWriter.GetMetadata( ); | |
48 | + meta.SetTimeNow( ); | |
49 | + var transparencyChunk = meta.CreateTRNSChunk( ); | |
50 | + transparencyChunk.SetRGB(0, 0, 0); | |
51 | + //meta.SetText("Center_X", coord.X.ToString("D")); | |
52 | + //meta.SetText("Center_Y", coord.Y.ToString("D")); | |
53 | + | |
54 | + | |
55 | + | |
56 | + /* | |
57 | + Red: 2 bytes, range 0 .. (2^bitdepth)-1 | |
58 | + Green: 2 bytes, range 0 .. (2^bitdepth)-1 | |
59 | + Blue: 2 bytes, range 0 .. (2^bitdepth)-1 | |
60 | + */ | |
61 | + | |
62 | + | |
46 | 63 | snapWriter.CompLevel = 5; |
47 | 64 | snapWriter.CompressionStrategy = Hjg.Pngcs.Zlib.EDeflateCompressStrategy.Filtered; |
48 | 65 | |
66 | + | |
67 | + | |
49 | 68 | var orderedList = |
50 | 69 | from ch in cols |
51 | 70 | group ch by ch.Location.Y into g |