/ /コード39バーコード - c#、wpf、code39

コード39バーコード - c#、wpf、code39

たぶん、これに簡単な解決策がありますが、私は1つを見つけることができないようです、私はフォントサイズを増やすことなくバーコードの高さを増やす必要があります。

                // Barcode Text Block
TextBlock barcode = new TextBlock();
barcode.Text = "12345678-123";
barcode.FontFamily = new FontFamily("Free 3 Of 9");
barcode.Margin = new Thickness(736, 638, 0, 50);
barcode.FontSize = 65;
page.Children.Add(barcode);

// Baarcode Number Text Block
TextBlock pageText = new TextBlock();
string s = "*12345678-123*";
s = s.Insert(1, " ").Insert(3, " ").Insert(5, " ").Insert(7, " ").Insert(9, " ").Insert(11, " ").Insert(13, " ").Insert(15, " ").Insert(17, " ").Insert(19, " ").Insert(21, " ").Insert(23, " ").Insert(25, " ");
pageText.Text = s;

pageText.FontFamily = new FontFamily("Arial");
pageText.Margin = new Thickness(743, 685, 0, 50);
pageText.FontSize = 26;
page.Children.Add(pageText);

現在、次のようになっています。

ここに画像の説明を入力

私はバーコードの高さを約10pixelにする必要があります。 heightプロパティはそれには効果がありませんでした。

回答:

回答№1の場合は7

ここにサンプルがあります

// Barcode Text Block
TextBlock barcode = new TextBlock();
barcode.Text = "12345678-123";
barcode.FontFamily = new FontFamily("Free 3 Of 9");
barcode.Margin = new Thickness(736, 638, 0, 50);
barcode.FontSize = 65;
//apply scale
barcode.RenderTransform = new ScaleTransform() { ScaleY = 1.1 };

この変換は、バーコード要素を10%の余分な高さにスケールします。必要に応じて調整することができます。