上货后参加20981活动
This commit is contained in:
1 parent
b868c718f0
commit
4fcfb2875a
25 files changed
+1379
-119
No files matched your search
@@ -19,13 +19,15 @@ namespace Work.BLL.Tools
|
||||
/// </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;
|
||||
}
|
||||
|
||||
@@ -52,7 +54,7 @@ namespace Work.BLL.Tools
|
||||
}
|
||||
}
|
||||
|
||||
public string CutZoom(string Base64pic)
|
||||
public static string CutZoom(string Base64pic)
|
||||
{
|
||||
|
||||
byte[] arr2 = Convert.FromBase64String(Base64pic);
|
||||
@@ -72,7 +74,7 @@ namespace Work.BLL.Tools
|
||||
/// </summary>
|
||||
/// <param name="Bitmap"></param>
|
||||
/// <returns></returns>
|
||||
public byte[] GetPictureData(Bitmap Bitmap)
|
||||
public static byte[] GetPictureData(Bitmap Bitmap)
|
||||
{
|
||||
MemoryStream ms = null;
|
||||
try
|
||||
@@ -93,13 +95,13 @@ namespace Work.BLL.Tools
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] Base64ChangeBuffer(String imgBase64)
|
||||
public static byte[] Base64ChangeBuffer(String imgBase64)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(imgBase64))
|
||||
{
|
||||
return GetPictureData(ToImage(imgBase64));
|
||||
return GetPictureData(Base64ToImage(imgBase64));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user