#572 jigsaw programming


Programming a jigsaw app isn't that hard. Each puzzle can be a jpeg of the picture. The program loads it and makes overlapping bitmaps for the pieces, loads predefined piece shapes to overlay, masked in the middle, Do a masked blit on each one and save it to a new bitmap, then destroy the first bitmap, each in turn, then original jpeg buffer, and you're in business. When a piece gets moved to within a few pixels of its designated x and y, you snap it into place, and the user isn't allow to move it again. It's a small program.


  • Bill Morris

    Bill Morris - 2009-09-15

    That might be one way, but I think I'd rather premake the pieces, mainly to deal with antialiasing of the interlocks, if staying with traditional rounded ones, losing the advantage of ease of adding puzzles. Then again, if an important goal is to allow users to add their own puzzles, then the above description sounds workable but would need methodology for that antialiasing. I'll give it some thought.

    Either way, such an app would need a file menu with thumbnails, which I don't already have made.

  • Bill Morris

    Bill Morris - 2009-09-15

    Okay, I've figured out how to do it all within the program, only requiring picture files and one premade file of the piece pattern, which will produce 154 piece for pictures 704 x 224 pixels, which can be, yes, jpeg files, and still have antialiasing and cool piece shapes, by using part of the pattern image at a time and a series of floodfills and masked blits.

  • Bill Morris

    Bill Morris - 2009-09-16

    The jigsaw thing will be done, I've worked out the details. Some screenshots will be in the News Items forum when I have something to show. I'll see about using some MSD images, as well as screencaps. Any further discussion should be there.

  • Bill Morris

    Bill Morris - 2009-09-16
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks