-void NPatchVisual::SetImage( const std::string& imageUrl, bool borderOnly )
-{
- bool oldBorderOnly = mBorderOnly;
- size_t oldGridX = mStretchPixelsX.Size();
- size_t oldGridY = mStretchPixelsY.Size();
-
- mBorderOnly = borderOnly;
- mImage.Reset();
- if( mImageUrl == imageUrl )
- {
- return;
- }
-
- mImageUrl = imageUrl;
- if( mImpl->mRenderer )
- {
- NinePatchImage nPatch = NinePatchImage::New( mImageUrl );
- InitializeFromImage( nPatch );
-
- ChangeRenderer( oldBorderOnly, oldGridX, oldGridY );
-
- if( mCroppedImage )
- {
- ApplyImageToSampler();
- }
- }
-}
-
-void NPatchVisual::SetImage( NinePatchImage image, bool borderOnly )
-{
- bool oldBorderOnly = mBorderOnly;
- size_t oldGridX = mStretchPixelsX.Size();
- size_t oldGridY = mStretchPixelsY.Size();
-
- mBorderOnly = borderOnly;
- mImageUrl.empty();
- if( mImage == image )
- {
- return;
- }
-
- mImage = image;
- if( mImpl->mRenderer )
- {
- InitializeFromImage( mImage );
- ChangeRenderer( oldBorderOnly, oldGridX, oldGridY );
-
- if( mCroppedImage )
- {
- ApplyImageToSampler();
- }
- }
-}
-