本文整理汇总了Java中com.vk.sdk.api.photo.VKUploadImage类的典型用法代码示例。如果您正苦于以下问题:Java VKUploadImage类的具体用法?Java VKUploadImage怎么用?Java VKUploadImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VKUploadImage类属于com.vk.sdk.api.photo包,在下文中一共展示了VKUploadImage类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getAttachmentImages
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
private VKUploadImage[] getAttachmentImages( FREArray attachmentImages ) {
if( attachmentImages == null ) return null;
try {
long length = attachmentImages.getLength();
VKUploadImage[] result = new VKUploadImage[(int)length];
for( int i = 0; i < length; i++ ) {
FREBitmapData bmpData = (FREBitmapData) attachmentImages.getObjectAt( i );
Bitmap bitmap = BitmapDataUtils.getBitmap( bmpData );
result[i] = new VKUploadImage( bitmap, VKImageParameters.pngImage() );
}
return result;
} catch( Exception e ) {
e.printStackTrace();
AIR.log( "Error parsing attachment images: " + e.getLocalizedMessage() );
return null;
}
}
开发者ID:marpies,项目名称:vk-ane,代码行数:19,代码来源:ShareFunction.java
示例2: share
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
private boolean share(final String url, final String comment, final String imageUrl)
{
if(url == null || comment == null) return false;
new AsyncTask<String, Void, String>() {
private Bitmap image = null;
@Override protected String doInBackground(String... args) {
if(imageUrl != null)
image = getBitmapFromURL(imageUrl);
return "";
}
@Override protected void onPostExecute(String result) {
VKShareDialog vsh = new VKShareDialog()
.setText(comment)
.setAttachmentLink("", url)
.setShareDialogListener(new VKShareDialog.VKShareDialogListener() {
public void onVkShareComplete(int postId) {
Log.i(TAG, "VK sharing complete");
}
public void onVkShareCancel() {
Log.i(TAG, "VK sharing cancelled");
}
public void onVkShareError(VKError err) {
Log.e(TAG, err.toString());
}
});
if(image != null) {
vsh.setAttachmentImages(new VKUploadImage[]{
new VKUploadImage(image, VKImageParameters.pngImage())
});
}
vsh.show(getActivity().getFragmentManager().beginTransaction(), "VK_SHARE_DIALOG");
}
}.execute();
savedUrl = null;
savedComment = null;
savedImageUrl = null;
return true;
}
开发者ID:DrMoriarty,项目名称:cordova-social-vk,代码行数:41,代码来源:SocialVk.java
示例3: photos_saveWallPhoto
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
private boolean photos_saveWallPhoto(String imageBase64, int user_id, int group_id, CallbackContext context) {
try {
VKRequest req = VKApi.uploadWallPhotoRequest(new VKUploadImage(Base64ToBitmap(imageBase64), VKImageParameters.pngImage()), user_id, group_id);
performRequest(req, context);
return true;
} catch(Exception ex) {
return false;
}
}
开发者ID:DrMoriarty,项目名称:cordova-social-vk,代码行数:10,代码来源:SocialVk.java
示例4: photos_save
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
private boolean photos_save(String imageBase64, int album_id, int group_id, CallbackContext context) {
try {
VKRequest req = VKApi.uploadAlbumPhotoRequest(new VKUploadImage(Base64ToBitmap(imageBase64), VKImageParameters.pngImage()), album_id, group_id);
performRequest(req, context);
return true;
} catch(Exception ex) {
return false;
}
}
开发者ID:DrMoriarty,项目名称:cordova-social-vk,代码行数:10,代码来源:SocialVk.java
示例5: VKUploadMessagesPhotoRequest
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
public VKUploadMessagesPhotoRequest(VKUploadImage image) {
super();
mImages = new File[]{image.getTmpFile()};
}
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:5,代码来源:VKUploadMessagesPhotoRequest.java
示例6: setAttachmentImages
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
public void setAttachmentImages(VKUploadImage[] images) {
mAttachmentImages = images;
}
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:4,代码来源:VKShareDialogDelegate.java
示例7: uploadWallPhotoRequest
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
/**
* Upload a specified file to VK servers for posting on user or group wall
* @param image Special image object to upload
* @param userId User wall id or 0
* @param groupId Group id or 0
* @return Prepared vk request for photo upload
*/
public static VKRequest uploadWallPhotoRequest(VKUploadImage image, long userId, int groupId) {
return new VKUploadWallPhotoRequest(image, userId, groupId);
}
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:11,代码来源:VKApi.java
示例8: uploadAlbumPhotoRequest
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
/**
* Upload a specified file to VK servers and saves it into the album
* @param image Special image object to upload
* @param albumId Album id to upload. Must be specified
* @param groupId Group id or 0
* @return Prepared vk request for photo upload
*/
public static VKRequest uploadAlbumPhotoRequest(VKUploadImage image, long albumId, int groupId) {
return new VKUploadAlbumPhotoRequest(image, albumId, groupId);
}
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:11,代码来源:VKApi.java
示例9: uploadMessagesPhotoRequest
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
/**
* Upload a specified file to VK servers for use as an attachment to a message
* @param image Special image object to upload
* @return Prepared vk request for photo upload
*/
public static VKRequest uploadMessagesPhotoRequest(VKUploadImage image) {
return new VKUploadMessagesPhotoRequest(image);
}
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:9,代码来源:VKApi.java
示例10: setAttachmentImages
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
/**
* Sets images that will be uploaded with post
*
* @param images array of VKUploadImage objects with image data and upload parameters
* @return Returns this dialog for chaining
*/
public VKShareDialogBuilder setAttachmentImages(VKUploadImage[] images) {
this.attachmentImages = images;
return this;
}
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:11,代码来源:VKShareDialogBuilder.java
示例11: setAttachmentImages
import com.vk.sdk.api.photo.VKUploadImage; //导入依赖的package包/类
/**
* Sets images that will be uploaded with post
*
* @param images array of VKUploadImage objects with image data and upload parameters
* @return Returns this dialog for chaining
*/
public VKShareDialog setAttachmentImages(VKUploadImage[] images) {
mDelegate.setAttachmentImages(images);
return this;
}
开发者ID:DESTROYED,项目名称:The_busy_calendar,代码行数:11,代码来源:VKShareDialog.java
注:本文中的com.vk.sdk.api.photo.VKUploadImage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论