Animation in vb with wpf - android

I am working on vb project in visual studio 2015.I need to animate the text "Darkode" from left to right.
I tried the following code which i pulled from the internet,
<Window.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Duration="0:0:.8" Storyboard.TargetProperty="Left" From="1920" To="0" AccelerationRatio=".1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Window.Triggers>
But i didn't understand it Correctly? I need more clarification on the topic.

I had encountered a similar situation where i had to Animate my logo. After searching for hours in the internet i found a solution which was not very useful to me but given your situation (animate a text from left to right) ,it will be more useful to you.
Here is the code :
Private Sub trmText_Timer()
If lblCaption.Caption <> StrCap Then
lblCaption.Caption = Left(StrCap, Len(lblCaption.Caption) + 1)
Else
lblCaption.Caption = ""
End If
End Sub
Here is the source for the code:http://www.setha.info/ict-visualbasic6/72-ict-vb6-0013.html
Here is the link for my qusetion :Animation of words in visual studio
Explanation
Unlike the code you posted in your question which uses storyboard for animation the above code uses Timer control for animation.
In the above code StrCap contains your text darkode and
lblCaption.Caption is an empty string onto which you iterativly put you text charater by charater on each iteration.
Heres a link if you want to know more about timer control :Timer Control

Related

How to take off a PX4 autopilot using mavlink message?

I follow the following link's sample code
http://android.dronekit.io/first_app.html
and when I set API VehicleApi.getApi(this.drone).arm(true);
vehicleState.isFlying() automatically becomes true.
Can anybody tell me what this problem is?
What I need is:
1. take off, land
I read from some website that the dronekit-android does not support the mode changing. If so, how should I send the mavlink message to take off and land?
So far, I can sucessfully send the mavlink message to the PX4 board.
Thanks for replying.
Thank you for replying.
BR
SeanH
If you trace though some of the code in dronekit-android, you can see that isFlying is set here with the code below.
boolean isFlying = systemStatus == MAV_STATE.MAV_STATE_ACTIVE || ...;
MAV_STATE_ACTIVE, defined here states
System is active and might be already airborne. Motors are engaged.
So isFlying doesn't mean it's airborne but just that the motors are turned on. That occurs when you call VehicleApi.getApi(this.drone).arm(true); because you are literally arming the vehicle at that point.
For takeoff, you want to use the ControlApi. ControlApi.getApi(drone).takeOff(desired_altitude, listener) and for land you need to use VehicleApi.getApi(drone).setVehicleMode(VehicleMode.COPTER_LAND, listener)
The sample code you're looking at is very old. I suggest you follow the sample app from github.
I have not tried android-dronekit before and I noticed that the src folder have not been updated for more than two years on github.
I advice you to use python-dronekit because there is a powerful library called pymavlink in python and used in python-dronekit. You can build hyper application if you want but first try to takeoff and land in python.

Taking Screenshots Using Qt C++ on Android

thanks for checking my question out!
I'm currently working on a project using Qt C++, which is designed to be multi-platform. I'm a bit of a newcoming to it, so I've been asked to set up the ability to take screenshots from within the menu structure, and I'm having issues with the Android version of the companion app.
As a quick overview, it's a bit of software that send the content of a host PC's screen to our app, and I've been able to take screenshots on the Windows version just fine, using QScreen and QPixmap, like so:
overlaywindow.cpp
{
QPixmap screenSnapData = screenGrab->currentBackground();
}
screenGrabber.cpp
{
QScreen *screen = QGuiApplication::primaryScreen();
return screen->grabWindow( QApplication::desktop()->winId() );
}
Unfortunately, Android seems to reject QScreen, and with most suggestions from past Google searches suggesting the now-deprecated QPixmap::grab(), I've gotten a little stuck.
What luck I have had is within the code for the menu itself, and QWidget, but that isn't without issue, of course!
QFile doubleCheckFile("/storage/emulated/0/Pictures/Testing/checking.png");
doubleCheckFile.open(QIODevice::ReadWrite);
QPixmap checkingPixmap = QWidget::grab();
checkingPixmap.save(&doubleCheckFile);
doubleCheckFile.close();
This code does take a screenshot, but only of the button strip currently implemented, and not for the whole screen. I've also taken a 'screenshot' of just a white box with the screen's dimensions by using:
QDesktopWidget dw;
QWidget *screen=dw.screen();
QPixmap checkingPixmap = screen->grab();
Would anyone know of whether there was an alternative to using QScreen to take a screenshot in Android, or whether there's a specific way to get it working as compared to Windows? Or would QWidget be the right track? Any help's greatly appreciated!
as i can read in Qt doc : In your screenGrabber.cpp :
QScreen *screen = QGuiApplication::primaryScreen();
return screen->grabWindow( QApplication::desktop()->winId() );
replace with :
QScreen *screen = QGuiApplication::primaryScreen();
return screen->grabWindow( 0 ); // as 0 is the id of main screen
If you want to take a screenshot of your own widget, you can use the method QWidget::render (Qt Doc):
QPixmap pixmap(widget->size());
widget->render(&pixmap);
If you want to take a screenshot of another app/widget than your app, you should use the Android API...

