Help with image

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Enthusiast
Enthusiast
Posts: 553
Joined: Tue Oct 14, 2014 12:09 pm

Help with image

Post 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
User avatar
jacdelad
Addict
Addict
Posts: 2031
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Help with image

Post by jacdelad »

LoadImage(...)
CopyImage(...)
Start drawing(ImageID(...)
SaveImage(...)
...I don't understand the last part.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: Help with image

Post 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.
Post Reply