Page 1 of 1

Help with image

Posted: Tue Aug 20, 2024 10:28 am
by loulou2522
Hi all
I want to load an image but whitout displaying it and after loading writing a vertical line at a specific position with preserving old image and after saving the image with this adding to the old image
Thanks in advance

Re: Help with image

Posted: Tue Aug 20, 2024 1:21 pm
by jacdelad
LoadImage(...)
CopyImage(...)
Start drawing(ImageID(...)
SaveImage(...)
...I don't understand the last part.

Re: Help with image

Posted: Tue Aug 20, 2024 1:46 pm
by BarryG
@loulou2522: Do you mean like this? Thanks to jacdelad as well. ;)

Code: Select all

CreateImage(1,100,100,24,#White) ; White square created, but you can load one.

CopyImage(1,2) ; Copy it.

; Draw a red line down the copy.
StartDrawing(ImageOutput(2))
Line(50,0,1,100,#Red)
StopDrawing()

SaveImage(2,GetTemporaryDirectory()+"image-test.bmp") ; Save copied image with line.

; Do whatever next, because the original image is still just a white square.