Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GdiPlusX - Point Of Rotation
Message
From
28/02/2008 07:16:43
 
 
To
28/02/2008 05:17:05
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
VFPX/Sedna
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01297306
Message ID:
01297312
Views:
32
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform