BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do Fastest pixels change on bitmap?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Cactus
Guest





PostPosted: Mon Oct 20, 2003 3:30 am    Post subject: How do Fastest pixels change on bitmap? Reply with quote



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





PostPosted: Mon Oct 20, 2003 7:02 am    Post subject: Re: How do Fastest pixels change on bitmap? Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.