Measure the distance from the front and end legs of your bed to around 83 inches off the floor, so you know the height needed for the canopy poles. Measure the length of the side rails of the bed frame for the size of the canopy sides, and the distance of the footer and header of the bed frame for the ends of the canopy.
Cut out the canopy poles to the determined size, using lumber the same dimension as the bed legs. Cut two pieces of lumber (2-by-2 or 2-by-4 is ideal) to the dimensions of the canopy sides, and two to the canopy end measurements.
Drill a pilot hole in the center-top of each of the bed legs, sized slightly smaller then the width of 5-inch hanger bolts, and as deep as the bolt end of the hanger bolt. In one end of the canopy poles, drill a similar pilot hole sized for the screw portion of the hanger bolt. Hanger bolts are double-ended fasteners used to seamlessly connect two pieces of material; they have one end like a bolt, and one end like a screw.
Squirt some wood glue into the pilot holes then screw in the hanger bolt's bolt ends into the pilot holes; let dry. Squirt some glue into the holes in the end of the poles and screw them onto the screw ends of the hanger bolts tightening them firmly, but not hard enough to break the glue hold on the bolt end in the bed legs. Adjust the poles so they are in line with the legs and let dry.
Place the canopy end planks over the tops of the poles at either end of the bed and secure to the canopy poles with four 3-inch wood screws into each pole end.
Attach a corner bracket to each end of the canopy sides, with one arm of the bracket flat on the end of the side planks, and the other arm positioned so that the inside edge of the bracket arm is flush with the top of the plank; wood screws driven through each screw hole in the bracket.
Place the canopy side planks between the canopy end planks, with the top arm of the bracket resting on top of the ends of the canopy end planks. Secure the bracket to the top of the canopy end planks with wood screws through the screw holes in the bracket to finish the conversion of your bed into a canopy frame.