拼多多买手直接退款 其他订单逻辑优化
This commit is contained in:
1 parent
1669305479
commit
b877695e4b
42 files changed
+1958
-1980
No files matched your search
@@ -12,19 +12,20 @@ namespace Work
|
||||
{
|
||||
public class Base64ChangeImgUrl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 将Base64字符串转换为图片
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
public Bitmap ToImage(string imgBase64)
|
||||
public static Bitmap Base64ToImage(string imgBase64)
|
||||
{
|
||||
imgBase64 = imgBase64.Substring("data:image/jpeg;base64,".Length);
|
||||
if (imgBase64.StartsWith("data:image/jpeg;base64,"))
|
||||
imgBase64 = imgBase64.Substring("data:image/jpeg;base64,".Length);
|
||||
byte[] bytes = Convert.FromBase64String(imgBase64);
|
||||
MemoryStream ms = new MemoryStream(bytes);
|
||||
Image mImage = Image.FromStream(ms);
|
||||
Bitmap bmpt = new Bitmap(ms);
|
||||
ms.Dispose();
|
||||
return bmpt;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -97,7 +98,7 @@ namespace Work
|
||||
{
|
||||
if (!string.IsNullOrEmpty(imgBase64))
|
||||
{
|
||||
return GetPictureData(ToImage(imgBase64));
|
||||
return GetPictureData(Base64ToImage(imgBase64));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user