本文整理匯總了Java中net.coobird.thumbnailator.geometry.Size類的典型用法代碼示例。如果您正苦於以下問題:Java Size類的具體用法?Java Size怎麽用?Java Size使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Size類屬於net.coobird.thumbnailator.geometry包,在下文中一共展示了Size類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sourceRegion
import net.coobird.thumbnailator.geometry.Size; //導入依賴的package包/類
/**
* Specifies the source region from which the thumbnail is to be
* created from.
* <p>
* Calling this method multiple times will result in an
* {@link IllegalStateException} to be thrown.
*
* @param position Position of the source region.
* @param size Size of the source region.
* @return Reference to this object.
* @throws NullPointerException If the position and/or size is
* {@code null}.
* @since 0.3.4
*/
public Builder<T> sourceRegion(Position position, Size size)
{
if (position == null)
{
throw new NullPointerException("Position cannot be null.");
}
if (size == null)
{
throw new NullPointerException("Size cannot be null.");
}
return sourceRegion(new Region(position, size));
}