更新内容: 1.图片上传后自动置中显示
parent
df22f90ed2
commit
03df10c663
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -182,6 +182,7 @@ namespace HK.Tool
|
||||||
waitingPage.SetActive(true);
|
waitingPage.SetActive(true);
|
||||||
qrcodePage.SetActive(false);
|
qrcodePage.SetActive(false);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
currentSprites.Clear();
|
||||||
|
|
||||||
Debug.Log(urls.Count);
|
Debug.Log(urls.Count);
|
||||||
foreach (string url in urls)
|
foreach (string url in urls)
|
||||||
|
|
|
@ -75,17 +75,19 @@ namespace HK.FUJIFILM
|
||||||
|
|
||||||
var image = loadGameObject.GetComponent<Image>();
|
var image = loadGameObject.GetComponent<Image>();
|
||||||
image.sprite = args.sprite;
|
image.sprite = args.sprite;
|
||||||
var itemPosition = Vector2.zero;
|
|
||||||
image.rectTransform.anchoredPosition = itemPosition;
|
|
||||||
|
|
||||||
ImageScaler.ScaleImageWithMaxSize_Scale(image, designItem.SizeDeltaMax);
|
ImageScaler.ScaleImageWithMaxSize_Scale(image, designItem.SizeDeltaMax);
|
||||||
// ImageScaler.ScaleImageWithSize(image, designItem.SizeDeltaMax);
|
// ImageScaler.ScaleImageWithSize(image, designItem.SizeDeltaMax);
|
||||||
|
var itemPosition = Vector2.zero;
|
||||||
|
image.rectTransform.anchoredPosition = itemPosition;
|
||||||
|
|
||||||
loadGameObject.SetActive(true);
|
loadGameObject.SetActive(true);
|
||||||
var rectTransformSizeDelta = designItem.RectTransform.sizeDelta / 2;
|
|
||||||
loadGameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(
|
// 随机位置
|
||||||
Random.Range(-rectTransformSizeDelta.x, rectTransformSizeDelta.x),
|
// var rectTransformSizeDelta = designItem.RectTransform.sizeDelta / 2;
|
||||||
Random.Range(-rectTransformSizeDelta.y, rectTransformSizeDelta.y));
|
// loadGameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(
|
||||||
|
// Random.Range(-rectTransformSizeDelta.x, rectTransformSizeDelta.x),
|
||||||
|
// Random.Range(-rectTransformSizeDelta.y, rectTransformSizeDelta.y));
|
||||||
|
|
||||||
EventManager.Instance.FireNow(this,
|
EventManager.Instance.FireNow(this,
|
||||||
new MugActualModel_Fixed_GenPhotoEventArgs(loadGameObject, designItem.ID));
|
new MugActualModel_Fixed_GenPhotoEventArgs(loadGameObject, designItem.ID));
|
||||||
|
|
|
@ -296,6 +296,7 @@ namespace HK.FUJIFILM
|
||||||
{
|
{
|
||||||
foreach (var templateSprite in list)
|
foreach (var templateSprite in list)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"gen photo {templateSprite.name}");
|
||||||
var loadGameObject = ResourcesManager.Instance.LoadGameObject(
|
var loadGameObject = ResourcesManager.Instance.LoadGameObject(
|
||||||
AssetConst.Assets_Res_FUJIFILM_Prefabs_UI_Item_goDesignPhotoItem_prefab, scrPhoto.content);
|
AssetConst.Assets_Res_FUJIFILM_Prefabs_UI_Item_goDesignPhotoItem_prefab, scrPhoto.content);
|
||||||
loadGameObject.SetActive(true);
|
loadGameObject.SetActive(true);
|
||||||
|
|
|
@ -57,5 +57,28 @@ namespace HK.FUJIFILM
|
||||||
|
|
||||||
Debug.Log($"✅ 压缩成功,输出文件: {outputPath}");
|
Debug.Log($"✅ 压缩成功,输出文件: {outputPath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CompressPngAndSetDpi(byte[] bytes, string outputPath)
|
||||||
|
{
|
||||||
|
using (var image = new MagickImage(bytes))
|
||||||
|
{
|
||||||
|
// 设置 300 DPI
|
||||||
|
image.Density = new Density(300, 300, DensityUnit.PixelsPerInch);
|
||||||
|
|
||||||
|
// 设置压缩参数(对于 PNG 有效)
|
||||||
|
image.Format = MagickFormat.Png;
|
||||||
|
image.Quality = 100; // 保证无损
|
||||||
|
image.Depth = 8; // PNG 8bit(通常足够)
|
||||||
|
|
||||||
|
// 选择压缩过滤器
|
||||||
|
image.Settings.SetDefine(MagickFormat.Png, "compression-filter", "5");
|
||||||
|
image.Settings.Compression = CompressionMethod.Zip; // PNG 默认
|
||||||
|
|
||||||
|
// 写入输出文件
|
||||||
|
image.Write(outputPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Log($"✅ 压缩成功,输出文件: {outputPath}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"FileVersion": "1.0.0",
|
"FileVersion": "1.0.0",
|
||||||
"PackageName": "DefaultPackage",
|
"PackageName": "DefaultPackage",
|
||||||
"PackageVersion": "2025-09-04-762",
|
"PackageVersion": "2025-09-05-1073",
|
||||||
"Wrappers": [
|
"Wrappers": [
|
||||||
{
|
{
|
||||||
"BundleGUID": "01184a0f7f1c00a9e28a6932cfbe1a4f",
|
"BundleGUID": "01184a0f7f1c00a9e28a6932cfbe1a4f",
|
||||||
|
@ -11,10 +11,6 @@
|
||||||
"BundleGUID": "020c3fa177ffad0c70a67bed6489dda2",
|
"BundleGUID": "020c3fa177ffad0c70a67bed6489dda2",
|
||||||
"FileName": "020c3fa177ffad0c70a67bed6489dda2.bundle"
|
"FileName": "020c3fa177ffad0c70a67bed6489dda2.bundle"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"BundleGUID": "025fe3704124c293e0f7e63c6622777d",
|
|
||||||
"FileName": "025fe3704124c293e0f7e63c6622777d.bundle"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"BundleGUID": "02cf0baf2ee9ba4839b2f252a6cdffc6",
|
"BundleGUID": "02cf0baf2ee9ba4839b2f252a6cdffc6",
|
||||||
"FileName": "02cf0baf2ee9ba4839b2f252a6cdffc6.bundle"
|
"FileName": "02cf0baf2ee9ba4839b2f252a6cdffc6.bundle"
|
||||||
|
@ -263,6 +259,10 @@
|
||||||
"BundleGUID": "a3f05fe1cb86fe6f198e4c9aeb8ca797",
|
"BundleGUID": "a3f05fe1cb86fe6f198e4c9aeb8ca797",
|
||||||
"FileName": "a3f05fe1cb86fe6f198e4c9aeb8ca797.bundle"
|
"FileName": "a3f05fe1cb86fe6f198e4c9aeb8ca797.bundle"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"BundleGUID": "a4f4e2337e67cdb78a8ecc0591f85f33",
|
||||||
|
"FileName": "a4f4e2337e67cdb78a8ecc0591f85f33.bundle"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"BundleGUID": "a552779b664e1b6387821881b9501070",
|
"BundleGUID": "a552779b664e1b6387821881b9501070",
|
||||||
"FileName": "a552779b664e1b6387821881b9501070.bundle"
|
"FileName": "a552779b664e1b6387821881b9501070.bundle"
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2025-09-04-762
|
2025-09-05-1073
|
|
@ -129,7 +129,9 @@ public class RenderPrintingManager : MonoBehaviour
|
||||||
|
|
||||||
var fileInfo = new FileInfo(uploadTmp);
|
var fileInfo = new FileInfo(uploadTmp);
|
||||||
var cutBG = fileInfo.Directory.FullName + $"cut bg {fileInfo.Name}";
|
var cutBG = fileInfo.Directory.FullName + $"cut bg {fileInfo.Name}";
|
||||||
yield return StartCoroutine(Wait(uploadTmp, cutBG));
|
|
||||||
|
// 褪底功能
|
||||||
|
// yield return StartCoroutine(Wait(uploadTmp, cutBG));
|
||||||
|
|
||||||
Debug.Log(cutBG);
|
Debug.Log(cutBG);
|
||||||
Debug.Log("finish");
|
Debug.Log("finish");
|
||||||
|
@ -149,9 +151,10 @@ public class RenderPrintingManager : MonoBehaviour
|
||||||
var nowTicks = DateTime.Now.Ticks;
|
var nowTicks = DateTime.Now.Ticks;
|
||||||
string filePath = Path.Combine(FolderPath, $"printing-{nowTicks}");
|
string filePath = Path.Combine(FolderPath, $"printing-{nowTicks}");
|
||||||
var outputPath = $"{filePath}.png";
|
var outputPath = $"{filePath}.png";
|
||||||
File.WriteAllBytes(outputPath, B83.Image.PNGTools.ChangePPI(bytes, 300, 300));
|
var changePpi = B83.Image.PNGTools.ChangePPI(bytes, 300, 300);
|
||||||
|
// File.WriteAllBytes(outputPath, changePpi);
|
||||||
|
|
||||||
PngCompressor.CompressPngAndSetDpi(outputPath, outputPath);
|
PngCompressor.CompressPngAndSetDpi(changePpi, outputPath);
|
||||||
printingDatas.Add(File.ReadAllBytes(outputPath));
|
printingDatas.Add(File.ReadAllBytes(outputPath));
|
||||||
string tmpPath = outputPath;
|
string tmpPath = outputPath;
|
||||||
// File.WriteAllBytes(tmpPath, B83.Image.PNGTools.ChangePPI(bytes, 300, 300));
|
// File.WriteAllBytes(tmpPath, B83.Image.PNGTools.ChangePPI(bytes, 300, 300));
|
||||||
|
|
|
@ -33,26 +33,26 @@ MonoBehaviour:
|
||||||
m_Settings:
|
m_Settings:
|
||||||
m_SettingsList:
|
m_SettingsList:
|
||||||
m_List:
|
m_List:
|
||||||
- rid: 5235812828566782114
|
- rid: 5235812892772401233
|
||||||
- rid: 7138963020590612481
|
- rid: 7138963020590612481
|
||||||
- rid: 5235812828566782115
|
- rid: 5235812892772401234
|
||||||
- rid: 7138963020590612483
|
- rid: 7138963020590612483
|
||||||
- rid: 5235812828566782116
|
- rid: 5235812892772401235
|
||||||
- rid: 7138963020590612485
|
- rid: 7138963020590612485
|
||||||
- rid: 7138963020590612486
|
- rid: 7138963020590612486
|
||||||
- rid: 5235812828566782117
|
- rid: 5235812892772401236
|
||||||
- rid: 7138963020590612488
|
- rid: 7138963020590612488
|
||||||
- rid: 7138963020590612489
|
- rid: 7138963020590612489
|
||||||
- rid: 7138963020590612490
|
- rid: 7138963020590612490
|
||||||
- rid: 5235812828566782118
|
- rid: 5235812892772401237
|
||||||
- rid: 7138963020590612492
|
- rid: 7138963020590612492
|
||||||
- rid: 5235812828566782119
|
- rid: 5235812892772401238
|
||||||
- rid: 5235812828566782120
|
- rid: 5235812892772401239
|
||||||
- rid: 5235812828566782121
|
- rid: 5235812892772401240
|
||||||
- rid: 5235812828566782122
|
- rid: 5235812892772401241
|
||||||
- rid: 7138963020590612497
|
- rid: 7138963020590612497
|
||||||
- rid: 5235812828566782123
|
- rid: 5235812892772401242
|
||||||
- rid: 5235812828566782124
|
- rid: 5235812892772401243
|
||||||
- rid: 7138963020590612500
|
- rid: 7138963020590612500
|
||||||
m_RuntimeSettings:
|
m_RuntimeSettings:
|
||||||
m_List:
|
m_List:
|
||||||
|
@ -96,7 +96,7 @@ MonoBehaviour:
|
||||||
references:
|
references:
|
||||||
version: 2
|
version: 2
|
||||||
RefIds:
|
RefIds:
|
||||||
- rid: 5235812828566782114
|
- rid: 5235812892772401233
|
||||||
type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal,
|
type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal,
|
||||||
asm: Unity.RenderPipelines.Universal.Runtime}
|
asm: Unity.RenderPipelines.Universal.Runtime}
|
||||||
data:
|
data:
|
||||||
|
@ -118,7 +118,7 @@ MonoBehaviour:
|
||||||
type: 3}
|
type: 3}
|
||||||
m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61,
|
m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61,
|
||||||
type: 3}
|
type: 3}
|
||||||
- rid: 5235812828566782115
|
- rid: 5235812892772401234
|
||||||
type: {class: Renderer2DResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
type: {class: Renderer2DResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
|
||||||
data:
|
data:
|
||||||
m_Version: 0
|
m_Version: 0
|
||||||
|
@ -142,7 +142,7 @@ MonoBehaviour:
|
||||||
type: 2}
|
type: 2}
|
||||||
m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5,
|
m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5,
|
||||||
type: 2}
|
type: 2}
|
||||||
- rid: 5235812828566782116
|
- rid: 5235812892772401235
|
||||||
type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal,
|
type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal,
|
||||||
asm: Unity.RenderPipelines.Universal.Runtime}
|
asm: Unity.RenderPipelines.Universal.Runtime}
|
||||||
data:
|
data:
|
||||||
|
@ -156,7 +156,7 @@ MonoBehaviour:
|
||||||
type: 2}
|
type: 2}
|
||||||
m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862,
|
m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862,
|
||||||
type: 2}
|
type: 2}
|
||||||
- rid: 5235812828566782117
|
- rid: 5235812892772401236
|
||||||
type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal,
|
type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal,
|
||||||
asm: Unity.RenderPipelines.Universal.Runtime}
|
asm: Unity.RenderPipelines.Universal.Runtime}
|
||||||
data:
|
data:
|
||||||
|
@ -164,7 +164,7 @@ MonoBehaviour:
|
||||||
m_StripUnusedPostProcessingVariants: 1
|
m_StripUnusedPostProcessingVariants: 1
|
||||||
m_StripUnusedVariants: 1
|
m_StripUnusedVariants: 1
|
||||||
m_StripScreenCoordOverrideVariants: 1
|
m_StripScreenCoordOverrideVariants: 1
|
||||||
- rid: 5235812828566782118
|
- rid: 5235812892772401237
|
||||||
type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime}
|
type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime}
|
||||||
data:
|
data:
|
||||||
m_Version: 0
|
m_Version: 0
|
||||||
|
@ -186,7 +186,7 @@ MonoBehaviour:
|
||||||
type: 3}
|
type: 3}
|
||||||
m_DebugOccluderPS: {fileID: 4800000, guid: b3c92426a88625841ab15ca6a7917248,
|
m_DebugOccluderPS: {fileID: 4800000, guid: b3c92426a88625841ab15ca6a7917248,
|
||||||
type: 3}
|
type: 3}
|
||||||
- rid: 5235812828566782119
|
- rid: 5235812892772401238
|
||||||
type: {class: ProbeVolumeRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
type: {class: ProbeVolumeRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||||
data:
|
data:
|
||||||
m_Version: 1
|
m_Version: 1
|
||||||
|
@ -196,14 +196,14 @@ MonoBehaviour:
|
||||||
type: 3}
|
type: 3}
|
||||||
probeVolumeUploadDataL2CS: {fileID: 7200000, guid: 6196f34ed825db14b81fb3eb0ea8d931,
|
probeVolumeUploadDataL2CS: {fileID: 7200000, guid: 6196f34ed825db14b81fb3eb0ea8d931,
|
||||||
type: 3}
|
type: 3}
|
||||||
- rid: 5235812828566782120
|
- rid: 5235812892772401239
|
||||||
type: {class: IncludeAdditionalRPAssets, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
type: {class: IncludeAdditionalRPAssets, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||||
data:
|
data:
|
||||||
m_version: 0
|
m_version: 0
|
||||||
m_IncludeReferencedInScenes: 0
|
m_IncludeReferencedInScenes: 0
|
||||||
m_IncludeAssetsByLabel: 0
|
m_IncludeAssetsByLabel: 0
|
||||||
m_LabelToInclude:
|
m_LabelToInclude:
|
||||||
- rid: 5235812828566782121
|
- rid: 5235812892772401240
|
||||||
type: {class: ProbeVolumeBakingResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
type: {class: ProbeVolumeBakingResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||||
data:
|
data:
|
||||||
m_Version: 1
|
m_Version: 1
|
||||||
|
@ -225,13 +225,13 @@ MonoBehaviour:
|
||||||
type: 3}
|
type: 3}
|
||||||
renderingLayerRT: {fileID: -5126288278712620388, guid: 94a070d33e408384bafc1dea4a565df9,
|
renderingLayerRT: {fileID: -5126288278712620388, guid: 94a070d33e408384bafc1dea4a565df9,
|
||||||
type: 3}
|
type: 3}
|
||||||
- rid: 5235812828566782122
|
- rid: 5235812892772401241
|
||||||
type: {class: STP/RuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
type: {class: STP/RuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||||
data:
|
data:
|
||||||
m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3}
|
m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3}
|
||||||
m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3}
|
m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3}
|
||||||
m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3}
|
m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3}
|
||||||
- rid: 5235812828566782123
|
- rid: 5235812892772401242
|
||||||
type: {class: ProbeVolumeDebugResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
type: {class: ProbeVolumeDebugResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||||
data:
|
data:
|
||||||
m_Version: 1
|
m_Version: 1
|
||||||
|
@ -247,7 +247,7 @@ MonoBehaviour:
|
||||||
type: 3}
|
type: 3}
|
||||||
numbersDisplayTex: {fileID: 2800000, guid: 73fe53b428c5b3440b7e87ee830b608a,
|
numbersDisplayTex: {fileID: 2800000, guid: 73fe53b428c5b3440b7e87ee830b608a,
|
||||||
type: 3}
|
type: 3}
|
||||||
- rid: 5235812828566782124
|
- rid: 5235812892772401243
|
||||||
type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
|
||||||
data:
|
data:
|
||||||
m_Version: 1
|
m_Version: 1
|
||||||
|
|
Loading…
Reference in New Issue