More Profile Image Sizing Fixes
This commit is contained in:
parent
217e3f301a
commit
ffa44ff036
2
qtc-net-client-2/Forms/Profile.Designer.cs
generated
2
qtc-net-client-2/Forms/Profile.Designer.cs
generated
@ -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;
|
||||
//
|
||||
|
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user