home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 4
/
BUGCD1997_05.BIN
/
aplic
/
clip4win
/
clip4win.exe
/
C4W30E.HUF
/
SOURCE
/
BITMAP.PRG
< prev
next >
Wrap
Text File
|
1994-06-20
|
1KB
|
48 lines
/////////////////////////
//
// bitmap.prg - draw a bitmap
//
// Written by: John M. Skelton, 17-Jun-94.
//
// Copyright (C) 1994 Skelton Software, Kendal Cottage, Hillam, Leeds LS25 5HP, UK.
// All Rights Reserved.
//
//
// NOTE: You may find source\winapi\ files useful (e.g. drawbmp.prg).
//
/////////////////////////
#include "windows.ch"
#include "inkey.ch"
function start()
local hWnd := WinSetup("test", "test")
local hDC, nEvent, acDIB, cFile
HideCaret(hWnd)
? ; ? " Press ESC..."
do while (nEvent := ChkEvent()) != EVENT_QUIT
if nEvent == EVENT_REDRAW
hDC := GetDC(hWnd)
if acDIB != nil
ShowDIB(hDC, acDIB)
StretchDIBits(hDC, ;
300, 0, 200, 200, ;
, , , , ;
, acDIB)
endif
ReleaseDC(hWnd, hDC)
elseif nEvent == EVENT_KEY .and. inkey(0) == K_ESC
cFile := GetOpenFileName(hWnd, "*.bmp", "Select a bitmap")
if cFile != nil
acDIB := ReadDIB(cFile)
InvalidateRect(hWnd)
endif
endif
enddo
return 0