简体   繁体   English

后记文件图像和C#位图

[英]Postscript file Image and C# Bitmap

I have images defined like below in postscript file: 我在后记文件中定义了如下图像:

<< /ImageType 1
/Width 986 /Height 1
/BitsPerComponent 8
/Decode [0 1 0 1 0 1]
/ImageMatrix [986 0 0 -1 0 1]
/DataSource <
803fe0503824160d0784426150b864361d0f8844625138a4562d178c466351b8e4763d1f904864523924964d27944a6552b964b65d2f984c665339a4d66d379c4e6753b9e4f67d3fa05068543a25168d47a4526954ba648202
> /LZWDecode filter >> image } def

using the image DataSource, I need to create a C# bitmap object. 使用图像数据源,我需要创建一个C#位图对象。

Bitmap bitmapImage = new Bitmap(986, 1, PixelFormat.Format32bppPArgb);

I don't have much knowledge about ps files. 我对ps文件不了解。
Depending on info available in ps block, can anyone please confirm following: 根据ps块中可用的信息,任何人都可以确认以下内容:

  • Which PixelFormat to use here - I am currently using PixelFormat.Format32bppPArgb? 在这里使用哪个PixelFormat-我目前正在使用PixelFormat.Format32bppPArgb?
  • Is '/Width 986 /Height 1' is the right image size to use when creating C# Bitmap? '/ Width 986 / Height 1'是创建C#位图时要使用的正确图像尺寸吗?

Thank you! 谢谢!

Which PixelFormat to use here - I am currently using PixelFormat.Format32bppPArgb? 在这里使用哪个PixelFormat-我目前正在使用PixelFormat.Format32bppPArgb?

Instead of PixelFormat.Format32bppPArgb i would use PixelFormat.Format8bppIndexed because of this line: /BitsPerComponent 8 取而代之的PixelFormat.Format32bppPArgb我会用PixelFormat.Format8bppIndexed ,因为这行: /BitsPerComponent 8

Anyway, you can use other format, it will be converted 无论如何,您可以使用其他格式,它将被转换

Is '/Width 986 /Height 1' is the right image size to use when creating C# Bitmap? '/ Width 986 / Height 1'是创建C#位图时要使用的正确图像尺寸吗?

Yes it is: width =986 / height =1 是的,它是: 宽度 = 986 / 高度 = 1
Only if you want to create a Bitmap respecting width and height in Postscript file 仅当您要在Postscript文件中创建尊重宽度高度Bitmap

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM