locked
Image in UserControl

    Question

  • I have a User Control which has N number of images. It works fine until I perform Plan projection about 180.00 degree. It start ok but when it is between 45 degree to 135 degree all the images disappear, which looks ugly. It again shows images 135 degree to 180 just fine.

    It is a strange problem. What I have to do? Your help will be very much appreciated.

     

    Agha Khan

    Sunday, May 11, 2014 11:11 PM

Answers

  • Thanks for your sample, I can download it.

    If I modify the RotationX to RotationY, everything is fine.  

     //"(Projection).(RotationX)"
     "(Projection).(RotationY)"


    And I set a cache for the rotation target, now everything is ok

            <local:GameControl x:Name="MyGameCtrl" Height="600" Canvas.Left="200" Canvas.Top="100" CacheMode="BitmapCache">
                <local:GameControl.Projection>
                    <PlaneProjection CenterOfRotationY="0.5" RotationX="100"/>
                </local:GameControl.Projection>
            </local:GameControl>

    Without setting the Cache, probably it could be a bug(?), but I may need confirm with senior engineers.

    At least you have a workaround here.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Agha Tuesday, May 13, 2014 1:58 PM
    Tuesday, May 13, 2014 7:07 AM
    Moderator

All replies

  • Hi Agha Khan,

    Thanks for your feedback, seems to be a performance issue. I can hardly tell why without seeing the code or the app.

    I would like invite you to provide a demo for some test, you could share with us by OneDrive.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, May 12, 2014 1:47 AM
    Moderator
  • I have created new sample application and uploaded to skyDrive, but without your email I am unable to share the sample code. Please send me your email to agha.khan@Hotmail.com 

    Agha Khan

    Tuesday, May 13, 2014 12:18 AM
  • Hi Agha,

    Could you please generate a public share address and paste that link here? More community members could also jump in and give you some solution. Why not?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Tuesday, May 13, 2014 1:35 AM
    Moderator
  • https://onedrive.live.com/redir?resid=ED95A04E7576C8D8%219273

    There are two samples (basically same sample).

    1. ImageRotation (image disappears while rotating an image (angle 45 degree to 135 degree)

    2. Writeable image (why Bad output)

    Best regards

    Agha Khan


    Agha Khan

    Tuesday, May 13, 2014 2:04 AM
  • Thanks for your sample, I can download it.

    If I modify the RotationX to RotationY, everything is fine.  

     //"(Projection).(RotationX)"
     "(Projection).(RotationY)"


    And I set a cache for the rotation target, now everything is ok

            <local:GameControl x:Name="MyGameCtrl" Height="600" Canvas.Left="200" Canvas.Top="100" CacheMode="BitmapCache">
                <local:GameControl.Projection>
                    <PlaneProjection CenterOfRotationY="0.5" RotationX="100"/>
                </local:GameControl.Projection>
            </local:GameControl>

    Without setting the Cache, probably it could be a bug(?), but I may need confirm with senior engineers.

    At least you have a workaround here.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Agha Tuesday, May 13, 2014 1:58 PM
    Tuesday, May 13, 2014 7:07 AM
    Moderator
  • Even you have resolved the problem (disappearing images) but the behavior of rotation is NOT correct. If your eyes of just next to plan then during rotation right and left side of the image/control equally expand and giving illusion of 3D rotation. I just realized right side the plan expands more than left side of the plan. (In real sense left side might not be expanding at all and I might be wrong or expand very little).

    Please look the picture you provided. Right side is expanded more than left side or left side didn't expand at all.  

    Kindly please look this problem again.

    Regards

      

    Agha Khan


    • Edited by Agha Tuesday, May 13, 2014 3:38 PM Picture information
    Tuesday, May 13, 2014 3:35 PM
  • Well, easy, set the width as 600 should fix the problem.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, May 14, 2014 6:31 AM
    Moderator