Bleek II Posted February 21, 2008 Share Posted February 21, 2008 Hi, I need help with a number of issues. First I'd like to say that I have looked a large amount of sample code and have not been able to find the answers. I have a loop like this ColorBgra CP; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { CP.R = ????????????????????; dst[x, y] = src.GetBilinearSample( x+CP.R, y+CP.R, true ); In place of the ??????????? I want to assign the Red value of the current pixel that I'm working on. Even better yet the it's brightness; I just used red because I'm working with BW images. I'm have only used c++ in the past so this a little harder to learn for me. Quote Link to comment Share on other sites More sharing options...
BoltBait Posted February 21, 2008 Share Posted February 21, 2008 CP.R = src[x,y].R; Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
MadJik Posted February 21, 2008 Share Posted February 21, 2008 yes but you need to give CP a value first, I think! void Render(Surface dst, Surface src, Rectangle rect) { ColorBgra CP; for(int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { // give a value to the pixel (not only the red chanel) CP = src[x,y]; // then you could use any chanel of CP as you need! dst[x, y] = src.GetBilinearSample(x+CP.R, y+CP.R, true ); } } } Quote My DeviantArt | My Pictorium | My Plugins | Donate via Paypal Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.