-
May 27th, 2009, 03:09 PM
#1
simple loop problem or pixel one
my code goes as
1.I check if the pixel colour is different from bakground colour in onLbutton down function
by
if(GetPixel(hDC,point.x,point.y)==RGB(0,0,128))
{
busindex=pDoc->InBus (tempx ,tempy );
if(busindex>=0)
{SetCapture();m_dragging=TRUE;}
}
2.my InBus ftn checks as:
InBus
{
CBus1* bus;
bus=GetBus(index);
if( x>= bus->m_x1 && x<=abs(bus->m_x2 -bus->m_x1))
{
if( y>= bus->m_y1 && y<=abs(bus->m_y2 -bus->m_y1))
{
return index;
}
return -1;
}
getbus simply return a pointer 2 dat object in an array
this should return a index of object that has co-ordinates enclosing x,y
the problem is in 2 step it never goes in that if statements......
i cud not get it y??
1 reason i thought was of Mapping of co-ordinates....any ways pllzz think ........
thnx
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|