using qtc_net_client_2.Properties;
using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace qtc_net_client_2.Services
{
    public class ImageFactory
    {
        public Bitmap CreateProfileImage(Bitmap? precenseImage = null, Bitmap? pfp = null, Bitmap? cosmetic = null)
        {
            Bitmap combined = new Bitmap(139, 138);

            using Graphics g = Graphics.FromImage(combined);
            g.Clear(Color.Transparent);
            g.CompositingMode = CompositingMode.SourceOver;

            pfp ??= Resources.DefaultPfp;

            g.DrawImage(pfp, 4, 6, 128, 128);

            if (cosmetic != null)
            {
                cosmetic.MakeTransparent();
                g.DrawImage(cosmetic, 0, 0, 139, 138);
            }

            if(precenseImage != null)
            {
                precenseImage.MakeTransparent();
                g.DrawImage(precenseImage, 104, 0, 35, 35);
            }

            return combined;
        }
    }
}
