1335 1339
				B2EB109223A7899800EBB34D /* IPUAMapResource.bundle in Resources */,
1336 1340
				B264A20822B32F0600714D0D /* Zocial.ttf in Resources */,

+ 15 - 0
display-center/display-center.xcworkspace/contents.xcworkspacedata

@ -2,6 +2,21 @@
2 2
<Workspace
3 3
   version = "1.0">
4 4
   <FileRef
5
      location = "group:../../iOS-Plugin/IpuBaiDuMap/IpuBaiDuMap.xcodeproj">
6
   </FileRef>
7
   <FileRef
8
      location = "group:../../iOS-Plugin/IPUAMap/IPUAMap.xcodeproj">
9
   </FileRef>
10
   <FileRef
11
      location = "group:../../iOS/IPUMobile/IPUMobile.xcodeproj">
12
   </FileRef>
13
   <FileRef
14
      location = "group:../../iOS/IPUFoundation/IPUFoundation.xcodeproj">
15
   </FileRef>
16
   <FileRef
17
      location = "group:../IPUMobileFunc/IPUMobileFunc.xcodeproj">
18
   </FileRef>
19
   <FileRef
5 20
      location = "group:display-center.xcodeproj">
6 21
   </FileRef>
7 22
</Workspace>

二进制
display-center/display-center.xcworkspace/xcuserdata/benny.xcuserdatad/UserInterfaceState.xcuserstate


+ 21 - 5
display-center/display-center.xcworkspace/xcuserdata/benny.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@ -18,16 +18,32 @@
18 18
      <BreakpointProxy
19 19
         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
20 20
         <BreakpointContent
21
            uuid = "904060EB-AC2B-40A7-955D-522ED1634EE8"
21
            uuid = "A966A94E-021E-46A4-8097-268A686DC730"
22 22
            shouldBeEnabled = "Yes"
23 23
            ignoreCount = "0"
24 24
            continueAfterRunningActions = "No"
25
            filePath = "../../iOS-Plugin/IPUAMap/IPUAMap/IPUAMapHelper.m"
25
            filePath = "../../iOS-Plugin/IPUAMap/IPUAMap/IPUAMapSearchReGeocode.m"
26 26
            startingColumnNumber = "9223372036854775807"
27 27
            endingColumnNumber = "9223372036854775807"
28
            startingLineNumber = "79"
29
            endingLineNumber = "79"
30
            landmarkName = "-markMap:"
28
            startingLineNumber = "84"
29
            endingLineNumber = "84"
30
            landmarkName = "-location:reGeocode:completion:"
31
            landmarkType = "7">
32
         </BreakpointContent>
33
      </BreakpointProxy>
34
      <BreakpointProxy
35
         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
36
         <BreakpointContent
37
            uuid = "D2CB6965-45D6-4F95-89E1-583567C38B13"
38
            shouldBeEnabled = "Yes"
39
            ignoreCount = "0"
40
            continueAfterRunningActions = "No"
41
            filePath = "../../iOS/IPUMobile/IPUMobile/Utils/Tool/Encode/IPUVerifyApp.mm"
42
            startingColumnNumber = "9223372036854775807"
43
            endingColumnNumber = "9223372036854775807"
44
            startingLineNumber = "28"
45
            endingLineNumber = "28"
46
            landmarkName = "+verifyApp"
31 47
            landmarkType = "7">
32 48
         </BreakpointContent>
33 49
      </BreakpointProxy>

+ 0 - 1
display-center/display-center/IPUBaiduMapPaoPaoView.m

