コード例 #1
0
 public static int back2BestFitMode(WorkShop workshop)
 {
     int i;
     if (workshop == null)
     {
         i = 2;
     } else
     {
         MRect mrect = new MRect();
         mrect.set(0, 0, workshop.getDisplayW() - 0, workshop.getDisplayH());
         MRect mrect1 = new MRect();
         powermobia.photoeditor.EditorEngine.State state = new powermobia.photoeditor.EditorEngine.State();
         EditorEngineWrapper editorenginewrapper = workshop.getEditorEngineWrapper();
         i = editorenginewrapper.getState(state);
         getFitInParamEx(mrect1, state.iImgWidth, state.iImgHeight, mrect.right - mrect.left, mrect.bottom - mrect.top, false);
         mrect1.top = 0 + mrect1.top;
         mrect1.bottom = 0 + mrect1.bottom;
         if (mrect1.width() > 0 && mrect1.height() > 0)
         {
             if (workshop.getUIManagerConsole() != null)
             {
                 workshop.getUIManagerConsole().onChange(2, null, null);
             }
             i = editorenginewrapper.setImgBorderDes(mrect1);
             if (workshop.getUIManagerConsole() != null)
             {
                 workshop.getUIManagerConsole().onChange(3, null, null);
                 return i;
             }
         }
     }
     return i;
 }
コード例 #2
0
 public static int back2BestFitModeForEdit(WorkShop workshop)
 {
     int l;
     if (workshop == null)
     {
         l = 2;
     } else
     {
         int i = workshop.getResources().getInteger(0x7f0a001a);
         int j = workshop.getResources().getInteger(0x7f0a001b);
         int k = workshop.getResources().getInteger(0x7f0a001c);
         MRect mrect = new MRect();
         mrect.set(k, i, workshop.getDisplayW() - k, workshop.getDisplayH() - i - j);
         MRect mrect1 = new MRect();
         powermobia.photoeditor.EditorEngine.State state = new powermobia.photoeditor.EditorEngine.State();
         EditorEngineWrapper editorenginewrapper = workshop.getEditorEngineWrapper();
         l = editorenginewrapper.getState(state);
         getFitInParamEx(mrect1, state.iImgWidth, state.iImgHeight, mrect.right - mrect.left, mrect.bottom - mrect.top, false);
         mrect1.top = j + mrect1.top;
         mrect1.bottom = j + mrect1.bottom;
         mrect1.left = k + mrect1.left;
         mrect1.right = k + mrect1.right;
         if (mrect1.width() > 0 && mrect1.height() > 0)
         {
             if (workshop.getUIManagerConsole() != null)
             {
                 workshop.getUIManagerConsole().onChange(2, null, null);
             }
             l = editorenginewrapper.setImgBorderDes(mrect1);
             if (workshop.getUIManagerConsole() != null)
             {
                 workshop.getUIManagerConsole().onChange(3, null, null);
                 return l;
             }
         }
     }
     return l;
 }