JavaFX Capture Screen without ImageView in it - java

I'm trying to take a screenshot with Robot and view it in an ImageView, The problem is the screenshot coordinates is the ImageView Global coordinates.
So basically I'm trying to capture what's behind the Imageview but instead I get a picture of the Imageview itself.
I can't minimize because I'm taking several continuous screenshots that may vary in resolution.
What can I do?

Related

Android GIF transparent background disappears

I'm new to Android Java programming. For a project I need transparent images, which change dynamically. I have created a layout with an ImageView. And in it a small GIF USA flag GIF with a transparent background.
In code I connect the variable to the imageview and assign the same image to the variable from the ImageResources
ImageView image = (ImageView)convertView.findViewById(R.id.listview_image);
image.setImageResource(R.drawable.vlag);
This goes pretty well however the image is displayed with a white background. The transparency is lost. This is shown in the image below by the white background.
GIF over ImageView are always an issue. Use GIFImageView
And you must use it this way:
gifImageView = (GifImageView) findViewById(R.id.gifImageView);
gifImageView.setBytes(bytes);
gifImageView.startAnimation();
Even it has an option to download the gif from the web.

Resizing bitmap image within imageview

I have an imageview that displays a photo taken with the phone's camera, which can be changed by the user. The problem I'm having is that the picture is scaling too small within the imageview, is there a way to force the bitmap to fit the imageview completely?
Next time, please search a few minutes, before you ask a question!
In the layout xml-file you have to add the following attributes to your ImageView to make it fill out the view:
android:scaleType="fitCenter"
You can find the attribute in the ImageView documentation's list of XML Attributes. The different scaleTypes can then be found by clicking "android:scaleType" to get to its description.

How can I set a control behind another control in Android?

I'm New in Android World
I have an activity which preview images by imageview and the image view take a fill parent and fill all the screen, I want when i click the image view show for example a seekbar on the top of the image without reducing the image size .
note the seek bar already invisible and i show it correctly
but i want it show on the image view itself without reduce the image height.
thanks

Image that has multi clickable zones/surface/area

I want to have an image on the android screen where different parts of the image can be clickable. What I mean is that, If its an image of 3 circles, I want to be able to click each of these circles,
Then I can add different functionalities to each of these clickable circles.
For an instance in this image below I want to be able to click each distinct color. Is it possible to have on-touch-listener and get you the color ? and can it be an image or has to be drawn in Java OR XML ?
I found a really good widget that helps you make any image muli-clickable. They have some good notes on how to use their widget as well.
The widget has a similar approach as Image mapping in html. The good thing about this widget is that the image can be zoomed and it will not lose the coordinates or areas associated to specific clicks.
Here is the link to their website. the guy who made the widget apparently had similar problem and came up with this widget.
Another solution would have been
creating an ImageView containing the png file referenced
making the whole ImageView clickable
setting an OnTouchListener to the ImageView which overrides the onTouch method
check the colors of the image pixel at the touch position
This is often done with an invisible mask image with one color for each zone (see the popular detailed tutorial), but here the image itself has distinct colors for each zone which makes it more interesting.

How to scale with ImageView?

Does it call scale? I need to use the zoomable function as what we do in browser with two finger. It seem zoom controls restricts alot on ImageView though. My images are in drawable, so i assume calling them through (R.drawable.myimage);
and btw im displaying my image with .setContentView(R.layout.myxml);

Categories

Resources