问题标签 [wic]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
505 浏览

c# - 从流创建 ID2D1Bitmap1 时如何尊重 EXIF 方向

当我从随机访问流构建位图时,我希望它根据其 EXIF 方向自动旋转。让我们扩展以下代码片段:

我正在寻找的行为类似于调用BitmapDecoder.GetPixelDataAsync并将 ExifOrientationMode 设置为 RespectExifOrientation。但是,我不能使用这个函数,因为位图应该作为 Direct2D 效果的输入,所以 CPU 不需要访问原始像素数据。

0 投票
1 回答
2022 浏览

windows-8.1 - 检查 Windows 8.1 64 位上的 Windows 映像组件

问题: 我试图在我的 Windows 8.1 64 位上安装 Ansys 15 64 位。在先决条件检查中,它没有检测到 WIC 已安装。安装程序在我的另一台笔记本电脑(也是 Windows 8.1 64 位)上工作。

尝试过的解决方案 我知道 WIC 是预装的,并且没有适用于 Windows 8.1 的安装程序。(XP 的安装程序可用...无论如何都尝试安装它,但未成功)。所以,我尝试更新我的窗口,使用 SFC /SCANNOW 等检查系统。

问题

1.如何检测Windows 8.1是否安装了WIC?(针对 XP 提出了类似的问题。其解决方案不适用于此处)

2.如何在Windows 8.1上安装WIC?(我不想重新安装 Windows)

0 投票
1 回答
682 浏览

c++ - WICConvertBitmapSource() 给出链接错误

我试图使用 WIC 对图像进行编码。我制作了简单的dll(编码/解码)并从另一个应用程序中引用它。

我添加my_bitmap_converter()了一个打算使用的转换,WICConvertBitmapSource()但它给了我一个链接错误。这是我的工作

我怎样才能摆脱这个错误

错误 1 ​​错误 LNK2019:未解析的外部符号 _WICConvertBitmapSource@12 在函数“int __cdecl my_bitmap_converter(struct _GUID const &,struct IWICBitmapSource *,struct IWICBitmapSource * *)”(?my_bitmap_converter@@YAHABU_GUID@@PAUIWICBitmapSource@@PAPAU2@@Z) 中引用

---wincodec.h---

0 投票
0 回答
233 浏览

c++ - WICConvertBitmapSource() 为 GUID_WICPixelFormat16bppCbCr 引发错误

我需要将 rgb 转换为 YCBCR 像素格式。我用过WICConvertBitmapSource()。我的源像素格式是GUID_WICPixelFormat24bppBGR. 我想把它转换成GUID_WICPixelFormat16bppCbCr

当我试图将它传递给函数时,它返回 HRESULT 为 0x88982F50。如果我通过GUID_WICPixelFormat32bppBGRA,函数不会返回错误

我的问题是

  1. 为什么我的转换失败
  2. 我应该如何正确地将 RGB 转换为 YCbCr

  3. 0x88982F50 实际上是什么意思

这就是我尝试的方式。

0 投票
0 回答
964 浏览

c# - How do I construct a C# .NET WIC WriteableBitmap at is maximum resolution?

According to this -> https://social.msdn.microsoft.com/Forums/vstudio/en-US/58710bdd-4832-4531-a50a-b83a7e733cdd/maximum-size-of-a-writeablebitmap-systemwindowsmediaimagingwritablebitmap?forum=wpf

The maximum height and width of an image is 2^16 pixels at 32 bits per channel * 4 channels. The maximum size of a BitmapSource is 2^32 bytes (64 gigabytes) >and the maximum image size is four gigapixels. The minimum image size is 1x1.

The max size is (2^16)^2 = 4,294,967,296 pixels

Each pixel is 4 bytes per channel, and with four channels (A/R/G/B), that’s 16 bytes.

So the max size in bytes would be 16 * 4,294,967,296 = 68,719,476,736 bytes = 64 gigabytes.

However, I'm only able to go as high as

System.Windows.Media.Imaging.WriteableBitmap wbit = new WriteableBitmap(32000, 32000, 97, 97, PixelFormats.Bgra32, null);

If I go higher, for example to 33,000 x 33,000, the constructor throws a System.OverflowException: The image data generated an overflow during processing. ---> System.ArithmeticException: Overflow or underflow in the arithmetic operation.

My computer has 32GB of memory, running Windows 8.1, VS , and this is a .NET 4.5 console application, targeting 64-bit platform, and gcAllowVeryLargeObjects has been enabled in App.Config so this is not a problem related with .NET Maximum Object Size of 2GB. I can create an array of integers as large as 15GB in this application.

