Пример #1
0
BOOL fipMultiPage::open(fipMemoryIO& memIO, int flags) {
	// try to guess the file format from the filename
	FREE_IMAGE_FORMAT fif = memIO.getFileType();

	// check for supported file types
	if((fif == FIF_UNKNOWN) || (fif != FIF_TIFF) && (fif != FIF_ICO) && (fif != FIF_GIF))
		return FALSE;

	// open the stream
	_mpage = FreeImage_LoadMultiBitmapFromMemory(fif, memIO, flags);

	return (NULL != _mpage ) ? TRUE : FALSE;
}
Пример #2
0
BOOL fipImage::loadFromMemory(fipMemoryIO& memIO, int flag) {
	FREE_IMAGE_FORMAT fif = FIF_UNKNOWN;

	// check the file signature and get its format
	fif = memIO.getFileType();
	if((fif != FIF_UNKNOWN) && FreeImage_FIFSupportsReading(fif)) {
		// Free the previous dib
		if(_dib) {
			FreeImage_Unload(_dib);			
		}
		// Load the file
		_dib = memIO.load(fif, flag);
		_bHasChanged = TRUE;
		if(_dib == NULL)
			return FALSE;
		return TRUE;
	}
	return FALSE;
}