Recent

Author Topic: Need to copy sections of a large JPG picture to small TImages of various shapes  (Read 2361 times)

JSN

  • Jr. Member
  • **
  • Posts: 53
I am trying to create a Jigsaw Puzzle game.

I have a large JPG image (the "finished" Jigsaw Puzzle picture) that I want to copy sections of the JPG image into multiple smaller TImages (the Jigsaw Puzzle pieces) of different shapes. Each puzzle piece has a unique "mask" (that determines the shape of the puzzle piece) and is made up of white and transparent areas loaded from PNG files.

The goal is to copy the section of the JPG image to the TImage that will be each puzzle piece, copying only into the white part of the puzzle piece, without copying anything into the transparent areas.

I have no idea how to get started. Is this enough information to ask for help to get started? Is there an existing Jigsaw Puzzle tutorial?

Thanks for any help.

JD

  • Hero Member
  • *****
  • Posts: 1848
Take a look at BGRAControls.

http://wiki.freepascal.org/BGRAControls

The BCGameGrid may be what you are looking for.

JD
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

JSN

  • Jr. Member
  • **
  • Posts: 53
Thank you, JD. Looks like what I need. Appreciate your reply.

 

TinyPortal © 2005-2018