Xref: utzoo comp.os.os2.misc:483 comp.os.os2.programmer:363 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bywater!scifi!watson!arnor!larios!db3l From: db3l@ibm.com (David Bolen) Newsgroups: comp.os.os2.misc,comp.os.os2.programmer Subject: Re: Programming Graphics in PM? Message-ID: Date: 18 Dec 90 17:12:06 GMT References: <1990Dec16.233203.20196@eecs.wsu.edu> Sender: news@arnor.uucp (NNTP News Poster) Organization: Laboratory Automation, IBM Thomas J. Watson Research Center Lines: 45 In-Reply-To: wbonner@eecs.wsu.edu's message of 16 Dec 90 23:32:03 GMT In article <1990Dec16.233203.20196@eecs.wsu.edu> wbonner@eecs.wsu.edu (Wim Bonner) writes: > One of the parameters that is being passed to it is an >HWND type, as I thought this should allow me to call WinBeginPaint on >that space and draw in it, but I can't seem to get anything to show up >on the window. I have a beep in the routine, so I know that it is >getting to the routine. Well, it depends on whether you have any invalid region in your window. WinBeginPaint will give you back a cached micro presentation space, but it will also set the clipping region of the PS to the portion of the window that is invalid. It's designed to be used during a WM_PAINT message, so that PM only has to do the graphics operations requested in the portion of the window that has been exposed/changed/etc.. If you just call WinBeginPaint at a random point in your application, you'll get the PS, but the odds are no portion of your window will be "invalid", so the clipping region will be empty and nothing you do will actually show up in the window. If you want to do graphics in a window at an arbitrary time, use WinGetPS, which gives you the same sort of PS as WinBeginPaint, but only sets the clipping region around child windows (depending on the window style of the current window), giving you full access to your window's client area. Of course, you may need to refresh this at any time, so to be proper, anything you draw you should also be able to redraw as the response to a WM_PAINT message. Oh, and if you want to, you can go lower and use the GpiCreatePS call to create your own PS, but unless you need to create a normal (rather than micro) PS (if perhaps, you need retained segments), it's not really worth the effort for output to a window. -- -- David -- /-----------------------------------------------------------------------\ \ David Bolen / | Laboratory Automation, IBM Thomas J. Watson Research Center | / P.O. Box 218, Yorktown Heights, NY 10598 \ | - - - - - - - - - - - - M i t h r a n d i r - - - - - - - - - - - - | | Internet : db3l@ibm.com | Bitnet : db3l@yktvmv | | Usenet : uunet!bywater!arnor!larios!db3l | Phone : (914) 945-1940 | \-----------------------------------------------------------------------/