// Copyright (c) 2012-2022 fo-dicom contributors.
// Licensed under the Microsoft Public License (MS-PL).
using System;
using System.Drawing;
using FellowOakDicom;
using FellowOakDicom.Imaging;
using FellowOakDicom.Log;
using FellowOakDicom.Printing;
namespace Print_SCU
{
internal static class Program
{
private static async System.Threading.Tasks.Task Main(string[] args)
{
// Initialize log manager.
new DicomSetupBuilder()
.RegisterServices(s => s
.AddFellowOakDicom()
.AddLogManager<ConsoleLogManager>()
.AddImageManager<WinFormsImageManager>())
.Build();
var stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Start();
var printJob = new PrintJob("DICOM PRINT JOB")
{
RemoteAddress = "localhost",
RemotePort = 105,
CallingAE = "PRINTSCU",
CalledAE = "Printer"
};
//greyscale
var greyscaleImg = new DicomImage(@"Data\1.3.51.5155.1353.20020423.1100947.1.0.0.dcm");
var colorImg = new DicomImage(@"Data\US-RGB-8-epicard.dcm");
using (var bitmap = greyscaleImg.RenderImage().As<Bitmap>())
{
var bitmap2 = colorImg.RenderImage().As<Bitmap>();
printJob.FilmSession.IsColor = false; //set to true to print in color
printJob.StartFilmBox("STANDARD\\32,32", "PORTRAIT", "14INX17IN");
printJob.AddImage(bitmap, 0);
printJob.AddImage(bitmap2, 2);
printJob.EndFilmBox();
// printJob.StartFilmBox("STANDARD\\2,1", "PORTRAIT", "14INX17IN");
// printJob.AddImage(bitmap, 0);
// printJob.AddImage(bitmap2, 2);
// printJob.EndFilmBox();
}
//color
await printJob.Print();
stopwatch.Stop();
Console.WriteLine();
Console.WriteLine(stopwatch.Elapsed);
}
}
}
dicom 打印
最新推荐文章于 2025-09-27 06:37:43 发布
8945

被折叠的 条评论
为什么被折叠?



