本文整理汇总了C++中IWICFormatConverter::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IWICFormatConverter::Release方法的具体用法?C++ IWICFormatConverter::Release怎么用?C++ IWICFormatConverter::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWICFormatConverter
的用法示例。
在下文中一共展示了IWICFormatConverter::Release方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convert_file_icon
static bool convert_file_icon(const HICON icon, Bmp& bmp) {
static IWICImagingFactory* img_factory = 0;
if (!img_factory) {
// In VS 2011 beta, clsid has to be changed to CLSID_WICImagingFactory1 (from CLSID_WICImagingFactory)
if (!SUCCEEDED(::CoInitialize(0)) || !SUCCEEDED(::CoCreateInstance(CLSID_WICImagingFactory1, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&img_factory)))) {
return false;
}
}
IWICBitmap* pBitmap = 0;
IWICFormatConverter* pConverter = 0;
UINT cx = 0, cy = 0;
if (SUCCEEDED(img_factory->CreateBitmapFromHICON(icon, &pBitmap))) {
if (SUCCEEDED(img_factory->CreateFormatConverter(&pConverter))) {
if (SUCCEEDED(pConverter->Initialize(pBitmap, GUID_WICPixelFormat32bppPBGRA, WICBitmapDitherTypeNone, 0, 0.0f, WICBitmapPaletteTypeCustom))) {
if (SUCCEEDED(pConverter->GetSize(&cx, &cy))) {
const UINT stride = cx * sizeof(DWORD);
const UINT buf_size = cy * stride;
Byte* buf = new Byte[buf_size];
pConverter->CopyPixels(0, stride, buf_size, buf);
bmp.load_bits_only(buf, buf_size, cx, -(int)cy);
delete [] buf;
}
}
pConverter->Release();
}
pBitmap->Release();
}
return true;
}
示例2: CoCreateInstance
SpriteSheet::SpriteSheet(wchar_t* filename, Graphics* gfx)
{
this->gfx = gfx;
bmp = NULL;
HRESULT hr;
//create a wic factory
IWICImagingFactory *wicFactory = NULL;
hr = CoCreateInstance(
CLSID_WICImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
IID_IWICImagingFactory,
(LPVOID*)&wicFactory);
//create a decoder
IWICBitmapDecoder *wicDecoder = NULL;
hr = wicFactory->CreateDecoderFromFilename(
filename, // THE FILE NAME
NULL, // the preferred vendor
GENERIC_READ, // we're reading the file, not writing
WICDecodeMetadataCacheOnLoad,
&wicDecoder);
// read a frame from the image
IWICBitmapFrameDecode* wicFrame = NULL;
hr = wicDecoder->GetFrame(0, &wicFrame);
// create a converter
IWICFormatConverter *wicConverter = NULL;
hr = wicFactory->CreateFormatConverter(&wicConverter);
// setup the converter
hr = wicConverter->Initialize(
wicFrame, // frame
GUID_WICPixelFormat32bppPBGRA, // pixel format
WICBitmapDitherTypeNone, // irrelevant
NULL, // no palette needed, irrlevant
0.0, // alpha transparency % irrelevant
WICBitmapPaletteTypeCustom // irrelevant
);
// use the converter to create an D2D1Bitmap
/// ID2D1Bitmap* bmp; // this will be a member variable
hr = gfx->GetRenderTarget()->CreateBitmapFromWicBitmap(
wicConverter, // converter
NULL, // D2D1_BITMAP_PROPERIES
&bmp // destiatnion D2D1 bitmap
);
if (wicFactory) wicFactory->Release();
if (wicDecoder) wicDecoder->Release();
if (wicConverter) wicConverter->Release();
if (wicFrame) wicFrame->Release();
}
示例3:
BitmapWrapperD2D::BitmapWrapperD2D(bitmap bmp)
{
IWICBitmap* wic = 0;
Graphics::locator.getfactory()->CreateBitmapFromMemory(
bmp.width(), bmp.height(),
GUID_WICPixelFormat32bppBGRA,
4 * bmp.width(),
bmp.length(),
(BYTE*)bmp.data(),
&wic);
if (wic != 0)
{
IWICFormatConverter* converter = nullptr;
IWICBitmap* temp = nullptr;
int result = Graphics::locator.getfactory()->CreateFormatConverter(&converter);
if (result == 0)
{
converter->Initialize(wic,
GUID_WICPixelFormat32bppPBGRA,
WICBitmapDitherTypeNone, 0, 0.f,
WICBitmapPaletteTypeMedianCut);
Graphics::locator.getfactory()->CreateBitmapFromSource(converter, WICBitmapNoCache, &temp);
converter->Release();
}
wic->Release();
ID2D1BitmapRenderTarget* target = Graphics::locator.gettarget();
if (target)
{
target->CreateBitmapFromWicBitmap(temp, &source);
temp->Release();
temp = nullptr;
}
else
{
source = nullptr;
}
}
else
{
source = nullptr;
}
}
示例4: LoadBitmapFromFile
// =========================================================
// Load the specified bitmap from file into D2D bitmap
// =========================================================
BOOL Loader::LoadBitmapFromFile(LPCWSTR filename, const Graphics* graphicsWrapper, ID2D1Bitmap** ppBitmap)
{
if (!isInitialized)
return FALSE;
HRESULT hr;
IWICBitmapDecoder *pDecoder = NULL;
IWICBitmapFrameDecode *pSource = NULL;
IWICFormatConverter *pConverter = NULL;
hr = pFactory->CreateDecoderFromFilename(filename, NULL, GENERIC_READ, WICDecodeMetadataCacheOnDemand, &pDecoder);
CHECK(failedDecoder);
hr = pDecoder->GetFrame(0, &pSource);
CHECK(failedGetFrame);
hr = pFactory->CreateFormatConverter(&pConverter);
CHECK(failedConverter);
hr = pConverter->Initialize(pSource, GUID_WICPixelFormat32bppPBGRA, WICBitmapDitherTypeNone, NULL, 0.0, WICBitmapPaletteTypeMedianCut);
CHECK(failedConversion);
hr = graphicsWrapper->pRenderTarget->CreateBitmapFromWicBitmap(pSource, ppBitmap);
CHECK(failedBitmap);
return TRUE;
failedBitmap:
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to create bitmap.\n");
failedConversion:
pConverter->Release();
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to initialise format converter.\n");
failedConverter:
pSource->Release();
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to create format converter.\n");
failedGetFrame:
pDecoder->Release();
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to get frame 0 from source bitmap.\n");
failedDecoder:
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to create bitmap decoder.\n");
return FALSE;
}
示例5: make_pair
pair<imgcontext, size_t> imagecache::createimage(bitmap bmp)
{
size_t id = bmp.id();
if (temp[imgcon][id] || cache[imgcon][id])
{
return make_pair(imgcon, id);
}
else
{
IWICBitmap* wic = 0;
imgfactory->CreateBitmapFromMemory(
bmp.width(), bmp.height(),
GUID_WICPixelFormat32bppBGRA,
4 * bmp.width(),
bmp.length(),
(BYTE*)bmp.data(),
&wic);
if (wic)
{
IWICFormatConverter* spConverter = 0;
int result = imgfactory->CreateFormatConverter(&spConverter);
if (result == 0)
{
spConverter->Initialize(wic,
GUID_WICPixelFormat32bppPBGRA,
WICBitmapDitherTypeNone, NULL, 0.f,
WICBitmapPaletteTypeMedianCut);
imgfactory->CreateBitmapFromSource(spConverter, WICBitmapNoCache, &temp[imgcon][id]);
spConverter->Release();
}
wic->Release();
}
}
return make_pair(imgcon, id);
}
示例6: SHCreateMemStream
void GL::Image::load(const unsigned char *buf, size_t bufSize)
{
if (CoInitializeEx(NULL, COINIT_MULTITHREADED) != S_OK) {
// bad!
return;
}
IStream *stream = SHCreateMemStream((const BYTE*)buf, (UINT)bufSize);
if (stream != NULL) {
IWICImagingFactory *pFactory;
if (CoCreateInstance(CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (LPVOID*)&pFactory) == S_OK) {
IWICBitmapDecoder *pDecoder;
if (pFactory->CreateDecoderFromStream(stream, &CLSID_WICPngDecoder, WICDecodeMetadataCacheOnDemand, &pDecoder) == S_OK) {
IWICBitmapFrameDecode *frame;
if (pDecoder->GetFrame(0, &frame) == S_OK) {
UINT w, h;
if (frame->GetSize(&w, &h) == S_OK) {
width_ = w;
height_ = h;
}
IWICFormatConverter *formatConverter;
if (pFactory->CreateFormatConverter(&formatConverter) == S_OK) {
if (formatConverter->Initialize(frame, GUID_WICPixelFormat32bppPBGRA, WICBitmapDitherTypeNone, nullptr, 0.0, WICBitmapPaletteTypeCustom) == S_OK) {
unsigned char *pixels = new unsigned char[w * h * 4];
if (formatConverter->CopyPixels(0, w * 4, w * h * 4, pixels) == S_OK) {
loadTextureData_(pixels);
}
delete[] pixels;
}
formatConverter->Release();
}
}
pDecoder->Release();
}
pFactory->Release();
}
stream->Release();
}
CoUninitialize();
}
示例7: LoadBitmapFromFile
//@https://msdn.microsoft.com/de-de/library/windows/desktop/dd756686(v=vs.85).aspx
HRESULT BitmapDecoder::LoadBitmapFromFile(ID2D1RenderTarget * pRenderTarget, PCWSTR uri, ID2D1Bitmap ** ppBitmap)
{
IWICImagingFactory* pFactory;
HRESULT hr = CoCreateInstance(CLSID_WICImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
IID_IWICImagingFactory,
(LPVOID*)&pFactory
);
//IWICStream *pStream = NULL; //?
//IWICBitmapScaler *pScaler = NULL; //?
IWICBitmapDecoder *pDecoder = NULL;
if (SUCCEEDED(hr))
{
hr = pFactory->CreateDecoderFromFilename(uri, NULL, GENERIC_READ, WICDecodeMetadataCacheOnLoad, &pDecoder);
}
IWICBitmapFrameDecode *pSource = NULL;
if (SUCCEEDED(hr))
{
hr = pDecoder->GetFrame(0, &pSource);
}
IWICFormatConverter *pConverter = NULL;
if (SUCCEEDED(hr))
{
hr = pFactory->CreateFormatConverter(&pConverter);
}
if (SUCCEEDED(hr))
{
hr = pConverter->Initialize(
pSource,
GUID_WICPixelFormat32bppPBGRA,
WICBitmapDitherTypeNone,
NULL,
0.f,
WICBitmapPaletteTypeMedianCut
);
}
if (SUCCEEDED(hr))
{
pRenderTarget->CreateBitmapFromWicBitmap(pConverter, NULL, ppBitmap);
}
if (pDecoder != nullptr)
{
pDecoder->Release();//SafeRelease(&pDecoder);
}
if (pSource != nullptr)
{
pSource->Release();
}
//SafeRelease(&pSource);
// pStream->Release();//SafeRelease(&pStream);
if(pConverter!= nullptr)
{
pConverter->Release();
}
//SafeRelease(&pConverter);
// pScaler->Release();//SafeRelease(&pScaler);
if (pFactory != nullptr)
{
pFactory->Release();
}
return hr;
}
示例8: ConvertRgbToYCbCr
HRESULT YCbCrPixelFormatConverter::ConvertRgbToYCbCr(
/* [in] */ const WICRect *prc,
/* [in] */ UINT cbStride,
/* [in] */ UINT cbPixelsSize,
/* [out] */ BYTE *pbPixels)
{
HRESULT result = S_OK;
//Sanity check
WICPixelFormatGUID srcPixelFormat;
bitmapSource->GetPixelFormat(&srcPixelFormat);
if (srcPixelFormat != GUID_WICPixelFormat32bppBGRA)
{
result = E_UNEXPECTED;
return result;
}
IWICImagingFactory *codecFactory = NULL;
IWICFormatConverter *formatConverter = NULL;
if (SUCCEEDED(result))
{
result = CoCreateInstance(CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, (LPVOID*) &codecFactory);
}
if (SUCCEEDED(result))
{
result = codecFactory->CreateFormatConverter(&formatConverter);
}
if (SUCCEEDED(result))
{
//We will convert to 24RGB first, since it is easier to convert to YCbCr from there
result = formatConverter->Initialize(bitmapSource,
GUID_WICPixelFormat24bppBGR, WICBitmapDitherTypeSolid, NULL, 1.0, WICBitmapPaletteTypeFixedWebPalette);
}
if (SUCCEEDED(result))
{
result = formatConverter->CopyPixels(prc, cbStride, cbPixelsSize, pbPixels);
}
//Since the two formats have same number of bytes, we will do an inplace conversion
UINT width, height;
if (prc == NULL)
{
if (SUCCEEDED(result))
{
result = bitmapSource->GetSize(&width, &height);
}
}
else
{
width = prc->Width;
height = prc->Height;
}
if (SUCCEEDED(result))
{
//Loop on the data and do the conversion
BYTE *curPos = NULL;
curPos = pbPixels;
for (int i = 0 ; i < height; i++)
{
for (int j = 0; j < width; j++)
{
BYTE R, G ,B;
BYTE Y, Cb, Cr;
B = *curPos;
G = *(curPos+1);
R = *(curPos+2);
//Do the maths
Y = Clamp(0, 255, (0.257*R) + (0.504*G) + (0.098*B) + 16);
Cb = Clamp(0, 255, (-0.148*R) - (0.291*G) + (0.439*B) + 128);
Cr = Clamp(0, 255, (0.439*R) - (0.368*G) - (0.071*B) + 128);
*curPos = Cr;
*(curPos+1) = Cb;
*(curPos+2) = Y;
//Advance to next pixel
curPos += 3;
}
curPos += (cbStride - (width * 3)); //Fast forward remaining part of the stride
}
}
if (formatConverter)
{
formatConverter->Release();
}
if (codecFactory)
{
codecFactory->Release();
}
return result;
}
示例9: LoadBitmapFromResource
// =========================================================
// Load the specified bitmap from file into D2D bitmap
// =========================================================
BOOL Loader::LoadBitmapFromResource(LPCWSTR resourceId, LPCWSTR resourceType, const Graphics* graphicsWrapper, ID2D1Bitmap** ppBitmap)
{
if (!isInitialized)
return FALSE;
HRESULT hr;
IWICStream *pStream = NULL;
IWICBitmapDecoder *pDecoder = NULL;
IWICBitmapFrameDecode *pSource = NULL;
IWICFormatConverter *pConverter = NULL;
HRSRC imageResHandle = NULL;
HGLOBAL imageResDataHandle = NULL;
void *pImageFile = NULL;
DWORD imageFileSize = 0;
HMODULE module = GetModuleHandle(0);
// Locate the resource
imageResHandle = FindResource(module, resourceId, resourceType);
if (!imageResHandle)
{
OutputDebugStringA("Loader::LoadBitmapFromResource -> Failed to locate resource.\n");
return FALSE;
}
imageResDataHandle = LoadResource(module, imageResHandle);
if (!imageResDataHandle)
{
OutputDebugStringA("Loader::LoadBitmapFromResource -> Failed to load resource.\n");
return FALSE;
}
// lock resource to get pointer to data
pImageFile = LockResource(imageResDataHandle);
if (!pImageFile)
{
OutputDebugStringA("Loader::LoadBitmapFromResource -> Failed to lock resource for processing.\n");
return FALSE;
}
// get the size of the image
imageFileSize = SizeofResource(module, imageResHandle);
if (!imageFileSize)
{
OutputDebugStringA("Loader::LoadBitmapFromResource -> Failed to obtain size of image resource.\n");
return FALSE;
}
// now that we have everything, we create the stream
hr = pFactory->CreateStream(&pStream);
CHECK(failedCreateStream);
// initialise the stream
hr = pStream->InitializeFromMemory((byte*)pImageFile, imageFileSize);
CHECK(failedStreamInit);
hr = pFactory->CreateDecoderFromStream(pStream, NULL, WICDecodeMetadataCacheOnDemand, &pDecoder);
CHECK(failedDecoder);
hr = pDecoder->GetFrame(0, &pSource);
CHECK(failedGetFrame);
hr = pFactory->CreateFormatConverter(&pConverter);
CHECK(failedConverter);
hr = pConverter->Initialize(pSource, GUID_WICPixelFormat32bppPBGRA, WICBitmapDitherTypeNone, NULL, 0.0, WICBitmapPaletteTypeMedianCut);
CHECK(failedConversion);
hr = graphicsWrapper->pRenderTarget->CreateBitmapFromWicBitmap(pConverter, ppBitmap);
CHECK(failedBitmap);
return TRUE;
failedBitmap:
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to create bitmap.\n");
failedConversion:
pConverter->Release();
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to initialise format converter.\n");
failedConverter:
pSource->Release();
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to create format converter.\n");
failedGetFrame:
pDecoder->Release();
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to get frame 0 from source bitmap.\n");
failedDecoder:
pStream->Release();
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to create bitmap decoder.\n");
return FALSE;
failedStreamInit:
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to initialize WIC stream.\n");
return FALSE;
failedCreateStream:
OutputDebugStringA("Loader::LoadBitmapFromFile -> Failed to create WIC stream.\n");
return FALSE;
}
示例10: LoadJPG
void LoadJPG(wchar_t *pwszJpg, HWND hwnd)
{
IWICImagingFactory *pFactory = NULL;
HRESULT hr = CoCreateInstance(CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pFactory));
if (SUCCEEDED(hr)) {
IWICBitmapDecoder *pDecoder = NULL;
hr = pFactory->CreateDecoderFromFilename(pwszJpg, NULL, GENERIC_READ, WICDecodeMetadataCacheOnDemand, &pDecoder);
if (SUCCEEDED(hr)) {
IWICBitmapFrameDecode *pIDecoderFrame = NULL;
hr = pDecoder->GetFrame(0, &pIDecoderFrame);
if (SUCCEEDED(hr)) {
IWICFormatConverter *pFC = NULL;
hr = pFactory->CreateFormatConverter(&pFC);
hr = pFC->Initialize(pIDecoderFrame, GUID_WICPixelFormat24bppBGR, WICBitmapDitherTypeNone, NULL, 0.0, WICBitmapPaletteTypeCustom);
const int nBytesPixel = 3; // GUID_WICPixelFormat24bppBGR 每像素3字节(24bits)
BITMAPINFO bmpInfo;
ZeroMemory(&bmpInfo, sizeof(BITMAPINFO));
bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
hr = pIDecoderFrame->GetSize((UINT*)&bmpInfo.bmiHeader.biWidth, (UINT*)&bmpInfo.bmiHeader.biHeight);
bmpInfo.bmiHeader.biPlanes = 1;
bmpInfo.bmiHeader.biBitCount = 8 * nBytesPixel;
bmpInfo.bmiHeader.biCompression = BI_RGB;
BYTE *pBuf = NULL;
HDC hdc = GetDC(hwnd);
bmpInfo.bmiHeader.biHeight *= -1; // BMP 方向调整
HBITMAP hBmp = CreateDIBSection(hdc, &bmpInfo, DIB_RGB_COLORS, (void**)&pBuf, NULL, 0);
bmpInfo.bmiHeader.biHeight *= -1;
// 计算扫描线
unsigned int cbStride = nBytesPixel * bmpInfo.bmiHeader.biWidth;
unsigned int total = cbStride*bmpInfo.bmiHeader.biHeight;
hr = pFC->CopyPixels(NULL, cbStride, total, pBuf);
// HSL色彩空间变换
DirectX::XMVECTORF32 colorTransofrom = { 1.0f, 1.0f, 1.0f, 1.0f };
if (SUCCEEDED(hr)) {
for (int i = 0; i < bmpInfo.bmiHeader.biHeight; i++) {
for (int j = 0; j < bmpInfo.bmiHeader.biWidth; j++) {
BYTE *pColor = pBuf + cbStride*i + j * nBytesPixel;
DirectX::XMVECTOR colorM = DirectX::PackedVector::XMLoadUByteN4((DirectX::PackedVector::XMUBYTEN4*)pColor);
colorM = DirectX::XMColorRGBToHSL(colorM);
colorM = DirectX::XMColorModulate(colorM, colorTransofrom);
colorM = DirectX::XMColorHSLToRGB(colorM);
DirectX::PackedVector::XMStoreUByteN4((DirectX::PackedVector::XMUBYTEN4*)pColor, colorM);
SetPixel(hdc, j, i, RGB(pColor[2], pColor[1], pColor[0]));
}
}
}
ReleaseDC(hwnd, hdc);
if (SUCCEEDED(hr)) {
MakeMemDC(hBmp, hwnd);
InvalidateRect(hwnd, NULL, TRUE);
}
hr = pFC->Release();
pIDecoderFrame->Release();
}
pDecoder->Release();
}
pFactory->Release();
}
}
示例11: LoadFile
bool ResourceManager::LoadFile(ID2D1HwndRenderTarget* renderTarget, wchar_t * filename)
{
HRESULT result;
IWICImagingFactory2* wicFactory;
IWICBitmapDecoder* wicDecoder;
IWICBitmapFrameDecode* wicFrame;
IWICBitmapFlipRotator* wicFlip;
IWICFormatConverter *wicConverter;
Sprite* newSprite;
// WIC의 각종 인터페이스를 사용하기 위한 factory 생성
result = CoCreateInstance(CLSID_WICImagingFactory, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&wicFactory));
if (FAILED(result))
return false;
// 파일을 읽고 디코딩 하기 위한 decoder 생성
result = wicFactory->CreateDecoderFromFilename(filename, nullptr, GENERIC_READ, WICDecodeMetadataCacheOnDemand, &wicDecoder);
if (FAILED(result))
return false;
// decoder에서 프레임을 얻어옴, // 일반적인 이미지 파일은 single frame만을 지원하므로 0으로 고정
result = wicDecoder->GetFrame(0, &wicFrame);
if (FAILED(result))
return false;
// 수평으로 뒤집힌 이미지를 얻기 위해 BitmapFlipRotator 생성
result = wicFactory->CreateBitmapFlipRotator(&wicFlip);
if (FAILED(result))
return false;
// wicFrame를 수평으로 뒤집음
wicFlip->Initialize(wicFrame, WICBitmapTransformFlipHorizontal);
// WICBitmap을 D2DBitmap으로 변환시키기 위해 format converter 생성
result = wicFactory->CreateFormatConverter(&wicConverter);
if (FAILED(result))
return false;
// Converter[0]의 Format을 일반 이미지(wicFrame)에 맞춤
result = wicConverter->Initialize(wicFrame, GUID_WICPixelFormat32bppPBGRA, WICBitmapDitherTypeNone, NULL, 0.0f, WICBitmapPaletteTypeCustom);
if (FAILED(result))
return false;
// 리소스 정보를 저장 할 Sprite 생성
newSprite = new Sprite(renderTarget);
if (!newSprite)
return false;
// WICBitmap을 D2DBitmap으로 변환
//result = renderTarget->CreateBitmapFromWicBitmap(wicConverter, nullptr, &m_Bitmap);
result = renderTarget->CreateBitmapFromWicBitmap(wicConverter, nullptr, newSprite->GetBitmap());
if (FAILED(result))
return false;
ID2D1Bitmap* bitmap = *(newSprite->GetBitmap());
int numberOfFrame = bitmap->GetSize().width / IMAGE_SIZE;
int numberOfAction = bitmap->GetSize().height / IMAGE_SIZE;
newSprite->Initialize(numberOfFrame, numberOfAction);
wchar_t* buffer = new wchar_t[128];
wcscpy_s(buffer, wcslen(filename) + 1, filename);
// 스프라이트 등록
m_Sprites.push_back(newSprite);
m_Filenames.push_back(buffer);
wicConverter->Release();
wicConverter = nullptr;
wicFrame->Release();
wicFrame = nullptr;
wicFlip->Release();
wicFlip = nullptr;
wicDecoder->Release();
wicDecoder = nullptr;
wicFactory->Release();
wicFactory = nullptr;
return true;
}