🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2621

Re: How do I rotate text or a bitmap?

#2621
From: Chris Marriott
Date: Fri, 08 Jan 1993 19:30
45 lines
2478 bytes
In article <1993Jan7.211926.11912@physics.ucla.edu> mmccarri@physics.ucla.edu writes:

>I could rotate a bitmap pixel by pixel, but it seems like a
>lot of work given the various color formats.  Is there an
>easier (and faster) way?
>

Write your application under Win32s and use the "World Transforms" that
Win32 gives you.  Rotation is then just as easy as translation and
scaling now are.

>Speaking of bitmaps, I am drawing a large, multi-color bitmap
>(a frequeny-time spectrogram) using the Rectangle() function
>to fill in each df dt block.  This also seems like too much 
>work since I have to create a pen and a brush with the desired
>color, select these objects, draw the rectangle, and then delete
>both objects.  This is repeated 100,000 times or so and is very
>slow.  I experimented with the SetPixel() function instead, but
>it is even slower!  Also, SetPixel() will not dither the color
>if I am running on a paletteless display.  Any suggestions?
>

1.  Use PatBlt rather than Rectangle - it's a lot faster.
2.  Create all the brushes you need at the start, do the drawing,
    then delete all the brushes at the end.
3.  SetPixel will *never* create a dithered colour, whether or not
    the display is palette-based.

>Thanks,
>-Mike-
>-- 
>Dr. Michael McCarrick                   UCLA Department of Physics
>Plasma Physics Lab                              405 Hilgard Avenue
>mmccarri@physics.ucla.edu                    Los Angeles, CA 90024
>

Chris
-- 
--------------------------------------------------------------------------
| Chris Marriott                           | chris@chrism.demon.co.uk    |
| Warrington, UK                           | BIX: cmarriott              |
| (Still awaiting inspiration              | CIX: cmarriott              |
|  for a witty .sig .... )                 | CompuServe: 100113,1140     |
--------------------------------------------------------------------------
 
Technical Details
Message-ID: <726521430snz@chrism.demon.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
References: <1993Jan7.211926.11912@physics.ucla.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
Subject: Re: How do I rotate text or a bitmap? 
Distribution: world
References: <1993Jan7.211926.11912@physics.ucla.edu>
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Lines: 45
Date: Fri, 8 Jan 1993 19:30:30 +0000
Message-ID: <726521430snz@chrism.demon.co.uk>
Sender: usenet@demon.co.uk