creating an image behind another one

how can i create an image behind another or on it so the picture would be square?

have your read the LR section about canvas and drawpicture?

simply “draw” the smaller picture on top of the larger picture…

i don’t need a smaller picture on the bigger one, i need it the other way around,
the bigger picture should be drawn behind the smaller one so i can get an promotional scale fact of a square

Those are 2 ways of saying the same thing. Draw the large picture, then draw the smaller one.

Put the larger in Canvas’s Backdrop and draw the smaller in Paint (Event) ?

Or create an offscreen Picture using the larger’s size, paint the larger, then the smaller where you want in the larger.


Think of it like this:

Paint a wall.
Hang a painting on the wall.

Dont hang the painting then try to paint the wall

Create your large square image.
Draw the smaller image on top, in the middle.
If the smaller image is an irregular shape, you need to use a PNG which has transparent areas,
or a mask
or set the transparent property of the smaller image to be ‘white’, if the outlying area is pure white pixels.

the smaller pictures are Photos taken by an iPhone camera for example, and this picture needs to be square so it’s easier to save for us

so we want to make the iPhone picture to be square and in a smaller size like: (1000x1000 pixels) to safe storage usage

@Emile Schwarz HTH?

HTH = Hope That Helps

So do you need to crop and resize the images? Create a fresh Picture object of the desired size (1000 x 1000) and use DrawPicture to draw the iphone image into it. DrawPicture can both crop and resize based on the parameters you pass it.

not croping!!

the image should be in the same format as it has been taken, just the size of the final square picture should be resized to 1000x1000

i know how i can do it by hand but i need to make it automatically so the production apartment can use it to import their 2000 pictures in one day

Are-you asking for code ?

Show us the code you already have. I think it would also be good to show the interface you have in mind if what Jeff describes isn’t what you want.

  1. Put all your iPhone involved images in a folder

In a project, in a window (larger than 1,000 x 1,000 pixels), put a Canvas and set its size to 1000 x 1000.

Set that Canvas Drag and Drop ready (or just add an Open MenuHandler in the File menu),

Do that in a loop:

Start of processing Draw the Canvas background color to Black (or the color you pleased), Load the image file i (if i is your loop index) And draw it centered in the Canvas backdrop (horizontally OR vertically centered - depends on the photo) Save that brand new image to a second folder (to avoid collision, to get newly created files together). You can use the original photo name (and add to id a prefix or a suffix to be sure this is now a sqared file) end of this photo processing, go back to the top.

Is it OK ?

i will try that

thank you for your help