Additionally, I'm referencing PresentationCore, PresentationFramework, and WindowsBase to get access to WIC, which are all located inside C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\ which alarmed me at first because it was in the x86 directory but as I understand it, these are only used to retrieve metadata, and the real assemblies actually being used are in the GAC, so for example, in Windows 8.1 Pro, there is both 32bit and 64bit PresentationCore are at C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationCore\24f6c80242420a1cea5cc254bf420027 and at C:\Windows\assembly\NativeImages_v4.0.30319_64\PresentationCore\7a22d69ccf672cec14abf04d9551b3a0 respectively. Same type of deal goes for PresentationFramework and WindowsBase, and I'm not 100% on this, but I think application is probably using the 64-bit versions of these assemblies in the GAC even though the reference assemblies in the reference assemblies directory are being referenced.

Does anyone know how I can construct a WriteableBitmap at its maximum resolution of 2^16 which is 65,536 x 65,536 or what I am doing wrong?

0 投票
1 回答
245 浏览

image - 在基于 MFC 的应用程序中逐步渲染图像

浏览器可以逐步渲染渐进式图像。并且图像只有在被渐进编码的情况下才能被渐进解码。

例如,使用“隔行扫描”选项保存的 GIF 或 PNG 图像,或使用“逐行扫描”选项保存的 JPEG 图像。

我想像浏览器一样在基于 MFC 的应用程序中呈现渐进式图像。

Windows 图像处理组件提供 IWICProgressiveLevelControl 接口来逐步解码图像。

但我找不到任何示例来展示如何使用 IWICProgressiveLevelControl 同时逐步流式传输和显示图像。

任何意见,将不胜感激。谢谢。

0 投票
1 回答
67 浏览

image - 在 WIC 中设置量化因子

我正在尝试用我自己的使用 WIC 的编码器替换应用程序的编码器模块。旧的似乎将量化因子设置为 90(我不知道那里发生了什么,我只有 dll)。现在我也必须设置量化因子,但我不知道如何。有没有办法像传递一些值一样设置该值,或者我需要实现量化表并计算因子。我播种了一种在初始化编码器时设置图像质量(0到1)的方法,

PROPBAG2::pstrName = L"ImageQuality";

这对量化有影响吗?

这个问题看起来很傻,但谷歌并没有帮助我。谁能帮帮我吗。

0 投票
1 回答
540 浏览

c++ - IWICBitmapDecoder::Initialize() 失败

我有一个字节流pBitmap,我需要从中创建一个解码器。所以我尝试如下

hr 返回未找到的组件。这里可能是什么问题。

更新

我不确定我打算解码的位图源是否是 jpg。所以我可以理解将容器格式传递为“GUID_ContainerFormatJpeg”是不正确的。所以我尝试了IWICImagingFactory::CreateDecoderFromStream

但结果是一样的。我从一个文件启动流。这很好用。

所以问题应该出在启动流中。

我创建了一个编码器并做了一些事情并将它们保存到一个文件中writepixel(不创建解码器)

它可以保存精美的图像。所以我可以说 pBitmap 肯定包含图像数据。

这里可能是什么问题。

0 投票
2 回答
1084 浏览

c# - 在 C# 中为新创建的 JpegXR 编码图像创建新的 BitmapMetadata

我正在尝试将位图创建(编码)到文件中 - 格式应为 JpegXR 并且我希望元数据与它相关联。WIC 和它在 C# (.Net) 中的对应物做得很好,但我未能创建任何类型的元数据对象。

这就是我想要做的(wb 是我的形象;没有元数据它可以工作):

结果是:meta0 == nullmeta1也产生null

无论我提供什么字符串,调用new BitmapMetadata("")都会引发异常:ArgumentException“找不到属性”。

那么应该如何为从头开始创建的图像提供/创建图像元数据呢?

0 投票
2 回答
729 浏览

c++ - 强制 WIC 将图像数据视为 RGB

我有一个 BYTE 数组(RGB 格式)的图像,我需要对其进行编码。我做了,但是颜色变了。

做了一些操作,还尝试设置像素格式。

但它总是设置为“GUID_WICPixelFormat24bppBGR”

我在这里写图像数据。

问题是图像的颜色发生了变化,我发现如果我将 RGB 更改为 BGR,那么输出看起来很好。所以我做了这个

但我不想在这里花更多时间循环整个图像。我需要告诉 WIC“将数据视为 RGB(或 BGR)”。

那可能吗?如果是那怎么办?