View to imageView
I have a view and I want to convert it to a new imageView.
I am using view.toImage() although this only gives me a blob.
Here is my code:
var win1 = Titanium.UI.createWindow(
{
backgroundColor: '#fff'
});
var view = Ti.UI.createView({
BackgroundColor: "red"
});
win1.add(view.toImage());
This gave me an error that says type mismatch.
Thanks ahead for the help.
2 Answers
-
Found the answer-Thanks!
var image = Ti.UI.createImageView({ image:view.ToImage() }); win1.add(Image());
-
var image = Ti.UI.createImageView({ image:view.ToImage() }); win1.add(image);