Windows Vista Forums

Image Rotate with C#

  1. #1


    Thomas Mueller Guest

    Image Rotate with C#

    Hi NG,

    how can i change the Rotate- State of an Image in C# Code? If I use the
    following code:

    try
    {

    this.m_TestImage.RenderTransform.Value.RotatePrepend(180);

    // ore:

    this.m_TestImage.RenderTransform.Value.RotateAt(45, 25, 50);
    }
    catch (Exception Ex)
    {
    MessageBox.Show(Ex.ToString());
    }

    the Image change not the Rotation.

    Thank you for all Answers

    TOM_MUE
    www.tom-mue.de




      My System SpecsSystem Spec

  2. #2


    Jason [Mobiform] Guest

    Re: Image Rotate with C#

    the Image change not the Rotation.??

    Maybe you could post an image of the result you are getting and what you
    want to happen?

    Jason

    "Thomas Mueller" <_info@tom-mue.de> wrote in message
    news:eglJ31MUGHA.3192@TK2MSFTNGP09.phx.gbl...
    > Hi NG,
    >
    > how can i change the Rotate- State of an Image in C# Code? If I use the
    > following code:
    >
    > try
    > {
    >
    > this.m_TestImage.RenderTransform.Value.RotatePrepend(180);
    >
    > // ore:
    >
    > this.m_TestImage.RenderTransform.Value.RotateAt(45, 25,
    > 50);
    > }
    > catch (Exception Ex)
    > {
    > MessageBox.Show(Ex.ToString());
    > }
    >
    > the Image change not the Rotation.
    >
    > Thank you for all Answers
    >
    > TOM_MUE
    > www.tom-mue.de
    >
    >
    >




      My System SpecsSystem Spec

  3. #3


    Adam Smith [MS] Guest

    Re: Image Rotate with C#

    The problem here is that .Value returns a one-off Matrix representing the
    current effective transform of the object upon which you're calling .Value.
    It is not a read-write property. (incidentally, even if it were, since
    Value returns a Matrix which is a value type, and since all value types are
    pass by value by default, this wouldn't work in that case either)

    If you control your app to the extent that you can ensure that the value of
    RenderTransform is always a given type of Transform, you can do this like
    so:

    ((RotateTransform)this.m_TestImage.RenderTransform).Angle += 180;

    Or you could use a MatrixTransform and its Matrix property if you want
    general transformations. Remember that you still can't call
    MatrixTransform.Matrix.RotatePrepent(180) directly, since the RotatePrepend
    will operate on the temporary return value of .Matrix.

    -Adam Smith [MS]

    "Jason [Mobiform]" <Jason@mobiform.com> wrote in message
    news:u4BE88cUGHA.5828@TK2MSFTNGP10.phx.gbl...
    > the Image change not the Rotation.??
    >
    > Maybe you could post an image of the result you are getting and what you
    > want to happen?
    >
    > Jason
    >
    > "Thomas Mueller" <_info@tom-mue.de> wrote in message
    > news:eglJ31MUGHA.3192@TK2MSFTNGP09.phx.gbl...
    >> Hi NG,
    >>
    >> how can i change the Rotate- State of an Image in C# Code? If I use the
    >> following code:
    >>
    >> try
    >> {
    >>
    >> this.m_TestImage.RenderTransform.Value.RotatePrepend(180);
    >>
    >> // ore:
    >>
    >> this.m_TestImage.RenderTransform.Value.RotateAt(45, 25,
    >> 50);
    >> }
    >> catch (Exception Ex)
    >> {
    >> MessageBox.Show(Ex.ToString());
    >> }
    >>
    >> the Image change not the Rotation.
    >>
    >> Thank you for all Answers
    >>
    >> TOM_MUE
    >> www.tom-mue.de
    >>
    >>
    >>

    >
    >




      My System SpecsSystem Spec

Image Rotate with C#

Similar Threads
Thread Forum
Trying to rotate my display.
I would like to rotate (Pivot) my extended ViewSonic display. 1: VX2260WM - Primary 2: VP201b - Extended I am running Vista 32-bit with the a...
Graphic cards
ROTATE THE VISTA SCREEN
WHAT IS THE SHORT KEY TO ROTATE THE VISTA SCREEN
Vista General
how to rotate less than 90 degrees?
I want to use WLPG as my exclusive photo editing software but I can't find how to rotate (straighten) a photo less than 90 degrees. Am I missing...
Live Photo Gallery
Rotate picture by degrees
I need to straighten pictures. XP's Picture Manager allowed rotating a picture a degree at a time. I don't see this feature in Vista. Is it there...
Vista music pictures video
Add a button that will allow you to rotate a fax you are veiwing
I often receive faxes that were sent upside down. In the old XP you could click a rotate button and turn it right side up. You can not do this in...
Vista print fax & scan
Does Rotate also mean skew?
I've drawn a Rectangle and filled it with a DrawingBrush, then tried to transform the brush and rotate it by 45 degrees...
Avalon
Rotate Control in C#
I like to rotate a image control by using animation and control in coding. I am using DoubleAnimation and set from and to for the rotation. I have...
Avalon