"Aaron Ardiri" <[EMAIL PROTECTED]> ??? news:[EMAIL PROTECTED]
???...
> > > sorry, that should have read:
> > >
> > > > *_x = ( cos(angle) * x) + (sin(angle) * y);
> > > > *_y = (-sin(angle) * x) + (cos(angle) * y);
> > >
> > > new co-ordinates = value based on old co-ordinates
> >
> > the orginial XY system changes to the new X'Y' system, however, if I
draw
> > the texts, they should appear as horizontal no matter as XY or X'Y'
system,
> > so how can I display the texts with slope in the orginial XY system?
>
> simple:
>
> step #1
> - draw text to *normal* buffer, using WinDrawChars()
>
> step #2
> - apply rotation of the *normal* buffer, using rotation matrix
>
> step #3
> - copy (using invert/overlay) the rotated buffer to the display
>

step #2 is the process I don't understand

if using these 2 formulae:
*_x = ( cos(angle) * x) + (sin(angle) * y);
*_y = (-sin(angle) * x) + (cos(angle) * y);
only the coordinates will be changed
e.g., if x=0, y=50, angle=90 degrees, then *_x = 50, *_y =0

then, just for demonstration, below code segment only draw the "rotated"
text abc to a different position but not sloping it, thats what I don't
understand
-------------------------------------------------------------------
 WinHandle  originalWindow, offscreenWindow;
 UInt16  err;
 RectangleType r;

 offscreenWindow = WinCreateOffscreenWindow(160,160,genericFormat, &err);
 originalWindow = WinSetDrawWindow(offscreenWindow);

 WinDrawChars("abc",StrLen("abc"),0,50);   //original x,y position at (0,50)
 WinDrawChars("abc",StrLen("abc"),50,0);   //new *_x , *_y position at
(50,0)

 WinGetBounds(offscreenWindow, &r);
 WinCopyRectangle(offscreenWindow, originalWindow, &r, 0, 0, winOverlay);
 WinSetDrawWindow(originalWindow);
-------------------------------------------------------------------

so how does the rotation achieve?


> thats about all the help i'll give you - you can figure out the
> rest :) also, you might also want to consider doing something
> like the following screen shots (works nice, and, doesn't require much)
>
> http://www.ardiri.com/palm/citikey/map3.gif
> http://www.ardiri.com/palm/citikey/map4.gif

It is very nice, in fact I am working sth very similar to it.


>
> damn.. that code is so old *g* - long were the days of hacking
> grayscale on old 16Mhz devices *g*
>
> ---
> Aaron Ardiri
> [EMAIL PROTECTED]
> http://www.mobilewizardry.com/members/aaron_ardiri.php [profile]
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to