Re: AntiAlias Line Optimization
- From: "Mike D Sutton" <EDais@xxxxxxxx>
- Date: Wed, 24 Jan 2007 20:33:11 -0000
Just about finished here, but I'm getting an out of bounds error on the array.
BPP = Depth \ 8
ArrayDataPos = (X * BPP) + ((Height - 1) - (Y * ScanLine))
Assuming I'm using the right scanline equation????
(((inWidth * inDepth) + &H1F) And Not &H1F&) \ &H8
If I'm looking for the bytelocation of x,y coordinates 10,20 in a 24-bit 400x400 image:
My equation becomes
arraydatapos = (10 * 3) + ((400-1)-(20*1200 ))
The result is a negative number, which cannot be a valid location in the array.
The scan-line multiplication was in the wrong place, try this version instead:
'***
DataPos = (X * BPP) + (((Height - 1) - Y) * ScanLine)
'***
Also, depending on your (and your users) graphics drivers you may get performance increases by using a 32-bit DIB, which
the hardware is more optimised to deal with.
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/
.
- Follow-Ups:
- Re: AntiAlias Line Optimization
- From: wxforecaster
- Re: AntiAlias Line Optimization
- References:
- AntiAlias Line Optimization
- From: wxforecaster
- Re: AntiAlias Line Optimization
- From: Mike D Sutton
- Re: AntiAlias Line Optimization
- From: wxforecaster
- Re: AntiAlias Line Optimization
- From: Mike D Sutton
- Re: AntiAlias Line Optimization
- From: wxforecaster
- Re: AntiAlias Line Optimization
- From: Mike D Sutton
- Re: AntiAlias Line Optimization
- From: wxforecaster
- Re: AntiAlias Line Optimization
- From: Mike D Sutton
- Re: AntiAlias Line Optimization
- From: wxforecaster
- Re: AntiAlias Line Optimization
- From: Mike D Sutton
- Re: AntiAlias Line Optimization
- From: wxforecaster
- AntiAlias Line Optimization
- Prev by Date: for aloisia: extremely astounding thumbnail indexes - juz zocke - (1/1)
- Next by Date: Re: AntiAlias Line Optimization
- Previous by thread: Re: AntiAlias Line Optimization
- Next by thread: Re: AntiAlias Line Optimization
- Index(es):