Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GdiPlusX - Point Of Rotation
Message
De
28/02/2008 07:16:43
 
 
À
28/02/2008 05:17:05
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
VFPX/Sedna
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01297306
Message ID:
01297312
Vues:
30
Thanks Agnes !


Sergio,

You can also use the "RotateAt" function.
We have a sample that does this, but it rotates in the center, look for "transformations.scx" in the samples folder of GdiPlusX

BTW, the "RotateAt" function does internally exactly what Agnes has suggested, so, both solutions will provide EXACTLY the same results.


Asuming that the image to be rotated is "loImg", and its Graphics associated object is "loGfx":
LOCAL loMatrix AS xfcMatrix
LOCAL loPointF AS xfcPointF

WITH _SCREEN.System.Drawing
	loMatrix = .Drawing2D.Matrix.New()

	loPointF = .PointF.New(0, loImg.Height) && this is the point of rotation
	loMatrix.RotateAt(lnRotationAngle, loPointF)

	loGfx.MultiplyTransform(loMatrix)
	loGfx.DrawImage(loImg)
ENDWITH
Hope this helps

Cesar

>Hi Srdjan,
>
>hm, you have to move the point of rotation using TranslateTransform.
>Something like
>
>*... to the point of rotation
>*old Code
>*.oGfx.RotateTransform(Angle)
>*replaced by
>.oGfx.TranslateTransform(0,distance_top_to_bottom)
>.oGfx.RotateTransform(Angle)
>.oGfx.TranslateTransform(0,-distance_top_to_bottom)
>*/replaced by
>
>
>HTH
>
>Agnes
>>Dear All,
>>
>>I need to change rotation point from top left corner to bottom left corner of rotated picture (or text) rectangle. Most of samples in GdiPlusX use topleft corner as 'nail' point. How do I set it to be bottom left or bottm right etc.
>>
>>TIA
>>Sergio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform