-2

以下のコードに示すように、フロードキュメントを使用していくつかの段落と画像を印刷しようとしています

Paragraph invoiceID = new Paragraph(new Run("Invoice No : "+ txtInvoiceID.Text));
Paragraph qty001 = new Paragraph(new Run("Quantity : " + qtyText.Text));
Paragraph date001 = new Paragraph(new Run("Date : " +txtInvoiceDate.Text));

Section sec = new Section();
sec.Blocks.Add(invoiceID);
sec.Blocks.Add(qty001);
sec.Blocks.Add(date001);

FlowDocument fd = new FlowDocument();
PrintDialog pd = new PrintDialog();

fd.PageHeight = pd.PrintableAreaHeight;
fd.PageWidth = pd.PrintableAreaWidth;
fd.PagePadding = new Thickness(50);
fd.ColumnWidth = pd.PrintableAreaWidth;
fd.Blocks.Add(sec);
fd.Blocks.Add(new BlockUIContainer(barCodeImage));

IDocumentPaginatorSource dps = fd;
pd.PrintDocument(dps.DocumentPaginator,"Desciption");

プロセスによって画像がロックされていることはわかっていますが、この画像のロックを解除するにはどうすればよいですか??

助けてください

ありがとう

ジャザイブ

4

1 に答える 1

-1

WPF では、すべてのコントロールは 1 つの親のみを持つことができます。xaml で既に barCodeImage を定義しているため、これは何らかのコンテナーの子です。コンテナから削除するか、イメージのクローンを作成できます

于 2013-05-07T15:32:35.240 に答える