How can apply graphics using LineTo?

here I added some source code, but it is not loading the imge

       graphics.beginBitmapFill(image);
  graphics.moveTo(100, 100);
  graphics.lineTo(120, 50);
  graphics.lineTo(200, 50);
  graphics.lineTo(220, 100);
  graphics.lineTo(100, 100);    
 
        graphics.endFill();

Please fix the problem for me (please avoid using rect, I need only lineTo)