home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 4611 / fw16d.ins / IDE / SOURCE / BITMAPS.PRG next >
Text File  |  1994-06-11  |  2KB  |  61 lines

  1. #include "FiveWin.ch"
  2.  
  3. //----------------------------------------------------------------------------//
  4.  
  5. function BmpNew() ; WinExec( "PBrush" ) ; return nil
  6.  
  7. //----------------------------------------------------------------------------//
  8.  
  9. function BmpOpen( cBmpFile )
  10.  
  11.    local oWndBmp, oBar, oBmp, oIcon, oLupa, oCoors, oFont
  12.  
  13.    DEFAULT cBmpFile := cGetFile( "Windows Bitmap (*.bmp) | *.bmp",;
  14.                                  "Select a BMP" )
  15.  
  16.    if ! Empty( cBmpFile )
  17.  
  18.       DEFINE ICON oIcon RESOURCE "Bitmap"
  19.  
  20.       DEFINE WINDOW oWndBmp FROM 1, 1 TO 23, 33 ;
  21.          ICON oIcon TITLE "Bitmap: " + cNoPath( cNoExt( cBmpFile ) ) ;
  22.          MDICHILD
  23.  
  24.       DEFINE BUTTONBAR oBar OF oWndBmp
  25.  
  26.       DEFINE FONT oFont NAME "Arial" SIZE 5, 13
  27.  
  28.       @ 9, 160 SAY oCoors PROMPT "   0,   0" SIZE 120, 10 ;
  29.          PIXEL OF oBar FONT oFont
  30.  
  31.       DEFINE BUTTON RESOURCE "Edit" OF oBar ;
  32.          ACTION WinExec( "pbrush " + cBmpFile ) ;
  33.          MESSAGE "Edit this Bitmap"
  34.  
  35.       DEFINE BUTTON RESOURCE "ZoomOut" OF oBar ;
  36.          ACTION ( oBmp:lStretch := ! oBmp:lStretch, oBmp:Refresh( .t. ) ) ;
  37.          MESSAGE "Adjust this Bitmap"
  38.  
  39.       DEFINE BUTTON RESOURCE "Report" GROUP OF oBar ;
  40.          ACTION ( oBmp:HardCopy( 4 ) ) ;
  41.          MESSAGE "Send this bitmap to the printer"
  42.  
  43.       DEFINE CURSOR oLupa RESOURCE "Lupa"
  44.  
  45.       @ 0, 0 BITMAP oBmp FILENAME cBmpFile SCROLL ADJUST OF oWndBmp ;
  46.          CURSOR oLupa SIZE 400, 400
  47.  
  48.       oBmp:bMMoved = { | nRow, nCol | ;
  49.                          oCoors:SetText( Transform( nRow, "9999" ) + "-" + ;
  50.                                          Transform( nCol, "9999" ) ) }
  51.  
  52.       oWndBmp:SetControl( oBmp )
  53.  
  54.       ACTIVATE WINDOW oWndBmp
  55.  
  56.    endif
  57.  
  58. return nil
  59.  
  60. //----------------------------------------------------------------------------//
  61.