Thonord
Member
- Joined
- Oct 25, 2012
- Messages
- 23
- Programming Experience
- 10+
I'm trying to "slant" a bitmap.
Not rotate as in RotateTransform.
Let me explain using an italics font as an example. The font is slanted at an angle, but horisontal elements remain horisontal, no matter how much the vertical elements are angled. (Look at the letter "t" in italics. The crossbar remains horisontal).
Thank to you guys, my bitmap is in a single dimension array, using LockBits and MarshalCopy. (WOW, speed is impressive)
I have found several ways that works
One is converting the contents of each stride into a string, Mid'ing the chars(bytes) into place and "Byte'ing it back to the array. Simple but slow. (Slow as in 1500 ms +)
Another is processing each byte within a stride in a "bubblesort" kind of way. Not sorting them, but shifting the "bytes of interest" the required number of Bytes down the stride. Simple, but even slower? (My code here may be extremely ineficient)
Both are also so .NET Not!
What I'm looking for, in the spirit of transforming into a .Net programmer (and wanting more speed) is something like SkewTransform(angle as integer).
Merry x-mas and a happy new year to all.
Espescially to the gentle wizzards, who share their wisdom so willingly.
Not rotate as in RotateTransform.
Let me explain using an italics font as an example. The font is slanted at an angle, but horisontal elements remain horisontal, no matter how much the vertical elements are angled. (Look at the letter "t" in italics. The crossbar remains horisontal).
Thank to you guys, my bitmap is in a single dimension array, using LockBits and MarshalCopy. (WOW, speed is impressive)
I have found several ways that works
One is converting the contents of each stride into a string, Mid'ing the chars(bytes) into place and "Byte'ing it back to the array. Simple but slow. (Slow as in 1500 ms +)
Another is processing each byte within a stride in a "bubblesort" kind of way. Not sorting them, but shifting the "bytes of interest" the required number of Bytes down the stride. Simple, but even slower? (My code here may be extremely ineficient)
Both are also so .NET Not!
What I'm looking for, in the spirit of transforming into a .Net programmer (and wanting more speed) is something like SkewTransform(angle as integer).
Merry x-mas and a happy new year to all.
Espescially to the gentle wizzards, who share their wisdom so willingly.