 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Cactus Guest
|
Posted: Mon Oct 20, 2003 3:30 am Post subject: How do Fastest pixels change on bitmap? |
|
|
Hi
I make a very slow code for change pixels on Bitmap.
how do the progress faster?
Thank
----------------------------------
// RGBQUAD.
typedef union {
struct {
BYTE blue, green, red, zero;
} rgb;
long color;
TColor pixel;
} DEPTH;
DEPTH DepthMask( DEPTH iColor, DEPTH iDiff )
{
iColor.rgb.red += iDiff.rgb.red;
iColor.rgb.blue += iDiff.rgb.blue;
iColor.rgb.green += iDiff.rgb.green;
return iColor;
}
----------------------------------
void ColorChange( TPoint Limit, DEPTH differ )
{
TCanvas *iCanvas = Image->Picture->Bitmap->Canvas;
long iY = Limit.y;
while ( iY-- ) {
long iX = Limit.x;
while ( iX-- ) {
DEPTH iColor;
iColor.pixel = iCanvas->Pixels[iX][iY];
iCanvas->Pixels[iX][iY] = DepthMask(iColor, differ).pixel;
}
}
}
|
|
| Back to top |
|
 |
Michel Leunen Guest
|
Posted: Mon Oct 20, 2003 7:02 am Post subject: Re: How do Fastest pixels change on bitmap? |
|
|
Cactus wrote:
| Quote: | I make a very slow code for change pixels on Bitmap.
how do the progress faster?
iColor.pixel = iCanvas->Pixels[iX][iY];
iCanvas->Pixels[iX][iY] = DepthMask(iColor, differ).pixel;
|
Don't use the Pixels property. Use ScanLine instead or convert your
bitmap to a DIB. Do a search with google, lots of samples were posted here.
Michel
--
----------------------------------------
Michel Leunen
mailto:michel (AT) leunen (DOT) com
http://www.leunen.com/cbuilder/
----------------------------------------
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|