Image* Image::loadPlatformResource(const char* name) { Vector<char> arr = loadResourceIntoArray(name); Image* img = new BitmapImage(); img->setNativeData(&arr, true); return img; }
PassRefPtr<Image> Image::loadPlatformResource(const char *name) { Vector<char> arr = loadResourceIntoArray(name); RefPtr<BitmapImage> img = BitmapImage::create(); RefPtr<SharedBuffer> buffer = SharedBuffer::create(arr.data(), arr.size()); img->setData(buffer, true); return img.release(); }
Image* Image::loadPlatformResource(const char* name) { Vector<char> arr = loadResourceIntoArray(name); Image* img = new BitmapImage(); RefPtr<SharedBuffer> buffer = new SharedBuffer(arr.data(), arr.size()); img->setData(buffer, true); return img; }