Don't know if you are digesting the previous examples, but I thought this would be entertaining enough, that I've worked up another example. Didn't quite finish all the parts (the feet are the last parts I planned for the example, but I've got some other work to do, so will pack this up as is.
To start working on the example, I wanted to find a suitable image to work with I did a search on Paper Puppets, the cardboard figures with a rivet at the joints where you can rotate the parts, and found
a site which had a good size image with the rivet points identified, so captured it and worked in paint to pull it into pieces, and get the offset numbers for the various points.
The reference point (in this context) of an image is the pixel offset (x,y) in the bitmap that you want to align with a joint, which the image will rotate around. The joint of a part is the pixel offset (x,y) relative to the reference point of that part, where the next part's reference point is to be located.
So, a had which is at the end of a series of connect points will have a reference point (its point to be attached), but no joint point, as there is not a subsequent part to be attached to the hand. (the class does have a joint point, but it isn't set to anything, and the fact that there is not a "next part" object reference in the class is what indicates this is the end of the connected parts.
So, the parts are linked reference point to joint in a hierarchy.
The top level is the body, and the reference point for the body is an (x,y) offset somewhere near the center of the body. The reference point is the point that specifies the objects position, and is what the object rotates around if you want that.
The Joints that are part of the body (left,right shoulder (I misspelled shoulder throughout my code and notes) and left and right hips) are defined relative to the reference point, so the left side coordinates have a negative X offset, and the shoulders, which are above the bodies reference point have a negative value.
So, the method I use to draw the body follow this outline
Code:
Paint
TransLate to Center of body Pin
Call DrawBody
Rotate body
Save Matrix
TransLate to LeftSholder Pin
Call LeftShoulder
Rotate Sholder
Save Matrix
Tranlate to Left Arm Pin
Call LeftArm
Rotate LeftArm
Save Matrix
Translate to Hand Pin
Call LeftHand
Rotate LeftHand
Draw Hand
Return
Restore Matrix
Draw LeftArm
Return
Restore Matrix
Draw Sholder
Return
Restore Matrix
Translate to RightSholder Pin
Call RightSholder
....
Restore Matrix
Translate to LeftHip Pin
Call LeftHip
...
Restore Matrix
Translate to RightHip Pin
Call RightHip
Note that in this example I draw in order from the hand back to the body. This is because that is the way paper puppets are put together, overlapping from center to extremities.
In actual practice, there would probably be a more involved drawing order, with parts of the main body probably drawn at different times in the process, likely with some clipping areas, so that the arms can show in front of the body, and not go behind the body because of the drawing order.
Used a couple of classes to reduce redundant code, one that supports a single chain of parts (hooked reference point to joint, with a reference to the next part in the chain.
The other is the main body part, which has a list of parts that are linked to it. (which I guess technically is using a small class within the class to tie those joints to the first part of a chain (possibly) of parts.
Before I wrote any code, once I selected the picture, I wrote down some notes about the offsets in the picture also what things I figured I wanted in a class to support the task, and an outline of the logic flow when painting (which I copied and pasted above).
I'll include the notes file as well, although there shouldn't be much to glean from that at this point.
p.s. I forgot to mention you can drag with the left mouse on the picturebox to re-position the figure. Dragging left or right with the right mouse will change the size of the drawing.