wic

WIC Direct2D CreateBitmapFromMemory: limitations on width and height?

拥有回忆 提交于 2019-12-11 02:56:36
问题 CreateBitmapFromMemory executes successfully when _nWidth is equal to or less than 644. If the value exceeds this value, the HRESULT value is -2003292276 Do limits exist on the width and height? #include <d2d1.h> #include <d2d1helper.h> #include <wincodecsdk.h> // Use this for WIC Direct2D functions void test() { IWICImagingFactory *m_pIWICFactory; ID2D1Factory *m_pD2DFactory; IWICBitmap *m_pEmbeddedBitmap; ID2D1Bitmap *m_pD2DBitmap; unsigned char *pImageBuffer = new unsigned char[1024*1024];

Using WIC to Quickly Create Scaled Down Bitmap that honors EXIF Orientation Tag

懵懂的女人 提交于 2019-12-10 17:09:17
问题 I'm looking for the fastest way to create scaled down bitmap that honors EXIF orientation tag Ref :https://weblogs.asp.net/bleroy/the-fastest-way-to-resize-images-from-asp-net-and-it-s-more-supported-ish Currently i use the following code to create a Bitmap that honors EXIF Orientation tag static Bitmap FixImageOrientation(Bitmap srce) { const int ExifOrientationId = 0x112; // Read orientation tag if (!srce.PropertyIdList.Contains(ExifOrientationId)) return srce; var prop = srce

Image size is drastically increasing after applying a simple watermark

流过昼夜 提交于 2019-12-08 13:34:33
问题 I've a set of images that I'm programmatically drawing a simple watermark on them using System.Windows and System.Windows.Media.Imaging (yes, not with GDI+) by following a tutorial in here. Most of the images are not more than 500Kb , but after applying a simple watermark, which is a text with a transparent background, the image size is drastically increasing. For example, a 440Kb image is becoming 8.33MB after applying the watermark with the below method, and that is shocking me. private

DirectX11 CreateWICTextureFromMemory Using PNG

家住魔仙堡 提交于 2019-12-08 01:52:42
问题 I've currently got textures loading using CreateWICTextureFromFile however I'd like a little more control over it, and I'd like to store images in their byte form in a resource loader. Below is just two sets of test code that return two separate results and I'm looking for any insight into a possible solution. ID3D11ShaderResourceView* srv; std::basic_ifstream<unsigned char> file("image.png", std::ios::binary); file.seekg(0,std::ios::end); int length = file.tellg(); file.seekg(0,std::ios::beg

Why using WIC in my 32 bit application fails in Windows 7 32 bit?

橙三吉。 提交于 2019-12-07 13:41:50
问题 I have Win32 C++ sample application that uses Windows Image Component in Visual Studio Pro 2012 Update 2. I built this app for X86 and tested in Windows 7 X64 SP1 and Windows 7 X86 SP1. It works fine with the first one and it fails on the later with "class not registered". If I build the same code with VS2008 it works fine. The WIC instance is created in the sample app as follows: #include "wincodec.h" ... case WM_CREATE: { IWICImagingFactory *m_pIWICFactory; HRESULT hr = S_OK; CoInitialize

What's the relationship between WIC and GDI+?

跟風遠走 提交于 2019-12-07 02:50:44
问题 I'm fuzzy on the relationship between Windows Imaging Component (WIC) and GDI+. I've done some work in the past that showed that, for example, WIC produces visually superior GIF encodings, but I'm surprised I don't see more people using it for image processing vs. GDI+. I know it doesn't have GDI+'s draw operations, but for encoding/decoding it seems superior. So why don't we see a migration? 回答1: The relationship (or rather the difference between) WIC and GDI+ is that WIC is an extensible

DirectX11 CreateWICTextureFromMemory Using PNG

北城余情 提交于 2019-12-06 09:20:51
I've currently got textures loading using CreateWICTextureFromFile however I'd like a little more control over it, and I'd like to store images in their byte form in a resource loader. Below is just two sets of test code that return two separate results and I'm looking for any insight into a possible solution. ID3D11ShaderResourceView* srv; std::basic_ifstream<unsigned char> file("image.png", std::ios::binary); file.seekg(0,std::ios::end); int length = file.tellg(); file.seekg(0,std::ios::beg); unsigned char* buffer = new unsigned char[length]; file.read(&buffer[0],length); file.close();

Why using WIC in my 32 bit application fails in Windows 7 32 bit?

拥有回忆 提交于 2019-12-05 20:41:31
I have Win32 C++ sample application that uses Windows Image Component in Visual Studio Pro 2012 Update 2. I built this app for X86 and tested in Windows 7 X64 SP1 and Windows 7 X86 SP1. It works fine with the first one and it fails on the later with "class not registered". If I build the same code with VS2008 it works fine. The WIC instance is created in the sample app as follows: #include "wincodec.h" ... case WM_CREATE: { IWICImagingFactory *m_pIWICFactory; HRESULT hr = S_OK; CoInitialize(NULL); // create WIC factory (m_pIWICFactory) hr = CoCreateInstance( &CLSID_WICImagingFactory, NULL,

VS 2010 BootStrapper for WIC (Windows Imaging Component) before .Net 4 installation in XP

自作多情 提交于 2019-12-04 16:04:57
I have created a setup and deployment project for my .Net 4 app in VS 2010. In my prerequisites i have checked .Net4 prerequisite but i have learned that .Net4 has left out WIC (Windows Imaging Component) to make it light. When i run my setup in Vista/Win7 the Net4 installation does not give error for WIC but when i install it in XP it gives error for WIC. Then i have to install WIC manually first and then run my setup. I need a bootstrapper for WIC which runs before .Net4 installation in XP. Please suggest how it can be done or a link for it. Thanks in Advance. I've faced this annoying

How to save a ID2D1Bitmap to a file using WIC?

假如想象 提交于 2019-12-02 03:43:51
I have a problem with saving a bitmap into a file. I'm using How to save ID2D1Bitmap to PNG file as a reference, but I have a different error than the one posted in that. I get error 0x88990015 HRESULT, which means: The resource used was created by a render target in a different resource domain. Here's my code: void Wnd::SavePng(LPCWSTR Path,ID2D1Bitmap* pBit) { CComPtr<ID2D1RenderTarget> pRT; CComPtr<IWICBitmap> pB; CComPtr<IWICBitmapEncoder> pEncoder; CComPtr<IWICBitmapFrameEncode> pFrame; CComPtr<IWICStream> pStream; WICPixelFormatGUID format = GUID_WICPixelFormat32bppPBGRA; HRESULT Hr = m