@ -47,7 +47,6 @@
47 47
}
48 48
49 49
- (void)setModel:(IPUBaiduMapAnnotationViewModel *)model {
50
    NSLog(@"setModel ~~~~ %@  : %@,%@",self,model.title,model.subtitle);
51 50
    self.portraitView.image = [IPUBaiduMapManager imageNamed:model.ppImage];
52 51
    self.titleLabel.text = model.title;
53 52
    self.subtitleLabel.text = model.subtitle;

+ 21 - 0
display-center/display-center/IPULocation.gpx

@ -0,0 +1,21 @@
1
<?xml version="1.0"?>
2
<gpx version="1.1" creator="Xcode">
3
    
4
    <!--
5
     Provide one or more waypoints containing a latitude/longitude pair. If you provide one
6
     waypoint, Xcode will simulate that specific location. If you provide multiple waypoints,
7
     Xcode will simulate a route visiting each waypoint.
8
     -->
9
    <wpt lat="30.219072" lon="120.172615">
10
        <name>Cupertino</name>
11
        <!--
12
         Optionally provide a time element for each waypoint. Xcode will interpolate movement
13
         at a rate of speed based on the time elapsed between each waypoint. If you do not provide
14
         a time element, then Xcode will use a fixed rate of speed.
15
         
16
         Waypoints must be sorted by time in ascending order.
17
         -->
18
        <time>2014-09-24T14:55:37Z</time>
19
    </wpt>
20
    
21
</gpx>

+ 2 - 2
display-center/display-center/PhoneNumber.m

@ -46,7 +46,7 @@ RCT_EXPORT_METHOD(openContacts:(RCTResponseSenderBlock)success
46 46
                dispatch_async(dispatch_get_main_queue(), ^{
47 47
                    ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
48 48
                    picker.peoplePickerDelegate = strongSelf;
49
                    UIViewController *rootCtrl = [IPUViewControllerHelper getCurrentViewController];
49
                    UIViewController *rootCtrl = [IPUUITool getCurrentViewController];
50 50
                    [rootCtrl presentViewController:picker animated:YES completion:nil];
51 51
                });
52 52
            } else {
@ -98,7 +98,7 @@ RCT_EXPORT_METHOD(openContacts:(RCTResponseSenderBlock)success
98 98
99 99
RCT_EXPORT_METHOD(dismissRNViewController:(NSString *)text) {
100 100
    dispatch_async(dispatch_get_main_queue(), ^{
101
        UIViewController *topViewController = [IPUViewControllerHelper getCurrentViewController];
101
        UIViewController *topViewController = [IPUUITool getCurrentViewController];
102 102
        UIViewController *presentingViewController = topViewController.presentingViewController ? topViewController.presentingViewController : nil;
103 103
        if (text
104 104
            && text.length

+ 1 - 1
display-center/display-center/ViewController.m

@ -54,7 +54,7 @@
54 54
}
55 55
56 56
- (void)back {
57
    UIViewController *viewController = [IPUViewControllerHelper getCurrentViewController];
57
    UIViewController *viewController = [IPUUITool getCurrentViewController];
58 58
    
59 59
    if ([viewController isKindOfClass:[IPUViewController class]]) {
60 60
        IPUViewController *wdViewController = (IPUViewController *)viewController;

no message · ca17636a09 - Nuosi Git Service
liufl5 4 ans auparavant
Parent
commit
ca17636a09

BIN
display-center/display-center.xcodeproj/project.xcworkspace/xcuserdata/mac.xcuserdatad/UserInterfaceState.xcuserstate


添加图片加水印的插件 · 17542b4319 - Nuosi Git Service
Browse Source

添加图片加水印的插件

zhanglong7 5 years ago
parent
commit
17542b4319

+ 24 - 0
ipu-plugin-basic/build.gradle

@ -0,0 +1,24 @@
1
apply plugin: 'java'
2
3
group = 'com.ai.ipu.mobile'
4
version = '3.0-SNAPSHOT'
5
6
tasks.withType(JavaCompile) {
7
	options.encoding = 'UTF-8'
8
}
9
10
repositories {
11
    maven { url "http://114.215.100.48:9090/nexus/content/groups/public/" }
12
}
13
14
dependencies {
15
	compileOnly group: 'junit', name: 'junit', version:'4.12'
16
	compileOnly group: 'android', name: 'android', version:'22'
17
	compileOnly group: 'com.ai.wade', name: 'wade-mobile-data', version:'1.0'
18
    compileOnly "android:android-lite-http:1.0"
19
	compileOnly "com.ai.ipu:ipu-basic:${IPU_VERSION}"
20
	compileOnly "com.ai.ipu.mobile:ipu-mobile-basic:${IPU_VERSION}"
21
	compileOnly "com.ai.ipu.mobile:ipu-mobile-framework:${IPU_VERSION}"
22
    compileOnly "com.ai.ipu.mobile:ipu-plugin-extend:${IPU_VERSION}"
23
    compileOnly "com.ai.ipu.mobile:ipu-mobile-ui:${IPU_VERSION}"
24
}

+ 18 - 0
ipu-plugin-basic/gradle.properties

@ -0,0 +1,18 @@
1
## Project-wide Gradle settings.
2
#
3
# For more details on how to configure your build environment visit
4
# http://www.gradle.org/docs/current/userguide/build_environment.html
5
#
6
# Specifies the JVM arguments used for the daemon process.
7
# The setting is particularly useful for tweaking memory settings.
8
# Default value: -Xmx1024m -XX:MaxPermSize=256m
9
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
10
#
11
# When configured, Gradle will run in incubating parallel mode.
12
# This option should only be used with decoupled projects. More details, visit
13
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
14
# org.gradle.parallel=true
15
#
16
android_support_v4=1.0
17
IPU_VERSION=3.0-SNAPSHOT
18

+ 90 - 0
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileCamera.java

@ -1,6 +1,10 @@
1 1
package com.ai.ipu.mobile.plugin;
2 2
3
import java.io.BufferedOutputStream;
3 4
import java.io.File;
5
import java.io.FileNotFoundException;
6
import java.io.FileOutputStream;
7
import java.io.IOException;
4 8
import java.text.SimpleDateFormat;
5 9
import java.util.Date;
6 10
@ -12,6 +16,8 @@ import android.content.Intent;
12 16
import android.database.Cursor;
13 17
import android.graphics.Bitmap;
14 18
import android.graphics.BitmapFactory;
19
import android.graphics.Canvas;
20
import android.graphics.Rect;
15 21
import android.net.Uri;
16 22
import android.os.Bundle;
17 23
import android.provider.MediaStore;
@ -23,6 +29,7 @@ import com.ai.ipu.mobile.frame.plugin.Plugin;
23 29
import com.ai.ipu.mobile.ui.HintUtil;
24 30
import com.ai.ipu.mobile.ui.image.MobileGraphics;
25 31
import com.ai.ipu.mobile.util.DirectionUtil;
32
import com.ai.ipu.mobile.util.IpuMobileLog;
26 33
import com.ai.ipu.mobile.util.IpuMobileUtility;
27 34
import com.ailk.common.data.IData;
28 35
import com.ailk.common.data.impl.DataMap;
@ -288,4 +295,87 @@ public class MobileCamera extends Plugin {
288 295
		//cursor.close(); //关闭会报错
289 296
		return path;
290 297
	}
298
	
299
	public void addWaterMarkForImage(JSONArray param) throws Exception {
300
	    String path = param.getString(0);
301
	    String waterPath = param.getString(1);
302
	    double left = param.getDouble(2);
303
	    double top = param.getDouble(3);
304
	    double right = param.getDouble(4);
305
	    double bottom = param.getDouble(5);
306
	    
307
	    String resultPath = addWaterMark(path, waterPath, left, top, right, bottom);
308
	    
309
	    callback(resultPath);
310
	}
311
	
312
	/**
313
    * @param path 原图片路径
314
    * @param waterPath 水印图片路径
315
    * @param left 水印图片左边位置,值为占整个图片的宽的比例
316
    * @param top 水印图片上边位置,值为占整个图片的高的比例
317
    * @param right 水印图片右边位置,值为占整个图片的宽的比例
318
    * @param bottom 水印图片下边位置,值为占整个图片的高的比例
319
    * @return 加了水印的图片路径
320
    */
321
   private String addWaterMark(String path, String waterPath, double left, double top, double right, double bottom) {
322
       Bitmap bitmap1 = BitmapFactory.decodeFile(path);
323
       Bitmap bitmap2 = BitmapFactory.decodeFile(waterPath);
324
       bitmap1 = bitmap1.copy(bitmap1.getConfig(), true);
325
       Canvas canvas = new Canvas(bitmap1);
326
327
       Rect rect = buildRect(bitmap1, left, top, right, bottom);
328
       canvas.drawBitmap(bitmap2, null, rect, null);
329
330
       String fileName = format.format(new Date()) + "-mark.png";
331
       File f = new File(DirectionUtil.getInstance(context).getImageDirection(true), fileName);
332
       if (!f.getParentFile().exists()) {
333
           f.getParentFile().mkdirs();
334
       }
335
       String res = f.getAbsolutePath();
336
       BufferedOutputStream bos = null;
337
       try {
338
           FileOutputStream outputStream = new FileOutputStream(f);
339
           bos = new BufferedOutputStream(outputStream);
340
           bitmap1.compress(Bitmap.CompressFormat.PNG, 100, bos);
341
       } catch (FileNotFoundException e) {
342
           e.printStackTrace();
343
           res = null;
344
       } finally {
345
           if (bos != null) {
346
               try {
347
                   bos.close();
348
               } catch (IOException e) {
349
                   e.printStackTrace();
350
               }
351
           }
352
       }
353
354
       return res;
355
   }
356
357
   private Rect buildRect(Bitmap bitmap, double left, double top, double right, double bottom) {
358
       left = fixIn1(left);
359
       right = fixIn1(right);
360
       top = fixIn1(top);
361
       bottom = fixIn1(bottom);
362
       int w = bitmap.getWidth();
363
       int h = bitmap.getHeight();
364
       int l = (int) (w * left);
365
       int t = (int) (h * top);
366
       int r = (int) (w * right);
367
       int b = (int) (h * bottom);
368
       if (l >= r || t >= b) {
369
           IpuMobileLog.w(TAG, "buildRect: invalid params");
370
           return new Rect(0, 0, w/4, h/4);
371
       }
372
       Rect rect = new Rect(l, t, r, b);
373
       return rect;
374
   }
375
376
   private double fixIn1(double v) {
377
       if (v > 1) v = 1;
378
       if (v < 0) v = 0;
379
       return v;
380
   }
291 381
}

android-share - Nuosi Git Service

ipu的trunk版的android工程和服务端工程。

leijie 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
..
android-annotations-1.0.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
android-support-v4.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
android-support-v7-appcompat.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
android-support-v7-gridlayout.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
android-support-v7-mediarouter.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
eventbus-3.0.0.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
ipu-basic-3.0.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
ipu-mobile-basic-3.0.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
org.eclipse.paho.android.service-1.0.2.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
org.eclipse.paho.client.mqttv3-1.1.0.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago
unirest-for-android-1.0.jar 3b751fd7a7 迁出ipu-mobile-ui,ipu-plugin-basic工程;迁入keep-live,show-client,show-server,ipu-sdk-demo,ipu-push-test,super-client工程; 3 years ago