User Tools

Site Tools


prop_imagebits.htm
Navigation:  Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:ImageBits ====== Previous pageReturn to chapter overviewNext page

Property of an IMAGE control that allows bitmap images displayed in the control to be moved into and out of memo fields. Any image displayed in the control can be stored. PROP:ImageBlob performs the same type of function for a BLOB.

Example:

WinView   WINDOW('View'),AT(0,0,320,200),MDI,MAX,HVSCROLL

       IMAGE(),AT(0,0,,),USE(?Image)

      BUTTON('Save Picture'),AT(80,180,60,20),USE(?SavePic)

      BUTTON('New Picture'),AT(160,180,60,20),USE(?NewPic)

      BUTTON('Last Picture'),AT(240,180,60,20),USE(?LastPic)

     END

SomeFile  FILE,DRIVER('Clarion'),PRE(Fil)    !A file with a memo field

MyMemo    MEMO(65520),BINARY

Rec      RECORD

F1       LONG

     . .  

FileName  STRING(64)              !Filename variable

CODE

OPEN(SomeFile)

OPEN(WinView)

DISABLE(?LastPic)

IF NOT FILEDIALOG('Choose File to View',FileName,'BitMap|*.BMP|PCX|*.PCX',0)

 RETURN                     !Return if no file chosen

END

?Image{PROP:Text} = FileName

ACCEPT

 CASE ACCEPTED()

 OF ?NewPic

  IF NOT FILEDIALOG('Choose File to View',FileName,'BitMap|*.BMP|PCX|*.PCX',0)

   BREAK                    !Return if no file chosen

  END

  ?Image{PROP:Text} = FileName

 OF ?SavePic

  Fil:MyMemo = ?Image{PROP:ImageBits}     !Put image into memo

  ADD(SomeFile)                ! and save it to the file on disk

  ENABLE(?LastPic)              ! activate Last Picture button

 OF ?LastPic

  ?Image{PROP:ImageBits} = Fil:MyMemo      !Put last saved memo into image

 END

END

prop_imagebits.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1