[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Questions using FT_RENDER_MODE_MONO
From: |
Wenlin Institute |
Subject: |
Re: [ft] Questions using FT_RENDER_MODE_MONO |
Date: |
Tue, 15 Apr 2008 19:17:38 -0700 |
On Apr 15, 2008, at 1:08 PM, Graham Hemingway wrote:
...
byte = ((byte >> bitOffset) & 1) * 255;
I believe that's backwards; the pixels are arranged from left to
right starting with the highest order bit. Something like this should
work better:
byte = (byte & (0x80 >> bitOffset)) ? 255 : 0;
I haven't tried running your code but I think this will at least get
it closer to working. (You could also optimize the speed by storing
the mask and offsets in variables rather than repeating the
multiplications, etc., for each pixel.)
Best wishes,
Tom
文林 Wenlin Institute, Inc. Software for Learning Chinese
E-mail: address@hidden Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)
☯