本文整理匯總了C#中Bitmap.copy方法的典型用法代碼示例。如果您正苦於以下問題:C# Bitmap.copy方法的具體用法?C# Bitmap.copy怎麽用?C# Bitmap.copy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Bitmap
的用法示例。
在下文中一共展示了Bitmap.copy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: onActivityResult
protected internal override void onActivityResult(int requestCode, int resultCode, Intent data)
{
base.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK)
{
if (data == null)
{
return;
}
if (requestCode == REQUEST_CODE_SELECT_IMAGE_BACKGROUND)
{
Uri imageFileUri = data.Data;
string strBackgroundImagePath = AnimationUtils.getRealPathFromURI(this, imageFileUri);
// Check Valid Image File
if (!AnimationUtils.isValidImagePath(strBackgroundImagePath))
{
Toast.makeText(this, "Invalid image path or web image", Toast.LENGTH_LONG).show();
return;
}
// Set background image on the image view
bmBackgroundBitmap = AnimationUtils.getSafeResizingBitmap(strBackgroundImagePath, mBackgroudnImageView.Width / 2, mBackgroudnImageView.Height / 2);
if (bmBackgroundBitmap != null)
{
// mBackgroudnImageView.setImageBitmap(bmBackgroundBitmap);
bmFilteredBitmap = bmBackgroundBitmap.copy(Bitmap.Config.ARGB_8888, true);
if (mImageOperation != SifImageFilter.FILTER_ORIGINAL)
{
bmFilteredBitmap = SifImageFilter.filterImageCopy(bmBackgroundBitmap, mImageOperation, mImageOperationLevel);
if (bmFilteredBitmap != null)
{
mBackgroudnImageView.ImageBitmap = bmFilteredBitmap;
}
else
{
Toast.makeText(mContext, "Fail to apply image filter", Toast.LENGTH_LONG).show();
}
}
if (bmFilteredBitmap != null)
{
bmFilteredBitmap = bmFilteredBitmap.copy(Bitmap.Config.ARGB_8888, false);
SifImageFilter.setImageTransparency(bmFilteredBitmap, mTransparency);
mBackgroudnImageView.ImageBitmap = bmFilteredBitmap;
}
// reset the transparency
mTransparency = 0;
}
else
{
Toast.makeText(mContext, "Fail to set Background Image Path.", Toast.LENGTH_LONG).show();
}
}
}
}