@@ -42,6 +42,15 @@ private float GetOptionValue(int optionIndex, float defaultValue = 0f)
42
42
return defaultValue ;
43
43
}
44
44
45
+ private string GetOptionString ( int optionIndex , string defaultValue = "" )
46
+ {
47
+ if ( options != null && optionIndex < options . Length )
48
+ {
49
+ return options [ optionIndex ] ;
50
+ }
51
+ return defaultValue ;
52
+ }
53
+
45
54
private void LoadCanvasToTempFilePath ( )
46
55
{
47
56
var sys = WX . GetSystemInfoSync ( ) ;
@@ -55,15 +64,24 @@ private void LoadCanvasToTempFilePath()
55
64
float y = GetOptionValue ( 1 ) ;
56
65
float width = GetOptionValue ( 2 ) ;
57
66
float height = GetOptionValue ( 3 ) ;
67
+ float destWidth = GetOptionValue ( 4 ) ;
68
+ float destHeight = GetOptionValue ( 5 ) ;
69
+ string fileType = GetOptionString ( 6 , "png" ) ;
70
+ float quality = GetOptionValue ( 7 ) ;
58
71
59
- Debug . Log ( $ "Using values: x={ x } , y={ y } , width={ width } , height={ height } ") ;
72
+ Debug . Log ( $ "Using values: x={ x } , y={ y } , width={ width } , height={ height } , destWidth= { destWidth } , destHeight= { destHeight } , fileType= { fileType } , quality= { quality } ") ;
60
73
61
74
WXCanvas . ToTempFilePath ( new WXToTempFilePathParam ( )
62
75
{
63
76
x = ( int ) x ,
64
77
y = ( int ) y ,
65
78
width = ( int ) width ,
66
79
height = ( int ) height ,
80
+ destWidth = ( int ) destWidth ,
81
+ destHeight = ( int ) destHeight ,
82
+ fileType = fileType ,
83
+ quality = ( int ) quality ,
84
+
67
85
success = ( result ) =>
68
86
{
69
87
WX . ShowModal ( new ShowModalOption ( )
0 commit comments