653 {
654 get
655 {
656 if (updatePixbuf)
657 {
658 if (pixbuf != null)
659 pixbuf.Dispose();
660 byte[] pixelData = new byte[width * height * 4];
661 for (int y = 0; y < height; y++)
662 {
663 for (int x = 0; x < width; x++)
664 {
665 int ind = y * width + x;
666 if (mask[ind] > 0)
667 {
668 pixelData[4 * ind] = (byte)(mask[ind] / 255);
669 pixelData[4 * ind + 1] = (byte)(mask[ind] / 255);
670 pixelData[4 * ind + 2] = (byte)(mask[ind] / 255);
671 pixelData[4 * ind + 3] = 125;
672 }
673 else
674 pixelData[4 * ind + 3] = 0;
675 }
676 }
677 pixbuf = new Gdk.Pixbuf(pixelData, true, 8, width, height, width * 4);
678 updatePixbuf = false;
679 return pixbuf;
680 }
681 else
682 return pixbuf;
683 }
684 }