FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

DRAWING

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?

Osamu Shigematsu

WINDOW OFF
WINDOW #1

DIM rect.8,dummy.8

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)
  CALL CLOSEPICTURE

  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)
  END IF

  PICTURE FIELD #1, &pictH&, @rect, _framed
COMPILE END IF

CALL DISPOSCICON(icnHndl&) 'dispose color icon handle

DO
  HANDLEEVENTS
UNTIL 0