コード例 #1
0
ファイル: VersionInfoTest.cs プロジェクト: fengdc/QrCode.Net
 private void Test_One_Case(int version, TriStateMatrix expected)
 {
 	TriStateMatrix target = new TriStateMatrix(expected.Width);
     PositioninngPatternBuilder.EmbedBasicPatterns(version, target);
     target.EmbedVersionInformation(version);
     
 	expected.AssertEquals(target);
 }
コード例 #2
0
        private void Test_One_Case(int version, TriStateMatrix expected)
        {
            TriStateMatrix target = new TriStateMatrix(expected.Width);

            PositioninngPatternBuilder.EmbedBasicPatterns(version, target);
            target.EmbedVersionInformation(version);

            expected.AssertEquals(target);
        }
コード例 #3
0
ファイル: EncodePTest.cs プロジェクト: nopara73/QrCode.Net
        private void Encode(string content, int option)
        {
            ErrorCorrectionLevel errorLevel = ErrorCorrectionLevel.H;

            EncodationStruct encodeStruct = DataEncode.Encode(content, errorLevel);

            BitList codewords = ECGenerator.FillECCodewords(encodeStruct.DataCodewords, encodeStruct.VersionDetail);

            if (option == 3)
            {
                return;
            }

            TriStateMatrix triMatrix = new TriStateMatrix(encodeStruct.VersionDetail.MatrixWidth);

            PositioninngPatternBuilder.EmbedBasicPatterns(encodeStruct.VersionDetail.Version, triMatrix);

            triMatrix.EmbedVersionInformation(encodeStruct.VersionDetail.Version);
            triMatrix.EmbedFormatInformation(errorLevel, new Pattern0());
            triMatrix.TryEmbedCodewords(codewords);

            triMatrix.GetLowestPenaltyMatrix(errorLevel);
        }
コード例 #4
0
ファイル: EncodePTest.cs プロジェクト: fengdc/QrCode.Net
		private void Encode(string content, int option)
		{
			ErrorCorrectionLevel errorLevel = ErrorCorrectionLevel.H;
			
			EncodationStruct encodeStruct = DataEncode.Encode(content, errorLevel);
			
			BitList codewords = ECGenerator.FillECCodewords(encodeStruct.DataCodewords, encodeStruct.VersionDetail);
			
			if(option == 3)
				return;
			
			TriStateMatrix triMatrix = new TriStateMatrix(encodeStruct.VersionDetail.MatrixWidth);
			PositioninngPatternBuilder.EmbedBasicPatterns(encodeStruct.VersionDetail.Version, triMatrix);
			
			triMatrix.EmbedVersionInformation(encodeStruct.VersionDetail.Version);
			triMatrix.EmbedFormatInformation(errorLevel, new Pattern0());
			triMatrix.TryEmbedCodewords(codewords);
			
			triMatrix.GetLowestPenaltyMatrix(errorLevel);
		}