How do I show an image in main stage after calling push()? - galleria

I am trying to use Galleria where I am dynamically inserting images by calling the push() API. That part is working just great when it comes to pushing a new image in the carousel. However, what I want to do is as soon as I push a new image, I would like to load that image in the main stage to display the large version. I can't figure out how to do that and am hoping someone here can help.
Here is what I have tried so far. I thought after pushing a new image I can call the getDataLength(). This would potentially return either original length or (original length + 1) if it accounted for the new pushed image. getDataLength() returns the original length. So I tried to use show(original length + 1) hoping that would load the new image. However, this simply revolves around and shows the first image in the carousel instead of loading the last newly pushed image.
Any help would be greatly appreciated.
Thanks.

Related

Add markers to image similar to what the mapping apps do - Xamarin.Forms

I am currently using Xamarin.Forms and I would like to import an image and be able to add markers to it. Similar to what the mapping apps do, but want to be able to do it from an uploaded image or from taking a photo. I would also Like to be able to set a scale on it after the image was uploaded by placing two or more markers and then entering a measurement between those markers.
When displaying an image/photo I would like to place markers on them that would have more info about the pinned location on the image. These pins must be saved in a database so that the next time it's opened the markers will be in the correct location as they were placed the first time.
If anyone knows how I can get started on this, or know of any libraries that allow you to this, it would really be appreciated.
.
Update
Loading the image from file, camera or url is simple enough.
Zooming in and out after the image is loaded was simple enough too. Altering the scale size of the Image by making use of the PinchGesture.
Moving the image around ended up being simple too, and it was achieved by using the PanGesture and altering the TranslationX and TranslationY.
.
.......Still searching for a working and reliable solution for adding Pins/Markers at a location on the image and the markers need to have a click or tap event attached to it.

Check if an image contains another image

Im trying to check if a screenshot contains an image that is saved in the project resources, I need to find a 100% match only and would like to not use any extra libraries, now with that being said, I have no idea how to do so.
heres a few questions:,
do I compare the two buffered images together? do I change them into something else?
Il have to compare it atleast once a second or so. (just as general information)
I have a resource folder under my project in eclipse and the .png files are shown as text, is there a way to change that? I tried tinkering with the settings, no luck yet.
public static BufferedImage screenshot(){
BufferedImage capture = robot.createScreenCapture(screenSize);
return capture;
}
this is my screenshot, another bufferedimage is for example "compare", where the size of the compared image is smaller than the screenshot. how will I be able to check if the image contain the second image?
*For those who wondering, im trying to make a simple program that clicks a certain image once it pops up.

Wordpress upload image size

Kinda new to wordpress.. Creating my own theme. When I upload an image and put it in a post it comes out at 300x183 pixels but the original file I upload is 1800x1100 pixels. Wordpress alters my size when i upload it.This is what i get in the url on the post NDAppleProductMockUp-300x183.jpg.. It restricts the size of the image. When i go into the image properties within the post and click original nothing happens it stays at 300x183.. I have tried to work it out but can't Any suggestions guys..
Thanks
Unfortunately, WordPress does not resize the actual image that you upload. It creates 3 smaller versions of it, leaving the uploaded image untouched. I would suggest that you create all of your images at 1800x1100 before you upload them.
Another solution would be to link to the "big-sized" image when you "Insert into Post"... unfortunately, you would have to know the filename of the large image. I check the source code and this part of the media system does not appear to be pluggable.
Another option may be to check out this plugin:
http://wordpress.org/extend/plugins/nextgen-gallery/
This link here details how You can change what image size will be displayed
http://codex.wordpress.org/Function_Reference/add_image_size
also when u attach to post you can set the image size in the setting
THE SETTING is Before you attach the image!
you are trying to change an image that has already been attached (the attached image was in a mid or small size to begin with) so it is already at its original size.

Rotating the image of a picturebox that only has an ImageLocation

I have a card game program that when a card gets discarded and is found to be a certain type of card, it goes into my DefeatedChars pile, which is just a PictureBox named DefeatedChars. Currently all my images are loaded during runtime using ImageLocation which is the string of some website that stores all the card images. I want to know how to load this string to the PictureBox's Image property so I can rotate it because trying to rotate gives me a null pointer exception because Image is nothing, at least I think that's why. I do know through debugging that when DefeatedChars.Image is nothing. My question is, is there a way to rotate the ImageLocation after it's been loaded or is there a way to move the image found at the ImageLocation into the image property. Ultimately, when I'm done with the game, I want the image found at the image location to be stored somewhere locally so that if the website changes, which it does, the cards will retain their images and properties, but that's a question for later down the road. Here is the code I am stuck at that gives me a null pointer exception. I'm coding in Visual Studio.
DefeatedChars.ImageLocation = tempCard.ImageLocation
DefeatedChars.Image.RotateFlip(RotateFlipType.Rotate270FlipNone)
I tried this...
DefeatedChars.Image = Image.FromFile(tempCard.ImageLocation)
But I ran into a "URI formats are not supported error". Then I found this little gem on the internet, which replaces the first line of code above.
DefeatedChars.Image = Image.FromStream(System.Net.HttpWebRequest.Create(tempCard.ImageLocation).GetResponse().GetResponseStream())
It turns the URL into a stream so it can be used by the Image property and it works like a charm.

Using opencv in Win32 application for image show

Is it possible to output images so that they all will be inside a single window?
Before, I used to output data using only opencv functions:
cvNamedWindow("Image 1");
cvShowImage("Image 1", img);
So I change image, then call: cvShowImage function and so on.
But If I want to look at more than one image, then every new image needs its own window to be shown there And what I want is to put every such an output opencv's window inside one big main window.
Is it possible to do it? And how?
You will have to construct a new image and place each img into it. I don't think there's a builtin function like MATLAB's subplot. I recommend using the ROI functions to quickly copy an image into a region-of-interest (ROI) of the big image (which holds the others).
You can show as many images as you want on a single window using hconcat function.
Let us suppose your original image was
Mat frame;
Now clone or make a copy of this image using
Mat frame1 = frame.clone();//or
Mat frame2;
frame.copyTo(frame1);
Now let us suppose your output images are
Mat img1,img2,img3,img4;
Now if you want to show images horizontally, use
hconcat(img1,img2,frame1)//hconcat(input_image1,input_image2,destination_image);
And if you want to show images vertically, use
frame2.push_back(img1);//main_image.push_back(image_to_be_shown_below);
This process processess images one at a time, so if you want to show 4 images side by side, you have to call this function 4 times as in
hconcat(img1,img2,frame1);
hconcat(frame1,img3,frame1);
hconcat(frame1,img4,frame1);
imshow("Final Image",frame1);
NOTE:
Clone process is done because the images have to be of same size.
Enjoy...

Resources