Bonjour à vous,
 
> J'essaye de retrouver le comportement de l'action du bouton Rogner de la
> barre d'Image avec :
> 
> Sub Main
> Dim img As Object, crop As Object
> 
>  img = FindImage("ImageTest")
> 
>  If Not isNull(img) Then
>    crop = img.GraphicCrop
>    crop.Right = -50
>    img.GraphicCrop = crop
>  End If
> End Sub


Ca fonctionne, il faut juste redimensionner en plus l'image  ;-)


 Sub Main
 Dim img As Object, crop As Object
 Dim Taille As New com.sun.star.awt.Size

  img = FindImage("ImageTest")
 
  If Not isNull(img) Then
    'Rognure
    crop = img.GraphicCrop
    crop.Right = 1000
    img.GraphicCrop = crop
    
    'Redimensionne
    Taille.Width = img.Size.Width - 1000
    Taille.Height = img.Size.Height
    img.setSize(Taille)

  End If
End Sub





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Répondre à