Part of what might be making it harder for you to understand it fully is that the sentence isn't complete. You need the part on the other side of the panel to complete the sentence.
Therefore, consider the following:
Now, let's parse (adding some markings to help delineate):
You've correctly identified that ブタに真珠 is the equivalent of "casting pearls before swine" (though for some reason the artist wrote ブタ instead of 豚 -- there might be context behind that somewhere). This is being identified with っていう諺 as "the saying that goes (casting pearls before swine)", loosely speaking. This noun phrase is the section in parentheses.
The noun phrase is being "heard" by the speaker, which is the をきくと, and と here is is an event marker, so, so far we have:
Whenever I hear the saying "Casting pearls before swine"...
...and I think you can figure out the rest now.