Tiff files with Freeimage
Posted: Thu Jul 07, 2011 4:22 pm
I'm trying to work with FreeImage multipage format (TIFF). I took the contributions of the example hbfimage harbour and have generated the libraries that integrates seamlessly into the program. As the theme of the images I am a relative novice, I want to know if anyone comes up with how. The following code adds, deletes and count the images (see /*--*/) , and everything it does perfectly. When I delete a picture off me and when I add it sum and the result is always correct:
But I don't know what it needs to be done for display in the window. I guess there's no display but I think that can be displayed one by one. Anyone know how.
Code: Select all
function Main( )
Local oIcon, oBar, oPopup, oImg, oInspec, oImg2
SET _3DLOOK ON
DEFINE ICON oIcon FILE "Tif.ico"
DEFINE WINDOW oWnd FROM 1, 1 TO 22, 75 ;
TITLE "Editor TIFF V 1.0" MENU BuildMenu() ;
ICON oIcon ;
MDI
fi_Initialise()
hImg := FI_OPENMULTIBITMAP( FIF_TIFF, IMAGES_IN + "sample1.tif",.f.,.f.,.t., TIFF_DEFAULT ) //Read only and keep cache in memory
/*
? "Page count :" + str(fi_GetPageCount( hImg ))
? "Delete page 1 "
fi_DeletePage( hImg, 1 )
? "Page count :" + str(fi_GetPageCount( hImg ))
hImg2 := fi_Load( FIF_JPEG, "sample1.jpg", JPEG_DEFAULT )
? "Añado una pagina más"
fi_appendpage(hImg, hImg2)
? "Page count :" + str(fi_GetPageCount( hImg ))
*/
FOR nPage := 1 TO fi_GetPageCount( hImg )
//How I can show all the pictures of the multipage file.
@ nPage , 1 IMAGE oImg FILE "Sample1.tiff" SIZE 200, 200 of oWnd ADJUST //Not work
NEXT
SET MESSAGE OF oWnd TO FWVERSION CLOCK DATE KEYBOARD NOINSET 2007
ACTIVATE WINDOW ownd MAXIMIZED
RETURN NIL
But I don't know what it needs to be done for display in the window. I guess there's no display but I think that can be displayed one by one. Anyone know how.