1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-26 02:14:22 +00:00

Fix for CoreGraphics image loading on iOS. Auto-linked library fix for win32.

This commit is contained in:
Julian Storer 2010-09-01 14:29:16 +01:00
parent 5a89fc6ad8
commit f953c19efb
6 changed files with 1691 additions and 1601 deletions

View file

@ -777,6 +777,15 @@ const Image juce_loadWithCoreImage (InputStream& input)
MemoryBlock data;
input.readIntoMemoryBlock (data, -1);
#if JUCE_IOS
JUCE_AUTORELEASEPOOL
UIImage* image = [UIImage imageWithData: [NSData dataWithBytesNoCopy: data.getData() length: data.getSize()]];
if (image != nil)
{
CGImageRef loadedImage = image.CGImage;
#else
CGDataProviderRef provider = CGDataProviderCreateWithData (0, data.getData(), data.getSize(), 0);
CGImageSourceRef imageSource = CGImageSourceCreateWithDataProvider (provider, 0);
CGDataProviderRelease (provider);
@ -785,6 +794,7 @@ const Image juce_loadWithCoreImage (InputStream& input)
{
CGImageRef loadedImage = CGImageSourceCreateImageAtIndex (imageSource, 0, 0);
CFRelease (imageSource);
#endif
if (loadedImage != 0)
{
@ -798,7 +808,10 @@ const Image juce_loadWithCoreImage (InputStream& input)
CGContextDrawImage (cgImage->context, CGRectMake (0, 0, image.getWidth(), image.getHeight()), loadedImage);
CGContextFlush (cgImage->context);
#if ! JUCE_IOS
CFRelease (loadedImage);
#endif
return image;
}

View file

@ -12,9 +12,22 @@
#pragma comment(lib, "oleaut32.lib")
#pragma comment(lib, "advapi32.lib")
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib, "comsupp.lib")
#pragma comment(lib, "version.lib")
#ifdef _NATIVE_WCHAR_T_DEFINED
#ifdef _DEBUG
#pragma comment(lib, "comsuppwd.lib")
#else
#pragma comment(lib, "comsuppw.lib")
#endif
#else
#ifdef _DEBUG
#pragma comment(lib, "comsuppd.lib")
#else
#pragma comment(lib, "comsupp.lib")
#endif
#endif
#if JUCE_OPENGL
#pragma comment(lib, "OpenGL32.Lib")
#pragma comment(lib, "GlU32.Lib")