本文整理汇总了Java中org.robovm.apple.uikit.UIImage类的典型用法代码示例。如果您正苦于以下问题:Java UIImage类的具体用法?Java UIImage怎么用?Java UIImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIImage类属于org.robovm.apple.uikit包,在下文中一共展示了UIImage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getRemoteImage
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
@Override public Image getRemoteImage(final String url, int width, int height) {
final ImageImpl image = createImage(true, width, height, url);
plat.net().req(url).execute().
onSuccess(new Slot<Net.Response>() {
public void onEmit (Net.Response rsp) {
try {
image.succeed(toData(Scale.ONE, new UIImage(new NSData(rsp.payload()))));
} catch (Throwable t) {
plat.log().warn("Failed to decode remote image [url=" + url + "]", t);
image.fail(t);
}
}
}).
onFailure(new Slot<Throwable>() {
public void onEmit (Throwable cause) { image.fail(cause); }
});
return image;
}
开发者ID:playn,项目名称:playn,代码行数:19,代码来源:RoboAssets.java
示例2: setContentOfCell
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
public static UITableViewCell setContentOfCell(String name, NSURL url, String adresse, String email) {
UITableViewCell cell = new UITableViewCell(new CGRect(0, 0, 300, 60));
UIImageView img = new UIImageView(new CGRect(20, 10, 70, 70));
NSData data = (NSData)NSData.read(url);
img.setImage(new UIImage(data));
cell.getContentView().addSubview(img);
UILabel label1 = new UILabel(new CGRect(100, 10, cell.getContentView().getFrame().getWidth(), 20));
label1.setText(name);
label1.setTextColor(UIColor.colorBrown());
cell.getContentView().addSubview(label1);
UILabel label2 = new UILabel(new CGRect(100, 35, cell.getContentView().getFrame().getWidth(), 20));
label2.setText(adresse);
cell.getContentView().addSubview(label2);
UILabel label3 = new UILabel(new CGRect(100, 55, cell.getContentView().getFrame().getWidth(), 20));
label3.setText(email);
cell.getContentView().addSubview(label3);
return cell;
}
开发者ID:Kourtessia,项目名称:RoboVM-for-iOS,代码行数:22,代码来源:AddressbookUtils.java
示例3: shareCurrentScreen
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
@Override
public boolean shareCurrentScreen() {
SLComposeViewController slc = RobovmLauncher.getSLComposeViewController();
String screenshotPath = ScreenshotFactory.saveScreenshot(Gdx.files.getExternalStoragePath() + "/screenshots/", true);
// If we were able to take a screenshot
if (!screenshotPath.equals("")){
slc.addImage(new UIImage(new File(screenshotPath)));
UIViewController view = UIApplication.getSharedApplication().getKeyWindow().getRootViewController();
view.presentViewController(slc, false, null);
return true;
}else{
return false;
}
}
开发者ID:pierotofy,项目名称:snappyfrog,代码行数:20,代码来源:iOSServices.java
示例4: generateLogoImageView
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
private void generateLogoImageView() {
logoImageView = new UIImageView(new CGRect(0f, 0f, 20f, 20f));
logoImageView.setImage(UIImage.createFromBundle("logoWhite.png"));
logoImageView.setContentMode(UIViewContentMode.ScaleAspectFit);
logoImageView.setTranslatesAutoresizingMaskIntoConstraints(false);
logoImageView.setUserInteractionEnabled(false);
this.getView().addSubview(logoImageView);
this.getView().addConstraint(
NSLayoutConstraint.create(logoImageView,
NSLayoutAttribute.CenterX, NSLayoutRelation.Equal,
this.getView(), NSLayoutAttribute.CenterX, 1, 0));
this.getView().addConstraint(
NSLayoutConstraint.create(logoImageView,
NSLayoutAttribute.CenterY, NSLayoutRelation.Equal,
this.getView(), NSLayoutAttribute.CenterY, 1, -120));
this.getView().addConstraint(
NSLayoutConstraint.create(logoImageView,
NSLayoutAttribute.Height, NSLayoutRelation.Equal,
this.getView(), NSLayoutAttribute.Height, 0, 55));
this.getView().addConstraint(
NSLayoutConstraint.create(logoImageView,
NSLayoutAttribute.Width, NSLayoutRelation.Equal,
this.getView(), NSLayoutAttribute.Width, 0, 64));
}
开发者ID:wolfgang-s,项目名称:owncloud-gallery,代码行数:27,代码来源:LoginViewController.java
示例5: PAPLoadMoreCell
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
public PAPLoadMoreCell(UITableViewCellStyle style, String reuseIdentifier) {
super(style, reuseIdentifier);
setOpaque(false);
setSelectionStyle(UITableViewCellSelectionStyle.None);
setAccessoryType(UITableViewCellAccessoryType.None);
setBackgroundColor(UIColor.clear());
mainView = new UIView(getContentView().getFrame());
if (reuseIdentifier.equals("NextPageDetails")) {
mainView.setBackgroundColor(UIColor.white());
} else {
mainView.setBackgroundColor(UIColor.black());
}
loadMoreImageView = new UIImageView(UIImage.getImage("CellLoadMore"));
mainView.addSubview(loadMoreImageView);
getContentView().addSubview(mainView);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:21,代码来源:PAPLoadMoreCell.java
示例6: setFile
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
public void setFile(PFFile file) {
final String requestURL = file.getUrl(); // Save copy of url locally
url = file.getUrl(); // Save copy of url on the instance
file.getDataInBackground(new PFGetDataCallback() {
@Override
public void done(NSData data, NSError error) {
if (error == null) {
UIImage image = new UIImage(data);
if (requestURL.equals(url)) {
setImage(image);
setNeedsDisplay();
}
} else {
Log.e("Error on fetching file: %s", error);
}
}
});
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:PAPImageView.java
示例7: viewDidLoad
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
@Override
public void viewDidLoad() {
super.viewDidLoad();
getNavigationItem().setTitleView(new UIImageView(UIImage.getImage("LogoNavigationBar")));
getNavigationItem().setRightBarButtonItem(new PAPSettingsButtonItem(settingsButtonAction));
blankTimelineView = new UIView(getTableView().getBounds());
UIButton button = new UIButton(UIButtonType.Custom);
button.setFrame(new CGRect(33, 96, 253, 173));
button.setBackgroundImage(UIImage.getImage("HomeTimelineBlank"), UIControlState.Normal);
button.addOnTouchUpInsideListener(inviteFriendsButtonAction);
blankTimelineView.addSubview(button);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:17,代码来源:PAPHomeViewController.java
示例8: viewDidLoad
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
@Override
public void viewDidLoad() {
super.viewDidLoad();
UIImageView backgroundImageView = new UIImageView(UIScreen.getMainScreen().getApplicationFrame());
backgroundImageView.setImage(UIImage.getImage("BackgroundLogin"));
getView().addSubview(backgroundImageView);
// Position of the Facebook button
double yPosition = 360;
if (UIScreen.getMainScreen().getBounds().getSize().getHeight() > 480f) {
yPosition = 450;
}
facebookLoginButton = new FBSDKLoginButton();
facebookLoginButton.setReadPermissions(Arrays.asList("public_profile", "user_friends", "email",
"user_photos"));
facebookLoginButton.setFrame(new CGRect((UIScreen.getMainScreen().getBounds().getWidth() - 244) / 2, yPosition,
244, 44));
facebookLoginButton.setDelegate(this);
facebookLoginButton.setTooltipBehavior(FBSDKLoginButtonTooltipBehavior.Disable);
getView().addSubview(facebookLoginButton);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:24,代码来源:PAPLoginViewController.java
示例9: setViewControllers
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
@Override
public void setViewControllers(NSArray<UIViewController> viewControllers, boolean animated) {
super.setViewControllers(viewControllers, animated);
UIButton cameraButton = new UIButton(UIButtonType.Custom);
cameraButton.setFrame(new CGRect((getTabBar().getBounds().getSize().getWidth() - 131) / 2, 0, 131, getTabBar()
.getBounds().getSize().getHeight()));
cameraButton.setImage(UIImage.getImage("ButtonCamera"), UIControlState.Normal);
cameraButton.setImage(UIImage.getImage("ButtonCameraSelected"), UIControlState.Highlighted);
cameraButton.addOnTouchUpInsideListener(photoCaptureButtonAction);
getTabBar().addSubview(cameraButton);
UISwipeGestureRecognizer swipeUpGestureRecognizer = new UISwipeGestureRecognizer(
new UIGestureRecognizer.OnGestureListener() {
@Override
public void onGesture(UIGestureRecognizer gestureRecognizer) {
shouldPresentPhotoCaptureController();
}
});
swipeUpGestureRecognizer.setDirection(UISwipeGestureRecognizerDirection.Up);
swipeUpGestureRecognizer.setNumberOfTouchesRequired(1);
cameraButton.addGestureRecognizer(swipeUpGestureRecognizer);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:24,代码来源:PAPTabBarController.java
示例10: applyTintEffect
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
public static UIImage applyTintEffect(UIImage image, UIColor tintColor) {
final double effectColorAlpha = 0.6;
UIColor effectColor = tintColor;
long componentCount = tintColor.getCGColor().getNumberOfComponents();
if (componentCount == 2) {
double[] b = tintColor.getWhiteAlpha();
if (b != null) {
effectColor = UIColor.fromWhiteAlpha(b[0], effectColorAlpha);
}
} else {
double[] rgba = tintColor.getRGBA();
if (rgba != null) {
effectColor = UIColor.fromRGBA(rgba[0], rgba[1], rgba[2], effectColorAlpha);
}
}
return applyBlur(image, 10, effectColor, -1, null);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:UIImageEffects.java
示例11: addAlpha
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
/**
*
* @param image
* @return a copy of the given image, adding an alpha channel if it doesn't
* already have one
*/
public static UIImage addAlpha(UIImage image) {
if (hasAlpha(image)) {
return image;
}
CGImage i = image.getCGImage();
long width = i.getWidth();
long height = i.getHeight();
// The bitsPerComponent and bitmapInfo values are hard-coded to prevent
// an "unsupported parameter combination" error
CGBitmapContext offscreenContext = CGBitmapContext.create(width, height, 8, 0, i.getColorSpace(),
new CGBitmapInfo(CGBitmapInfo.ByteOrderDefault.value() | CGImageAlphaInfo.PremultipliedFirst.value())); // TODO
// could
// be
// improved
// Draw the image into the context and retrieve the new image, which
// will now have an alpha layer
offscreenContext.drawImage(new CGRect(0, 0, width, height), i);
CGImage ia = offscreenContext.toImage();
UIImage alphaImage = new UIImage(ia);
return alphaImage;
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:32,代码来源:UIImageUtility.java
示例12: createThumbnail
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
/**
*
* @param image
* @param thumbnailSize
* @param borderSize
* @param cornerRadius
* @param quality
* @return a copy of this image that is squared to the thumbnail size. If
* transparentBorder is non-zero, a transparent border of the given
* size will be added around the edges of the thumbnail. (Adding a
* transparent border of at least one pixel in size has the
* side-effect of antialiasing the edges of the image when rotating
* it using Core Animation.)
*/
public static UIImage createThumbnail(UIImage image, int thumbnailSize, int borderSize, int cornerRadius,
CGInterpolationQuality quality) {
UIImage resizedImage = resize(image, UIViewContentMode.ScaleAspectFill,
new CGSize(thumbnailSize, thumbnailSize), quality);
// Crop out any part of the image that's larger than the thumbnail size
// The cropped rect must be centered on the resized image
// Round the origin points so that the size isn't altered when
// CGRectIntegral is later invoked
CGRect cropRect = new CGRect(Math.round((resizedImage.getSize().getWidth() - thumbnailSize) / 2),
Math.round((resizedImage.getSize().getHeight() - thumbnailSize) / 2), thumbnailSize, thumbnailSize);
UIImage croppedImage = crop(resizedImage, cropRect);
UIImage transparentBorderImage = borderSize != 0 ? addTransparentBorder(croppedImage, borderSize)
: croppedImage;
return createRoundedCornerImage(transparentBorderImage, cornerRadius, borderSize);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:33,代码来源:UIImageUtility.java
示例13: resize
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
/**
*
* @param image
* @param newSize
* @param quality
* @return a rescaled copy of the image, taking into account its orientation
* The image will be scaled disproportionately if necessary to fit
* the bounds specified by the parameter
*/
public static UIImage resize(UIImage image, CGSize newSize, CGInterpolationQuality quality) {
boolean drawTransposed;
switch (image.getOrientation()) {
case Left:
case LeftMirrored:
case Right:
case RightMirrored:
drawTransposed = true;
break;
default:
drawTransposed = false;
break;
}
return resize(image, newSize, getTransformForOrientation(image, newSize), drawTransposed, quality);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:27,代码来源:UIImageUtility.java
示例14: getCellForItem
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
@Override
public UICollectionViewCell getCellForItem(UICollectionView collectionView, NSIndexPath indexPath) {
final AAPLGridViewCell cell = (AAPLGridViewCell) collectionView.dequeueReusableCell(CellReuseIdentifier,
indexPath);
// Increment the cell's tag
final long currentTag = cell.getTag() + 1;
cell.setTag(currentTag);
PHAsset asset = assetsFetchResults.get(indexPath.getItem());
imageManager.requestImageForAsset(asset, assetGridThumbnailSize, PHImageContentMode.AspectFill, null,
new VoidBlock2<UIImage, PHImageRequestResult>() {
@Override
public void invoke(UIImage result, PHImageRequestResult b) {
// Only update the thumbnail if the cell tag hasn't
// changed. Otherwise, the cell has been re-used.
if (cell.getTag() == currentTag) {
cell.setThumbnailImage(result);
}
}
});
return cell;
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:24,代码来源:AAPLAssetGridViewController.java
示例15: finishAndUpdate
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
private void finishAndUpdate() {
dismissViewController(true, null);
if (capturedImages.size() > 0) {
if (capturedImages.size() == 1) {
// Camera took a single picture.
imageView.setImage(capturedImages.get(0));
} else {
// Camera took multiple pictures; use the list of images for
// animation.
imageView.setAnimationImages(new NSArray<UIImage>(capturedImages));
imageView.setAnimationDuration(5);// Show each captured photo
// for 5 seconds.
imageView.setAnimationRepeatCount(0); // Animate forever (show
// all photos).
imageView.startAnimating();
}
// To be ready to start again, clear the captured images array.
capturedImages.clear();
}
imagePickerController = null;
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:24,代码来源:PhotoViewController.java
示例16: getCellForItem
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
@Override
public UICollectionViewCell getCellForItem(UICollectionView collectionView, NSIndexPath indexPath) {
// we're going to use a custom UICollectionViewCell, which will hold an
// image and its label
Cell cell = (Cell) collectionView.dequeueReusableCell(CELL_ID, indexPath);
// cell.setBackgroundColor(UIColor.blue());
// make the cell's title the actual NSIndexPath value
cell.getLabel().setText(String.format("{%d,%d}", indexPath.getRow(), indexPath.getSection()));
// load the image for this cell
cell.getImage().setImage(UIImage.getImage(String.valueOf(indexPath.getRow()) + ".jpg"));
return cell;
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:17,代码来源:ViewController.java
示例17: configureCustomSlider
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
private void configureCustomSlider() {
UIImage leftTrackImage = UIImage.getImage("slider_blue_track");
customSlider.setMinimumTrackImage(leftTrackImage, UIControlState.Normal);
UIImage rightTrackImage = UIImage.getImage("slider_green_track");
customSlider.setMaximumTrackImage(rightTrackImage, UIControlState.Normal);
UIImage thumbImage = UIImage.getImage("slider_thumb");
customSlider.setThumbImage(thumbImage, UIControlState.Normal);
customSlider.setMinimumValue(0);
customSlider.setMaximumValue(100);
customSlider.setContinuous(false);
customSlider.setValue(84);
customSlider.addOnValueChangedListener(this);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:AAPLSliderViewController.java
示例18: configureImageButton
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
private void configureImageButton() {
// To create this button in code you can use UIButton.create() with a
// parameter value of UIButtonType.Custom.
// Remove the title text.
imageButton.setTitle("", UIControlState.Normal);
imageButton.setTintColor(Colors.PURPLE);
UIImage imageButtonNormalImage = UIImage.getImage("x_icon");
imageButton.setImage(imageButtonNormalImage, UIControlState.Normal);
// Add an accessibility label to the image.
imageButton.setAccessibilityLabel("X Button");
imageButton.addOnTouchUpInsideListener(this);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:18,代码来源:AAPLButtonViewController.java
示例19: configureCustomSegmentsSegmentedControl
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
private void configureCustomSegmentsSegmentedControl() {
Map<String, String> imageToAccessibilityLabelMappings = new HashMap<>();
imageToAccessibilityLabelMappings.put("checkmark_icon", "Done");
imageToAccessibilityLabelMappings.put("search_icon", "Search");
imageToAccessibilityLabelMappings.put("tools_icon", "Settings");
int i = 0;
for (Map.Entry<String, String> entry : imageToAccessibilityLabelMappings.entrySet()) {
UIImage image = UIImage.getImage(entry.getKey());
image.setAccessibilityLabel(entry.getValue());
customSegmentsSegmentedControl.setImage(image, i);
i++;
}
customSegmentsSegmentedControl.setSelectedSegment(0);
customSegmentsSegmentedControl.addOnValueChangedListener(this);
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:AAPLSegmentedControlViewController.java
示例20: getCellForRow
import org.robovm.apple.uikit.UIImage; //导入依赖的package包/类
@Override
public UITableViewCell getCellForRow(UITableView uiTableView, NSIndexPath nsIndexPath) {
TopicCell cell = (TopicCell) uiTableView.dequeueReusableCell("cell");
Topic topic = topics.get(nsIndexPath.getRow());
cell.text.setText(topic.getDisplayText());
cell.icon.setImage(null);
if (topic.icon != null && topic.icon.url != null && !topic.icon.url.isEmpty()) {
NSURLSession.getSharedSession().newDataTask(new NSURL(topic.icon.url), (data, response, error) -> {
DispatchQueue.getMainQueue().async(() -> {
cell.icon.setContentMode(UIViewContentMode.ScaleAspectFill);
cell.icon.setImage(new UIImage(data));
});
}).resume();
}
return cell;
}
开发者ID:robovm,项目名称:robovm-samples,代码行数:19,代码来源:AnswerMeViewController.java
注:本文中的org.robovm.apple.uikit.UIImage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论