Rudi_ Member Licensed User Longtime User Feb 1, 2014 #1 Ich habe ein ImageView das ich über das Animationsobjekt um 45° drehen will, das klappt auch soweit, allerdings am Ende der Animation dreht sich das ganze wieder zurück, ich will aber das es in der Endposition stehen bleibt. Im Englischen Forum hat Erel gepostet, daß man das von Hand über das AnimationEnd Event regeln muß, also habe ich in diesem Event dafür gesorgt, daß das Bild des ImageView's am Ende der Animation gewechselt wird auf eine bild das der Endposition entspricht, aber selbst diese neue Bild dreht sich wieder zurück - was ist da zu tun ??? Grüße Rudi
Ich habe ein ImageView das ich über das Animationsobjekt um 45° drehen will, das klappt auch soweit, allerdings am Ende der Animation dreht sich das ganze wieder zurück, ich will aber das es in der Endposition stehen bleibt. Im Englischen Forum hat Erel gepostet, daß man das von Hand über das AnimationEnd Event regeln muß, also habe ich in diesem Event dafür gesorgt, daß das Bild des ImageView's am Ende der Animation gewechselt wird auf eine bild das der Endposition entspricht, aber selbst diese neue Bild dreht sich wieder zurück - was ist da zu tun ??? Grüße Rudi
LucaMs Expert Licensed User Longtime User Feb 2, 2014 #2 You can create an image rotated 45 degrees and use it at the end of the animation (or use a Canvas to rotate it). Sie erstellen ein Bild um 45 Grad gedreht und verwenden Sie es am Ende der Animation (oder verwenden Sie die Leinwand, um sie zu drehen) (Ich spreche nur wenig Englisch, aber ... Deutsch schlimmer ) Code: Copy Dim MyImageView As ImageView Dim anim As Animation anim.InitializeRotate("MyAnimEventName", 0, 45) anim.Start(MyImageView) Sub MyAnimEventName_AnimationEnd MyImageView.Bitmap = LoadBitmap(File.DirAssets, "MyRotated45image.png") End Sub
You can create an image rotated 45 degrees and use it at the end of the animation (or use a Canvas to rotate it). Sie erstellen ein Bild um 45 Grad gedreht und verwenden Sie es am Ende der Animation (oder verwenden Sie die Leinwand, um sie zu drehen) (Ich spreche nur wenig Englisch, aber ... Deutsch schlimmer ) Code: Copy Dim MyImageView As ImageView Dim anim As Animation anim.InitializeRotate("MyAnimEventName", 0, 45) anim.Start(MyImageView) Sub MyAnimEventName_AnimationEnd MyImageView.Bitmap = LoadBitmap(File.DirAssets, "MyRotated45image.png") End Sub
Rudi_ Member Licensed User Longtime User Feb 2, 2014 #3 Wie ich oben schon gesagt habe, ich habe den entsprechenden Beitrag im Forum von Erel gelesesen und habe es genau so gemacht aber trotzdem funktioniert es so nicht siehe unten
Wie ich oben schon gesagt habe, ich habe den entsprechenden Beitrag im Forum von Erel gelesesen und habe es genau so gemacht aber trotzdem funktioniert es so nicht siehe unten
LucaMs Expert Licensed User Longtime User Feb 2, 2014 #4 Wenn Sie auf dem Laufenden war der Code besser gewesen wäre (sie sind nicht zwei Animationen?) Doch in "Some_AnimationEnd" Sie sollten das endgültige Bild gesetzt: If you had posted the code would have been better (they are not two animations?) However, in "Some_AnimationEnd" you should set the final image
Wenn Sie auf dem Laufenden war der Code besser gewesen wäre (sie sind nicht zwei Animationen?) Doch in "Some_AnimationEnd" Sie sollten das endgültige Bild gesetzt: If you had posted the code would have been better (they are not two animations?) However, in "Some_AnimationEnd" you should set the final image
Rudi_ Member Licensed User Longtime User Feb 2, 2014 #5 Code: Copy Sub change_AnimationEnd ImageView1.SetBackgroundImage(LoadBitmap(File.DirAssets,"treppe.png")) End Sub @LucaMs That's why i made the video with the code in the background, as you can see, there is a "change_AnimationEnd" event within i have only one line of code, that would change the image. Anyhow, as you can see the image turns back
Code: Copy Sub change_AnimationEnd ImageView1.SetBackgroundImage(LoadBitmap(File.DirAssets,"treppe.png")) End Sub @LucaMs That's why i made the video with the code in the background, as you can see, there is a "change_AnimationEnd" event within i have only one line of code, that would change the image. Anyhow, as you can see the image turns back
LucaMs Expert Licensed User Longtime User Feb 2, 2014 #6 I have seen but I do not know "treppe.png" . This works but it has a flicker at the end; try to avoid it. Attachments LMRotate.zip LMRotate.zip 9.7 KB · Views: 568
I have seen but I do not know "treppe.png" . This works but it has a flicker at the end; try to avoid it.
Rudi_ Member Licensed User Longtime User Feb 2, 2014 #7 i know, treppe.png is a completly different image it is not the image that should be at the end, i've choosen this for better understanding what happens the original image is another one Last edited: Feb 2, 2014
i know, treppe.png is a completly different image it is not the image that should be at the end, i've choosen this for better understanding what happens the original image is another one