This question totally sucks, and is pretty much hopeless to ask, but maybe somebody has a suggestion as to what else to look at. The code is spread through multiple dlls and is utterly massive, so I'm not about to post the whole amount, and I'm not sure what subset of it would be useful.

The situation is that I am drawing images on pictureboxes. All the pictureboxes are rectangles where the long axis is twice as long as the short axis. The pictureboxes are oriented either North, South, East, or West (some in each direction). Of course, North and South would look the same, as would East and West, except that the image drawn onto the picturebox is such that you can tell North from South and East from West.

A bitmap is used as the image. It is scaled to the size of the picturebox, then some other graphics are drawn onto the bitmap. This drawing is done as a series of steps. Initially, all bitmaps are oriented N-S, such that they are longer than they are wide. A border is drawn onto the picturebox, then a different segment is added at the bottom (which is how you can tell a N from an S). As a last step, the image is rotated so that it matches the orientation of the picturebox. These steps result in an image in the picturebox, with a border, and a segment drawn at the bottom, such that you can see which images are oriented N, S, E, or W. All of this is working fine.

The next step is to draw lines across the pictureboxes at certain points. It is pretty complicated as to where the lines are drawn, but you can picture it as being one line drawn across the short axis of the picturebox. Through drag and drop, these lines can be moved anywhere on the picturebox I want. This, too, is working. I can drag the lines anywhere I want along the picturebox, and I can see that the actions are occuring correctly.

The problem is that, for the E and W raceways, the lines are visible only if they are in the left side of the picturebox. If I drag them to the right side of the picturebox, they are no longer visible. On the N-S pictureboxes, the lines are visible no matter where I put them. Furthermore, I can step through the code and see that the lines are being drawn. They are actually drawn as rectangles, using the FillRectangle method of the graphics object. I can confirm that all of the parameters used by the FillRectangle method are correct, regardless of where I put the lines. The problem is that they only show up if they are drawn on the left half of the image.

That's the whole description, and I would agree that it is pretty much hopeless. I have spent a few hours confirming everything that I could confirm. There are few reasons why graphics might not show up, and I have ruled out most of them. Nothing is being drawn over the graphic, the borders show that the rotation is working correctly, and the lines are being drawn in the right place and at the right size.

The two alternatives appear to be either that the graphics object is not drawing the line, or that the line is being drawn in the wrong place. Neither one makes sense. How could the logic work for the N-S but not the E-W? It's the same logic other than the parameters passed to the FillRectangle, and I can confirm that those parameters are correct in all cases. Furthermore, how could it draw correctly in the left half of the picturebox but not in the right, regardless of whether it is E or W? If it was drawing wrong, it would draw wrong for both. How would it even know which half it was drawing in? Why would it care?

So, I suppose what I am looking for is whether or not there is something odd about the way graphics work that could cause strange behavior in half of an image?