[futurebasic] CFMutableDictionary...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2012 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Tue, 31 Jan 2012 08:51:37 -0500
Robert Covington asked:

> Can somebody help me fathom this ...it keeps crashing..


Robert,

Maybe something like this:


include "Tlbx CFNumber.incl"

system CFStringRef kCGImageDestinationLossyCompressionQuality

dim as CFMutableDictionaryRef  jpgOptions
dim as CFNumberRef             compression
dim as float                   compValue : compValue = 0.5

jpgOptions = fn CFDictionaryCreateMutable( _KCFAllocatorDefault, 0, @kCFTypeDictionaryKeyCallBacks, @kCFTypeDictionaryValueCallBacks ) 

compression = fn CFNumberCreate( _KCFAllocatorDefault, _kCFNumberFloatType, @compValue )
// CFDictionaryAddValue( jpgOptions, kCGImageDestinationLossyCompressionQuality, compression )
CFDictionarySetValue( jpgOptions, kCGImageDestinationLossyCompressionQuality, compression )

Ken