[comp.sys.mac.programmer] "Pinstripes" appear during CopyBits

ra_robert@gsbacd.uchicago.edu (03/17/89)

I'm writing a paint program in which my window's contents are updated by
copying the contents from an offscreen bitmap into my window's bitmap. 

The portion of my window in which drawing is done is not the whole portRect.
For this reason, when I scroll the drawing area's contents I don't follow
scrollRect with SetOrigin.  Rather, I keep track of how far my draw area has
been scrolled and use this as an offset into my offscreen bitmap to find out
where I should copy the bits from, like this: 

CopyBits(thePaintBMap, theUpdateWindow^.portBits, offsetCopyRect, copyRect,
srcCopy, nil); 

where offsetCopyRect is copyRect offset by the horiz and vertical scrolled
amounts, and thePaintBMap is my offscreen bitmap. 

OK, my problem is this:  when I have scrolled horizontally and then grow the
window -- causing the window's contents to be updated -- I get vertical white
lines from the top of my window to the bottom; the lines appear, as do the
other objects, when CopyBits is called in my update routine.  These lines --
which look like pinstripes when seen against gray objects -- are one pixel
wide, regular and equidistant, and they get closer together the larger I grow
my window. Otherwise the window's contents are updated fine. 

I am really stumped.  This problem doesn't happen when I've scrolled
vertically,or when there has been no scrolling at all (in fact, when I scroll
back to the unscrolled position, the problem disappears). 

Any info -- posted or e-mailed -- MUCH appreciated. 
 
Robert
------
ra_robert@gsbacd.uchicago.edu
------
generic disclaimer: all my opinions are mine

ra_robert@gsbacd.uchicago.edu (03/17/89)

One note: the problem detailed in my last posting occurs only when the window
has been grown horizontally, not vertically.

Robert
------
ra_robert@gsbacd.uchicago.edu
------
generic disclaimer: all my opinions are mine

ra_robert@gsbacd.uchicago.edu (03/17/89)

I got some replies that helped me solve my problem.  It was _really_ simple:
different size rects in source and destination.  Sometimes one doesn't see
the forest for the trees. :->

Mucho thanks to those who steered me on my way.


Robert
------
ra_robert@gsbacd.uchicago.edu
------
generic disclaimer: all my opinions are mine