From ffa44ff03616133104a10585e7af655b4fef5618 Mon Sep 17 00:00:00 2001 From: AlanMoonbase Date: Fri, 11 Jul 2025 12:28:22 -0700 Subject: [PATCH] More Profile Image Sizing Fixes --- qtc-net-client-2/Forms/Profile.Designer.cs | 2 +- qtc-net-client-2/Forms/Profile.cs | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/qtc-net-client-2/Forms/Profile.Designer.cs b/qtc-net-client-2/Forms/Profile.Designer.cs index 2440757..36df03e 100644 --- a/qtc-net-client-2/Forms/Profile.Designer.cs +++ b/qtc-net-client-2/Forms/Profile.Designer.cs @@ -55,7 +55,7 @@ pbUserPfp.Location = new Point(13, 11); pbUserPfp.Name = "pbUserPfp"; pbUserPfp.Size = new Size(128, 128); - pbUserPfp.SizeMode = PictureBoxSizeMode.Zoom; + pbUserPfp.SizeMode = PictureBoxSizeMode.StretchImage; pbUserPfp.TabIndex = 2; pbUserPfp.TabStop = false; // diff --git a/qtc-net-client-2/Forms/Profile.cs b/qtc-net-client-2/Forms/Profile.cs index 7d9c3bc..1080ea6 100644 --- a/qtc-net-client-2/Forms/Profile.cs +++ b/qtc-net-client-2/Forms/Profile.cs @@ -18,6 +18,7 @@ using QtCNETAPI.Schema; using System.Diagnostics; using System.Drawing.Imaging; using System.Drawing.Design; +using System.Drawing.Drawing2D; namespace qtc_net_client_2.Forms { @@ -53,11 +54,7 @@ namespace qtc_net_client_2.Forms { using (var ms = new MemoryStream(pfpRes.Data)) { - Bitmap bmp = new Bitmap(ms); - if (bmp.Width != 128 && bmp.Height != 128) - bmp.SetResolution(128, 128); - - pbUserPfp.Image = bmp; + pbUserPfp.Image = new Bitmap(ms); } } @@ -78,7 +75,7 @@ namespace qtc_net_client_2.Forms break; } - if(_userInformationDto.ProfileCosmeticId != 0) + if (_userInformationDto.ProfileCosmeticId != 0) { var res = await _apiService.GetStoreItem(_userInformationDto.ProfileCosmeticId); if (res != null && res.Success && res.Data != null) @@ -87,7 +84,7 @@ namespace qtc_net_client_2.Forms var response = await client.GetAsync(res.Data.AssetUrl); if (response.IsSuccessStatusCode) { - using(var stream = await response.Content.ReadAsStreamAsync()) + using (var stream = await response.Content.ReadAsStreamAsync()) { CombineProfileImageWithCosmetic(pbUserPfp.Image, new Bitmap(stream)); }