realbasic-nug.fr
[Top] [All Lists]

Re: Imprimer sous tous les angles ...

To: REALbasic NUG French <realbasic-nug dot fr at lists dot realsoftware dot com>
Subject: Re: Imprimer sous tous les angles ...
From: antoine cretaux <antoine at cretaux dot com>
Date: Fri, 8 Dec 2006 14:09:33 +0100
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug dot fr at lists dot realsoftware dot com
References: <75600F84-2168-4C1C-951F-007F8EE47C03 at wanadoo dot fr> <2F15CA2D-9224-4013-A252-5B4CFF3A6090 at cretaux dot com> <A79D3772-13FC-4A28-A451-D8F37735CFF5 at wanadoo dot fr>
voiloa la procedure avec ses parametres

Avec cela tu peux tout modifier: la police,la taille, la couleur, le rayon du cercle ....


  //=====================
  // Parametre à passer à la fonction
  //====================
//=== Extends g as graphics, S as String, x as integer, y as integer, ray as double, centerAngle as double, ClockWise as Boolean
  //== =======================

  Dim w, h as integer, alpha, hcw as double
  Dim i,n,sens,lo1,lo2 as integer
  Dim char as New StringShape, c as String

  w = g.StringWidth(S)
  h = g.StringHeight(S,w+50)
  sens = 1
  if not ClockWise then sens = -1
  alpha = sens*(centerAngle - w / (2*ray))
  n = len(S)

  char.Bold = g.Bold
  char.Italic = g.Italic
  char.Underline = g.Underline
  char.TextFont = g.TextFont
  char.TextSize = g.TextSize
  char.fillColor = Couleurs
  For i = 1 to n
    char.Text = mid(S,i,1)
    hcw = g.StringWidth(char.Text ) / (2*ray)
    alpha = alpha + hcw*sens
    char.Rotation = alpha
    lo1 =x+ray*sin(alpha)*sens
    Lo2 =  y-ray*cos(alpha)*sens
    g.DrawObject char, x+ray*sin(alpha)*sens, y-ray*cos(alpha)*sens
    alpha = alpha + hcw*sens
  Next

<Prev in Thread] Current Thread [Next in Thread>