Click here to Skip to main content
15,903,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I want to combine multiple images over an overlay image, I have found some tutorials merging images into one but they are displaying it into ImageView(result to low quality of output image), what I want is to merge images without displaying it to the ImageView, only using with the pathfile from storage so that the quality is good.

I already done this in c#, but I don't know how to do it in Android Studio.

What I have tried:

Below is the code that I used in c#. Hoping anyone can help me how to achieve this in Android Studio. Thank you in advance.
Image img = Image.FromFile(locationToOverlay + @"\overlay.png");
    Graphics g = Graphics.FromImage(img);
            g.DrawImage(Image.FromFile(FirstImageFile), 2267, 180, 1985, 1317;
            g.DrawImage(Image.FromFile(SecondImageFile), 1424, 1786, 1368, 907;
            g.DrawImage(Image.FromFile(ThirdImageFile), 2900, 1779, 1368, 902;
            g.DrawImage(Image.FromFile(locationToOverlay + @"\overlay.png"), new Point(0, 0));
            g.Dispose();               
  img.Save("output.jpg", ImageFormat.Jpeg);
  img.Dispose();
Posted
Updated 21-Mar-19 16:16pm
v3
Comments
Richard MacCutchan 21-Mar-19 9:03am    
You can use Xamarin to port your C# code to Android.
Argi Bes 21-Mar-19 9:13am    
Hi Richard, thank you for the response. I already started developed using Android Studio. I don't want to convert whole project.
Richard MacCutchan 21-Mar-19 9:45am    
Then I am afraid you will have to do some research into Java image handling.
[no name] 21-Mar-19 11:43am    
You got the best answer from Richard. "I don't want" will get you nowhere.
David Crow 21-Mar-19 12:02pm    
"Below is the code that I used in c#. Hoping anyone can help me how to achieve this in Android."

The former is a language, while the latter is a platform (i.e., OS). In other words, they are mutually exclusive.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900