Adding transparent .png over .jpg and saving the resulting image...

Hello everybody,
I’m new to RB/Xojo and I’m trying to make a very simple piece of software.
I just need to pick up .jpg from internet (done), resize it (done), load transparent .png from hard disk (done), place .png over .jpg (they are the same resolution) and save the resulting picture in .png format.
I use Graphics.DrawPicture to draw one image over the other and resulting image looks great, but it still isn’t one image but two and I don’t know how to save what I get (since it’s not one image).
Basically, I’m pulling picture from my website, adding my logo (in color) and saving the result locally.
I’ve tried with picture.Mask, but it’s no good because my logo is in color.
Any ideas?

[quote=116857:@Vladimir Stevic]Hello everybody,
I’m new to RB/Xojo and I’m trying to make a very simple piece of software.
I just need to pick up .jpg from internet (done), resize it (done), load transparent .png from hard disk (done), place .png over .jpg (they are the same resolution) and save the resulting picture in .png format.
I use Graphics.DrawPicture to draw one image over the other and resulting image looks great, but it still isn’t one image but two and I don’t know how to save what I get (since it’s not one image).
Basically, I’m pulling picture from my website, adding my logo (in color) and saving the result locally.
I’ve tried with picture.Mask, but it’s no good because my logo is in color.
Any ideas?[/quote]

Why not create a new picture into which you draw successively the two images ?

If then PNG is transparent (ie already includes a MASK layer) than


FUNCTION myPicture(oldpic as picture, logo as picture) as picture
   dim p as picture
   p=new picture(oldpic.width,oldpic.height,32)
   p.graphics.drawpicture oldpic,0,0
   p.graphics.drawpicture logo,0,0
END FUNCTION

A mask doesn’t care if the main picture is color… all it does is set the level of transparency

Thank you Michel and thank you Dave!
It worked!