Using PixelSetColor()
Posted: 2012-01-26T21:09:42-07:00
Hi everyone...
Iam trying to use PixelSetColor() in my program..i have a doubt ..can i give variables instead of numbers is the second argument like rgb(a,b,c) [in which r,g,b values are stored in a b,c] instead of rgb(0,255,0)...Iam attaching my code here...When i use variables its not working...
Can anyone please help me..?
Iam trying to use PixelSetColor() in my program..i have a doubt ..can i give variables instead of numbers is the second argument like rgb(a,b,c) [in which r,g,b values are stored in a b,c] instead of rgb(0,255,0)...Iam attaching my code here...When i use variables its not working...
Code: Select all
a=0;
while(a<v.n_sbimg)
{
modify_iterator=NewPixelRegionIterator(modify_wand,v.col[a],v.row[a],v.sbimg_wdt,v.sbimg_hgt);
for(y=0;y<v.sbimg_hgt;y++)
{
modify_pixels = PixelGetNextIteratorRow(modify_iterator, &v.sbimg_wdt);
for(x=0;x<v.sbimg_wdt;x++)
{
int t=loc(y,x,v.sbimg_wdt)+ a*v.sbimg_pxl;
unsigned char r=new_data[t],g=new_data[t+1],b=new_data[t+2];
PixelSetColor(modify_pixels[x],"rgb(r,g,b)"); // this function sets the color of pixel.
PixelSyncIterator(modify_iterator);
}
}
a++;
}