Thanks both for the advice. Will try it out!
Sara
> Subject: Re: Scrolling Bitmaps
> From: "Steve Sabram" <[EMAIL PROTECTED]>
> Date: Wed, 27 Jun 2001 15:46:48 -0700
> X-Message-Number: 104
>
>
> This is good advice, however if you want to avoid flashing, I higly
suggest
> you double buffer you drawing. There are plenty of archives on how to do
> this.
>
> Steve
>
> >From: The Armadillo With The Mask <[EMAIL PROTECTED]>
> >Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> >To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> >Subject: Re: Scrolling Bitmaps
> >Date: Wed, 27 Jun 2001 12:37:34 -0700
> >
> >Sara Revell wrote:
> >
> >>Hi,
> >>
> >>I need a bit of information about scrolling bitmaps. I know it is
> >>possible
> >>to do this, but my question is, can I also control the placement of the
> >>bitmap internally, and not just from the pen? What I mean is, if the
> >>program is given a co-ordinate for part of the bitmap, it is possible to
> >>center the image on that co-ordinate?
> >
> >Sure. It's actually pretty easy. The Palm screen is a 160x160 display.
> >0,0 is in the upper left-hand corner, 160,160 is in the lower right.
> >This would make the center 80,80. To center the image on an interest
> >point you'd do something like:
> >
> >RectangleType interestPt;
> >int winCenterX=80;
> >int winCenterY=80;
> >int offsetX,offsetY;
> >BitmapType *bmap;
> >MemHandle bmapH;
> >
> > interestPt=myGetInterestPoint();
> > offsetX = winCenterX - interestPt.topleft.x;
> > offsetY = winCenterY - interestPt.topleft.y;
> >
> > bitmapH = DmGetResource(bitmapRsc,myBitMapID);
> > if(bitmapH !=NULL) {
> > bmap = (BitmapPtr) MemHandleLock(bmapH);
> > WinDrawBitmap(myBitmapID, offsetX,offsetY);
> > MemHandleUnlock(bmapH);
> > DmReleaseResource(bmapH);
> > }
> >
> >This will shift your bitmap over the distance between the center and
> >your interest point. This should also work for images larger than the
> >screen itself, but it assumes that you've done any viewport setup you
> >need to beforehand. In any case, this should be enough to give you the
> >general idea.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/