User Tools

Site Tools


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

PROP:PrintMode is a property of a specific IMAGE control (or SYSTEM for all) that specifies how the PROP:ImageBlob property assignment stores images in the BLOB.

A value of 1 indicates that decoded (DIB or BMP) image information is only required to be stored.

A value of 2 indicates that undecoded (native) image information is only required to be stored.

When set to 3, both the original (undecoded) data and the decoded DIB data are available, allowing PROP:ImageBlob to store the image in its native format (such as JPG) in the BLOB, in addition to the decoded DIB data.

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('TopSpeed'),PRE(Fil)   !A file with a memo field
MyBlob    BLOB,BINARY
Rec        RECORD
F1          LONG
          END
         END
FileName  STRING(64)              !Filename variable
CODE
OPEN(SomeFile); OPEN(WinView)
DISABLE(?LastPic)
IF NOT FILEDIALOG('File to View',FileName,'Images|*.BMP;*.PCX;*.JPG;*.WMF',0)
 RETURN                               !Return if no file chosen
END
?Image{PROP:PrintMode} = 3            !Setup to store native and DIB formats
?Image{PROP:Text} = FileName
ACCEPT
 CASE ACCEPTED()
 OF ?NewPic
  IF NOT FILEDIALOG('File to View',FileName,'Images|*.BMP;*.PCX;*.JPG;*.WMF',0)
   BREAK
  END
  ?Image{PROP:Text} = FileName
 OF ?SavePic
  Fil:MyBlob{PROP:Handle} = ?Image{PROP:ImageBlob}   !Put image into BLOB
  ADD(SomeFile)                                      !and save it to the file on disk
  ENABLE(?LastPic)                                   !activate Last Picture button
 OF ?LastPic
  ?Image{PROP:ImageBlob} = Fil:MyBlob{PROP:Handle}   !Put last saved BLOB into image
 END
END

See Also:     PROP:ImageBlob

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