FB II Compiler
Convert CICN to PICT
Hi, I just tried and got it work using ToolBox routine.
I don't know why it did not work with FB's OPENPICTURE & CLOSEPICTURE statement.
BTW, getting pict handle using copybits (or other QD routine between OPENPICTURE--CLOSEPICTURE) sometimes fail with out of memory. I can check it using FN EMPTYRECT. But I only want to put an image into scrap, so I want to use temporary memory to handle large picture. Anyone knows how to do that?
icnHndl& = FN GETCICON (id%) 'get icon handle
rect;8 = [icnHndl&]+6 'get cicn's rect
CALL PLOTCICON(rect, icnHndl&) 'put to window
COMPILE LONG IF 1
CALL GETPORT (wPort&)
pictH& = FN OPENPICTURE(rect)
CALL COPYBITS (#wPort&+2,#wPort&+2,rect,rect,_srcCopy,_NIL)
dummy;8 = [pictH&] + _picFrame
LONG IF FN EMPTYRECT (dummy) ' If fail, the rect will be empty.
CALL PARAMTEXT ("CanUt get pictureI","","","")
err = FN ALERT (1,0)
PICTURE FIELD #1, &pictH&, @rect, _framed
COMPILE END IF
CALL DISPOSCICON(icnHndl&) 'dispose color icon handle