This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:imgly_sdk/imgly_sdk.dart'; | |
import 'package:photo_editor_sdk/photo_editor_sdk.dart'; | |
/// Here, we assign custom stickers to the editor. | |
/// | |
/// We create a completely custom category | |
/// containing custom stickers: | |
/// A custom sticker displaying the Flutter logo: | |
final flutterSticker = Sticker( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:photo_editor_sdk/photo_editor_sdk.dart'; | |
import 'package:video_editor_sdk/video_editor_sdk.dart'; | |
/// For photo_editor_sdk: | |
PESDK.openEditor(image: "assets/demo-image.jpg"); | |
/// For video_editor_sdk: | |
VESDK.openEditor(video: "assets/demo-video.mp4"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { Configuration, PhotoEditorModal } from 'react-native-photoeditorsdk'; | |
const configuration: Configuration = { | |
sticker: { | |
categories: [{ | |
identifier: "demo_sticker_category", name: "Logos", | |
thumbnailURI: require("./react.png"), | |
items: [{ | |
identifier: "demo_sticker_react", name: "React", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textFillButton.setOnTextFillStateChangeListener(new TextFillButton.OnTextFillStateChangeListener() { | |
@Override | |
public void onTextFillStateChange(boolean isTextFillClicked) { | |
if (isTextFillClicked) { | |
if (textColor == DEFAULT_COLOR) { | |
textBgColor = BLACK_COLOR; | |
} else { | |
textBgColor = textColor; | |
textColor = DEFAULT_COLOR; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func stickerSelectionController(_ stickerSelectionController: StickerSelectionController, didSelect sticker: Sticker, with image: UIImage) { | |
guard let referenceSize = delegate?.stickerViewControllerReferenceSize(self) else { return } | |
var model = StickerSpriteModel(sticker: sticker) | |
let aspectRatio = referenceSize.width / referenceSize.height | |
model.normalizedCenter = CGPoint(x: 0.5, y: 0.5) | |
model.normalizedSize = CGSize(width: 0.3, height: 0.3 * aspectRatio) | |
delegate?.stickerViewControllerDidFinish(self, stickerModel: model) | |
dismiss(animated: true, completion: nil) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func spriteEditControllerPreviewView(_ spriteEditController: SpriteEditController) -> UIView? { | |
return self.previewViewController?.previewView | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void initialize(CordovaInterface cordova, CordovaWebView webView) { | |
super.initialize(cordova, webView); | |
PESDK.init(cordova.getActivity().getApplication(), "LICENSE_ANDROID"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onDeviceReady: function() { | |
selectImageBtn = document.getElementById('js-selectImageBtn'); | |
selectImageBtn.addEventListener('click', function() { | |
window.imagePicker.getPictures( | |
function(results) { | |
let imageURI = results[0]; | |
PESDK.present( | |
function(result){ alert('PESDK result: ' + JSON.stringify(result)); }, | |
function(error){ alert('PESDK error: ' + error); }, | |
{ path: imageURI } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onDeviceReady: function() { | |
selectImageBtn = document.getElementById('js-selectImageBtn'); | |
selectImageBtn.addEventListener('click', function() { | |
// TODO: Open PhotoEditor SDK | |
}); | |
selectImageBtn.disabled = false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (void)initialize { | |
if (self == [PESDKPlugin self]) { | |
[PESDK unlockWithLicenseAt:[[NSBundle mainBundle] URLForResource:@"LICENSE_IOS" withExtension:nil]]; | |
} | |
} |
NewerOlder