Android drag and return to previous activity like Facebook and Google Photos

I have been finding a way to implement animation like Facebook and Google Photos. When in 2nd Activity, when dragging images the images follow and the 2nd Activity started to fade out and we see 1st Activity. Images of what I was trying to ask is here.
Was you able to find a full fledged solution for this ?
https://github.com/nickbutcher/plaid , It might give clues to entry transition and how that was accomplished . So it might help you there. But how about when you want to drag and dismiss that activity?
https://github.com/Commit451/ElasticDragDismissLayout , Its an interesting library. Does do drags . But doesn't remember the position where the thumbnail where it was launched from. Only handles 1 swipe direction and dismisses by sliding to the right. So its not that close to what they do in 2017 Jun Google Photos Android application. You might have to modify it.
If anyone knows a better solution to this please do share.
I have found some code from Nick Butcher sample code.
ElasticDragDismissFrameLayout.java
and when using it:
chromeFader = new ElasticDragDismissFrameLayout.SystemChromeFader(getWindow()) {
#Override
public void onDragDismissed() {
finishAfterTransition();
}
};

How to find a WebView element in Android using Calabash using TextContent

I have a webview in an ios app that basically has no id or class. (I know, right?)
But it does have a textContent field that I would like to use to select elements.
This is the element I want to find:
{"rect"=>
{"center_x"=>307.5,
"left"=>295,
"bottom"=>136,
"right"=>320,
"top"=>93,
"width"=>25,
"height"=>43,
"center_y"=>178.5},
"nodeName"=>"LI",
"id"=>"",
"textContent"=>"!!! I WANT TO FIND IT BY THIS !!!",
"center"=>{"X"=>307.5, "Y"=>178.5},
"nodeType"=>"ELEMENT_NODE",
"webView"=>
"<UIWebView: 0xe2e1400; frame = (0 0; 320 504); clipsToBounds = YES; autoresize = W+H
"class"=>"arrow",
"html"=>"<div class=\"arrow\"></div>"}
So I was able to find this using css pseudo-selectors alá
query("webView css:'el:first-child'")
I can find it by using the hashes in the results array alá
query("webView css:'li'").select {|element| element["textContent"] == "!!! I WANT TO FIND IT BY THIS !!!}
And I can refactor it a bit to use a regex alá
query("webView css:'li'").select {|element| element["textContent"] =~ /I WANT/}
But all this feels really dirty. Very un-Calabashy. Is there a better way to write this?
I have not tried your exact setup. But I do often use queries with the LIKE comparison on label.
Would that solve your problem?
ex.
element_exists("label {text LIKE 'I WANT TO FIND'}")
I wound up going with this:
query("webView css:'TITLE'{textContent CONTAINS ’I WANT’}")
It tends to work more consistently with these particular webviews (given a lack of accessibility labels in the code).

RepeatingSpriteBackground on MenuScene

I have started using Andengine, and after following some tutorials I'm starting to develope for myself.
Right now I have a a BaseGameActivity where I call one splashScene(working fine) and after that my MenuScene.
If i set a simple background (just color) it loads fine (all menu text are displayed), but when i try to set a repeating sprite as background, a black screen appears (no error show in logcat)
I'm using the example code for the background
super(BaseActivity.getSharedInstance().mCamera);
activity = BaseActivity.getSharedInstance();
RepeatingSpriteBackground mGrassBackground = new RepeatingSpriteBackground(mCamera.getWidth(), mCamera.getHeight(), activity.getTextureManager(), AssetBitmapTextureAtlasSource.create(activity.getAssets(), "images/menu/background.png"), activity.getVertexBufferObjectManager());
this.setBackground(mGrassBackground);
I placed this code in the MenuScene constructor.
Thanks in advance and sorry for my English
I just discover my problem.
The code was right the problem was in the image format, it has to be a power of two (it says that clearly in the source code comments)
Next time I will try to read carefully before asking

Categories

Resources