It has often been said that the canopy can make or break an aircraft model, an adage that is, I believe, quite true. I have spent as long as an entire evening masking a 1/72nd scale canopy with small slivers of masking tape in order to get the result I want. I'm still waiting for a perfect way of completing canopies, although the die-cut masks recently available for 1/48th scale models seem very good...if only they were available for 1/72nd scale! For most models I attach the fixed part of the canopy to the model before painting and fill any gaps with white glue (several applications may be necessary), wiping away excess with a moistened brush. For small WWII canopies it is generally better to mask before gluing, with larger more easily masked canopies this can be done on the model, depending on personal preference. I use Tamiya masking tape for the edges, and fill in the centre areas with Humbrol Maskol - this works extremely well as long as you NEVER use a cellulose thinner as a vehicle for spraying, as this penetrates
Maskol, forming a nasty goo that must be scraped from the plastic (the voice of bitter experience speaks!!!). Cellulose thinners are those containing Xylene or Toluene, usually they have both. The opening part of the canopy (and I'm talking about on the real thing, not the model - I cement all model items down) I mask and spray separately, as any small gap around the canopy will make it look more like it moves, even when it doesn't. Even if the item is a perfect fit, it won't look the same as a cemented and sprayed item, which should appear as a continuous edge.
Recently I've tried using clear decal film to create very sharp demarcations on canopies, and my first, tentative steps in this direction have given positive results, I just have to iron out a few difficulties. The major one is that to get a really good set on the canopy, I use Johnson's Klear (which is magic stuff!), which dries which a semi-gloss to gloss sheen. As the main finish is usually different to this, I need to matt the decal film after application without doing the same to the canopy. I don't want to mask with tape as I think this could well pull the film off, but Maskol or painting is then not going to give me a razor-edge line, so what to do??? I'll keep you posted!
Advantages of both these techniques over hand painting canopies (an agonising process that I used to do, with very variable results), is that it is very easy to spray an initial coat corresponding to the internal canopy frame colour before spraying the main camouflage. This gives the model that extra little bit of finesse, usually not noticed by itself but improving the overall "look" of the model.