Positioning And Size Fixes

This commit is contained in:
Alan Moon 2025-07-11 10:18:37 -07:00
parent 003d01fe4e
commit 868f6fa067
2 changed files with 11 additions and 7 deletions

View File

@ -51,12 +51,11 @@
// //
// pbUserPfp // pbUserPfp
// //
pbUserPfp.BorderStyle = BorderStyle.FixedSingle;
pbUserPfp.Image = Properties.Resources.DefaultPfp; pbUserPfp.Image = Properties.Resources.DefaultPfp;
pbUserPfp.Location = new Point(9, 5); pbUserPfp.Location = new Point(13, 11);
pbUserPfp.Name = "pbUserPfp"; pbUserPfp.Name = "pbUserPfp";
pbUserPfp.Size = new Size(138, 139); pbUserPfp.Size = new Size(128, 128);
pbUserPfp.SizeMode = PictureBoxSizeMode.StretchImage; pbUserPfp.SizeMode = PictureBoxSizeMode.Zoom;
pbUserPfp.TabIndex = 2; pbUserPfp.TabIndex = 2;
pbUserPfp.TabStop = false; pbUserPfp.TabStop = false;
// //

View File

@ -46,6 +46,9 @@ namespace qtc_net_client_2.Forms
lblCurrencyAmount.Text = _userInformationDto.CurrencyAmount.ToString("N0"); lblCurrencyAmount.Text = _userInformationDto.CurrencyAmount.ToString("N0");
rtxtBio.Text = _userInformationDto.Bio; rtxtBio.Text = _userInformationDto.Bio;
pbUserPfp.Location = new(13, 11);
pbUserPfp.Size = new(128, 128);
if (pfpRes != null && pfpRes.Success && pfpRes.Data != null) if (pfpRes != null && pfpRes.Success && pfpRes.Data != null)
{ {
using (var ms = new MemoryStream(pfpRes.Data)) using (var ms = new MemoryStream(pfpRes.Data))
@ -242,17 +245,19 @@ namespace qtc_net_client_2.Forms
private void CombineProfileImageWithCosmetic(Image pfp, Bitmap cosmetic) private void CombineProfileImageWithCosmetic(Image pfp, Bitmap cosmetic)
{ {
cosmetic.MakeTransparent(); cosmetic.MakeTransparent();
Bitmap combined = new Bitmap(pbUserPfp.Width, pbUserPfp.Height); Bitmap combined = new Bitmap(139, 138);
using (Graphics g = Graphics.FromImage(combined)) using (Graphics g = Graphics.FromImage(combined))
{ {
g.Clear(Color.Transparent); g.Clear(Color.Transparent);
g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver;
g.DrawImage(pfp, 0, 0, pbUserPfp.Width, pbUserPfp.Height); g.DrawImage(pfp, 4, 6, 128, 128);
g.DrawImage(cosmetic, 0, 0, pbUserPfp.Width, pbUserPfp.Height); g.DrawImage(cosmetic, 0, 0, 139, 138);
} }
pbUserPfp.Location = new(9, 5);
pbUserPfp.Size = new(139, 138);
pbUserPfp.Image = combined; pbUserPfp.Image = combined;
} }
} }