VB silverlight for windows phone webbrowser - vb.net

i am writing an application for windows phone and i am using a webbrowser
i am navigating to an image , but this image is not full screen and it seems so awfull !
is there any way , either to full the wite with user's background color , or to set a default zoom on a spesific spot ?
thank you !

The webbrowser control is slow, a memory hog and hard to customise.
I think you shouldn't use the web browser for displaying and zooming this image.
Instead, take a look at using a canvas and image control together like in the MultiTouch sample and library - http://www.galasoft.ch/Touch/wp7/ and http://multitouch.codeplex.com/
If you do need to use the webbrowser, then you could try to wrap the image in an HTML page - and you could use a mixture of html, javascript and css (including dynamic javascript called from the host) - that might allow you to achieve some of the customisations you are looking for.

Related

Xamarin: How do I set a placeholder image in my Image element in XAML?

In Android, it is quite easy to set a image placeholder for development purposes in an imageview.
All one would do is use the tools:src for the placeholder image during development so you could see it in your layout design preview and your actual image you would put into your android:src
. Frequently, you don't set the android:src put would populate that imageview with images that you download off the internet once you connect your app to the net:
<ImageView
android:layout_width="28dp"
android:layout_height="28dp"
android:src=#drawable/activated_icon"
tools:src="#mipmap/white_activated_icon" />
In Xamarin, you have this to display images:
<Image Source="http://lorempixel.com/1920/1080/nature/3" />
Once the app connects, the image is downloaded from the internet and displayed. How do I put in a placeholder image for development purposes (similar to the way you would do it through tools:src in android) so I can see it within the layout design previews?
I'm assuming you want to achieve this with Xamarin Forms, as you referring to XAML in the question title.
Or possibly you are referring to the Xamarin Forms Previewer? In that case, disregard the following answer. You can only use local images in the Previewer as far as I can tell.
Answer in case the question is related to runtime Xamarin Forms
There is no standard option to do this in Xamarin Forms. Take a look at this example suggested by Stephane Delcroix from the Xamarin Forums. The important part of this approach is to stack 2 images on top of each other in a grid. 1 is the placeholder that is placed beneath the image that is being loaded, like this:
var grid = new Grid();
grid.RowDefinitions.Add (new RowDefinition());
grid.Children.Add (image);
grid.Children.Add (placeholderImage);
As an alternative option, WebImage of Xamarin Forms Labs allows an option for a DefaultImage, but I'm not sure if that shows immediately. See this class for the code of the Web Image. Keep in mind that Xamarin Forms Labs is no longer under active maintenance.
Of course you can also write a custom renderer. Maybe based on the Xamarin Forms Labs example.
I use FFImageLoading for this Case.
Just install the Nuget Package and Use the "CachedImage" in XAML.
<ff:CachedImage Source="your url" Placeholder="placeholder while loading"/>
You donĀ“t need to download (and cache) the Image manually then. It will automatically displayed when the download is done.
You can use local files (from Resources or Drawable) and files from HTTP/HTTPS.

AS2 fixed sized movieclip

I'm working with a Flash website at the moment, and when clicking on a specific hotspot, it opens up a new .swf over the top. This .swf it opens is styled similar to a Lightbox. It has a (x) to close unLoad the movie, along with a (<) and a (>) to navigate through the images.
The problem being, when adjusting the explorer window, the flash elements scale to the adjusted size, staying in proportion.
What I want is, while it's in the HTML page, is to have only the background flash image to scale, but to have the overlaying 'lightbox' .swf at a fixed width/height, so it never scales according to the size of the user's window.
I've found an example to help with this:
http://newsletters.plainpicture.com/static/newsletters/com/news-1208/index.html
how is your "lightbox" swf implemented? is it an actual html lightbox that acts as a container for an external swf movie? or it's your coded lightbox inside the same swf website movie?
if it is html lightbox then you must provide information about what kind of lightbox it is and perhaps look into the lightbox documentation.
if it's your "lightbox" inside the same flash movie, a possible way to resize a specific part of the same swf but not another is to publish the movie (inside "publish settings", ctrl+12) as non-scalable, and resize only a desired part of your movie manually- via the resize event on the stage listener
var stageListener:Object = new Object ();
Stage.addListener (stageListener);
orig_ratio=Stage.width/Stage.height;
stageListener.onResize = function(){//resized page
something_to_resize_only._height=Stage.height;
something_to_resize_only._width=something_to_resize_only._height*ratio;
//...etc etc... you may include current_ratio/orig_ratio comparison conditions too
}
if you need help with resizing stuff manually, you should create a new question as it is something irrelevant to this question. don't be afraid though, it's not a difficult task and you may even find a lot of tutorials on proportional scaling/resize

How to display a Windows 8 metro style tile within an app?

Windows 8 metro style app tiles are created based on pre-defined xml templates (found here).
Is there any way to hook up to Windows' rendering of the tile to allow a tile preview within an app?
In my app I would like to offer the user a subset of the tile templates listed in the above link and let the user customize the tile content. A live preview of the customized tile rendered within my app would greatly improve the user experience.
you should look into HubTile.
I don't know any free control's right now, but Telerik and Syncfusion have HubTile control
You can't get access to real Windows tile rendering, but you can simulate it since all templates are known. It is very unlikely that Microsoft would change the way tiles are rendered and even if they do you should be able to issue app update to keep up with Microsoft.

WinRt WebView control handling navigation within the control

I have a Metro app using a WebView control. I'm using NavigateToString to load a html file which may contain hyperlinks. What I then want to do is detect when one of these hyperlinks is selected and, instead of allowing navigation within the WebView control, to launch IE and view the page there instead.
Is this possible within the WinRT constraints, and if so, how?
So far, I've tried capturing the WebView_LoadCompleted() event, but although it does fire at the right time, I can't see any details about the URI from the NavigationEventArgs.
Unfortunately this isn't possible directly because WebView does not include events like Navigating (which were present in Windows Phone).
Luckily Nick Randolph (brilliant Windows Phone and Windows 8 developer) has created a workaround using script events. He's got a great write up on his blog:
http://nicksnettravels.builttoroam.com/post/2012/04/21/Limitations-of-the-WebView-in-Windows-8-Metro-Apps.aspx

Embedded video in WinForms (AxShockwaveFlash)

I have uploaded a couple of tutorial videos in youtube.
In my winforms application (by using the AxShockwaveFlash object) i reproduce the selected video by the user.
AxShockwaveFlash1.LoadMovie(http://www.youtube ..video1)
Here comes the story.
The first time the user selects a video, reproduction works like a charm.
When the user selects to see the second video
AxShockwaveFlash1.LoadMovie(http://www.youtube ..video2)
the ShockwaveFlash continues the reproduction of the first selection
Try to use
AxShockwaveFlash1.Stop();
AxShockwaveFlash1.Movie = "Your source";
AxShockwaveFlash1.Play();
Pattern to avoid leaving flash arguments behind.
Without knowing how you have integrated the video in your form, the method I would do is using a webBrowsercontrol in the form and embed the video in the control.
msdn on webBrowsercontrol
I had encountered this problem and resolved it by changing the Embed property of the Ax object control to False.
I embed the videos via the movie URL each time as follows:
http://www.youtube.com/v/targetmovie&feature=player_embedded
Works a treat
Tamir,
the video is embedded. Not stored locally
This is because your application is loading flash player loader from the cache and then it's loading the real player from the site , finally this yield a security exception.
In internet explorer , in internet options set to check for new versions of the documents each time you visit the page.
You first need to extract the FLV file like here:
Getting an FLV from YouTube in .NET