Welcome! Log In Create A New Profile

Advanced

Erase part of an image

Posted by pietvanz 
Erase part of an image
September 29, 2018 12:43PM
Hi,

I'm having the following problem:
I copy a small image variable onto a bigger image using dCopy.
Both images use transparency, no solid background.
Now after the copy action the previous content of the copied area is still visible underneath in the destination image.
So there was a merge instead of an overwrite.
How do I erase the original content of the copied area?
I tried first drawing a transparent rectangle in the destination image, but it also does not erase the destination area.
I could not find any erase function, so I'm stuck here.
I thought of using dCopBlt, but I'm reluctant since it is no longer supported.
Any ideas?

Kind regards,
Piet
Re: Erase part of an image
September 29, 2018 02:45PM
Hi Piet

MyImageField="" before doing your copy should do the trick

Best regards

Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Free Video Courses, free WXShowroom.com, open source WXReplication, open
source WXEDM.

More information on [www.fabriceharari.com]
Re: Erase part of an image
September 29, 2018 03:26PM
Hi Fabrice,

I'm sorry if I was not clear, but I only want to erase part of the image, while keeping transparency.

Kind regards,
Piet
Re: Erase part of an image
September 29, 2018 04:05PM
Hi Piet,

so If I understand correctly, you want the transparency to act as transparency is SOME cases, but not all.

I do not think that is going to work...

The only way I would see that as possible would be to work on a byte level and transform the image as you want it...

So, basically, transform both images into array, then merge the two array the specific way you want by code, then transform the final array into an image and display it

Best regards

Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

Free Video Courses, free WXShowroom.com, open source WXReplication, open
source WXEDM.

More information on [www.fabriceharari.com]
Re: Erase part of an image
September 29, 2018 05:36PM
Hi Fabrice,

That's a possibility, I could build my own dErase function, But I was surprised that there's no function for that. There's such a variety of drawing functions available that I'm suprised it does not include a dErase function of some sort.
Thanks anyway.

Kind regards,
Piet
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: