Bind Images To RadMosaicTile - telerik

I am using RadMosaicTile in my windows store application. I want to bind images with it.
I tried this
RadMosaicHubTile tile = new RadMosaicHubTile();
tile.ImageSources.Add("Image1.jpg");
tile.ImageSources.Add("Image2.jpg");
but it is not working. images are not binded.
Can anyone help me?
Thanks.

The have this code sample on the telerik forum - does this work for you?
Collection<object> imageSources = new Collection<object>();
ImageSource image = GetImageFromWeb();
imageSources.Add(image);
RadMosaicHubTile hubTile = new RadMosaicHubTile();
hubTile.CreateImageSource = (source) =>
{
return (ImageSource)source;
};
hubTile.ImageSources = imageSources;

Related

Angular2: ng2-img-cropper does not crop url image

I am using ng2-img-cropper to crop a photo (not avatar).
https://github.com/cstefanache/angular2-img-cropper
I followed the example:
https://embed.plnkr.co/V91mKCNkBQZB5QO2MUP4/
I saw that it seems not to support url image, only local image. Is there anyway to make it work with url image?
If not, is there any alternative which can work with url image?
Thanks for any suggestion.
please check the discussion in the following thread: https://github.com/cstefanache/angular2-img-cropper/issues/110
The idea is to work with something like:
var image:HTMLImageElement = new Image();
this.image.crossOrigin = 'Anonymous';
image.src ='https://www.google.ro/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png';
image.addEventListener('load', (data) => {
this.cropper.setImage(image);
});

Display Binary Image In Webmatrix

Could someone please point me to a tutorial/page that will explain how to view a binary image from a database (or if its simple please tell me)?
I'm using cshtml and can query the database but the image part has got me stumped.
Thank you
I found a way and hope this helps anyone with the same question.
I created a querySingle to return my image binary data in 'var=file'.
I then created the following string variables:
string imageBase64 = Convert.ToBase64String(file.FileContent);
string imageSrc = string.Format("data:image/png;base64,{0}", imageBase64);
*FileContent being my binary data.
And finally created the img:
<img src="#imageSrc" alt="#file.FileName" />
Please up-mark if you find this helpful.
I use this in foto.cshtml Razor
I have fotos and thumbnails in he database. This is for the thumbnails.
#{
// Cache the image for a minute
Response.OutputCache(60);
var fotoId = UrlData[0].AsInt();
var db = Database.Open("albums");
var foto = db.QuerySingle("SELECT * FROM Fotos WHERE Id = #0", fotoId);
if (foto == null){
Response.Redirect("~/");
}
new WebImage(foto.Mini).Write();
//Geef maximale breedte en hoogte aan
//var width = 120;
//var height = 60;
//var image = new WebImage(foto.Mini);
//image.Write();//Or image.Resize(width, height).Write();
}

IsShowingUser not working in Xamarin Forms

i'm developing an app based on maps.
Here my problem is i'm not able to display user location on maps. but i can able to displaying the map's using Xamarin.Forms.
Here is my Code
var map = new Map(
MapSpan.FromCenterAndRadius(
new Position(17.3660, 78.4760), Distance.FromMiles(0.3)))
{
IsShowingUser = true,
HeightRequest = 100,
WidthRequest = 960,
VerticalOptions = LayoutOptions.FillAndExpand
};
var stack = new StackLayout { Spacing = 0 };
stack.Children.Add(map);
Content = stack;
My out put
here i want to display the user current location.
this entire code was return in Xamarin Shared code.
i'm not using Xamarin Android.
can any one help me to solve this problem.
Thanks in advance.
Most platforms require you to request permission to get a users location via GPS.
For Android this is located in the Android Manifest (under project properties). Check both ACCESS_FINE_LOCATION and ACCESS_COURSE_LOCATION.
It's a known bug on Android. It's working fine on iOS.
Here's the link to the bug report on bugzilla.
A possible workaround would be to show a map pin instead for as long as the bug hasn't been fixed. It goes like this:
map.Pins.Add(new Pin { Label = "You are here",
Position = new Position(17.3660, 78.4760) });
UPDATE: This issue has been fixed on Xamarin.Forms.Maps version 1.3.0.6292.

Titanium ImageView wont display images?

I created an image directory in my projects in the UI folder to place my images.
So the full path is currently Resources/UI/Images.
When i create an image view it wont display the images.
I tried different options, even a web image but nothing works?
var self = Ti.UI.createView({
backgroundColor:'white'
});
var imgv = Titanium.UI.createImageView({url:"http://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Volkswagen_Logo.png/600px-Volkswagen_Logo.png"});
self.add(imgv);
var imgv = Titanium.UI.createImageView({url:"../images/sb02.jpg"});
self.add(imgv);
var imgv = Titanium.UI.createImageView({url:"Resources/ui/images/sb03.jpg"});
self.add(imgv);
There is an error in your code. There is no url property for ImageView control. You should use image property. Try the following code
var imgv = Titanium.UI.createImageView({
image:"../images/sb02.jpg"
});
self.add(imgv);
To answer my question thanks to Anand for the tips:
Images should be placed in the Resources dir
Afterwards reference them just by /folder/image.jpg in my case /images/sb1.jpg

Flex 3: Add an Image so that it Floats Above a PopWindow

Is there a way to add an image in my main app, so that it is on top off a popWindow? The equivalent of the Z-index should render it on top.
So, I've got a popWindow and I want to add an image on top of the popWindow.
If in my main app I use:
var floatingImage:Image = new Image;
floatingImage.source = image_path;
floatingImage.y = 200;
floatingImage.x = 200;
addChild(floatingImage);
Then the image is on top of main App, but it is still below my popWindow.
I would add the image directly to the popWindow, but I'm using FlashEff 2, and for some reason the effect won't work if I have an image in the popUp. So, I thought that I would add the image in the main app and have it float above the popWindow.
Another possibility might be to check somehow if the popWindow is open and then add the image directly to the popWindow.
If anyone has any suggestions, I'd love to hear them.
Thank you.
-Laxmidi
Not really recommended but here is the code. This won't work well with UIComponents just DisplayObjects.
[Embed(source="assets/MyImage.png")]
private var MyImage:Class;
protected function button1_clickHandler(event:MouseEvent):void
{
var image:DisplayObject = new MyImage();
stage.addChild(image);
}

Resources