I'm looking for component, that would allow me to show and manipulate single image in a same way as native image browsing in Pictures hub.
I want:
Pinch to zoom image (with top and bottom limits)
Drag to move image around, but I don't want it to get out of bounds of screen. Spongy behavior is optional.
Double tap to toggle between original size and fit-to-screen size.
Does such component exist? Preferably free. If it doesn't, then I need to implement everything myself.
Related
I have some questions about sliders,
Im using a slider and i want a marker to be present on it like:
http://1.bp.blogspot.com/-HDNFnyRU2Cw/TcuMbBaL70I/AAAAAAAAAGc/7eWN1qnZbAw/s1600/seek.JPG
it draws the image at the bottom of the slider, not on top of it, searched for a setThumbImagePosition or something like that ,but didnt find it, is there a way to use sliders with markers on the top of them?(like the image shown)
Is there a way to show divisions on the slider?(for example this)
https://raw.githubusercontent.com/channguyen/range-slider-view/master/screenshots/sc.png
Whats the best practice to create thicker sliders?
Check out this post notice that in order to create the stars effect properly we wrap the slider in a flow layout to prevent it from growing. You can use background images just like we do in the stars slider but you need to place the slider in a flow layout of similar layout that doesn't let it grow beyond its preferred size.
I have an ximage which I want to zoom in on, and display. I'm currently taking the naive approach:
allocate bigger image
use nearest-neighbor interpolation to fill it in.
put the whole image on a pixmap.
Which works, but slowly, and crawls once I approach bigger zoom levels, like 800%. The gimp, however, can zoom in to 3200% and still feel snappy. What's the approach taken here? Should I only fill one screen at a time? But then what about scrolling: wouldn't performing interpolation, and an XPutImage, and an XCopyArea on each expose kill performance?
I'm not expert in Xlib, but in my opinion a good approach would be to draw only the zoomed part, instead of computing the interpolation of the entire image.
For scrolling, if you are looking for performances, you may copy the part of the old zoom which is still visible in the new position, and compute the interpolation of the "discovered" pixels. For example, when scrolling down, you may copy the bottom of the previous image and paste it higher, and then compute/draw the new visible stuff at the bottom.
Most modern X11 applications don't use Xlib directly much, if at all. My guess would be that Gimp is rendering the zoomed image into a buffer itself and drawing that to the window, rather than working with the image in an XImage.
I am developing a navigation menu in silverlight that has 6 images. As you mouseover each image grows and clicking on an image will take you to a page on the website. The customer I am doing this for decided that straight rectangular images were boring and I showed him a design where I have slanted each image so each one is now a rhomboid shape. Horizontal top and bottom with sides slanting about 30deg from vertical.
I have been unable to figure out any way of growing each image on mouseover without putting a white block over the adjacent images. Would be grateful for any pointers.
If your images are PNGs with Transparency, why are you getting white blocks?
Normally the only issue to worry about is Z-order if adjacent options get larger, which you can fix by parenting all the buttons on a canvas and animating the Z-order as well as the scale.
Hope this helps.
In a Silverlight application I have large images which have flow charts on them.
I need to handle the clicks on specific hotspots of the image where the flow chart boxes are.
Since the flow charts will always be different, the information of where the hotspots has to be dynamic, e.g. in a list of coordinates.
I've found article like this one but don't need the detail of e.g. the outline of countries but just simple rectangle and circle areas.
I've also found articles where they talk about overlaying an HTML image map over the silverlight application, but it has to be easier than this.
What is the best way to handle clicks on specific areas of an image in silverlight?
Place the Image and a Canvas in a Grid so that the Canvas overlays the Image.
Add shapes of appropriate sizes and placed as needed to the canvas. All shapes will a transparent fill and no border, hence the user only sees the Image. On the Canvas MouseDown (or Up events) use OriginalSource to determine which shape generated the click. Use the Tag property of each shape to associate it with some object that represents the flowchart element being mapped.
I found an easy way to do this without a canvas:
How to get the coordinates of an image mouse click in the event handler?
I currently have a Silverlight canvas that exceeds the viewable area of the screen (I'm letting the users drag the viewable areas around to navigate). I'm trying to display a modal popup that always shows up in the middle of the viewable area, and I can't seem to find any property that tells me what currently is on the screen. Basically if the user has panned down to the bottom and clicks something that causes a modal popup to appear it is stuck at the far top of the screen.
Any ideas anyone?
Thanks
~Steve
I don't think this is possible since the visibility isn't being surfaced. Perhaps with some fun JavaScript to figure out where the panning is?
Quite true. I wound up creating a holding canvas, making that full screen, and putting everything else as a child canvas within that. The modal popup now comes up in the holding canvas.
Gabriel GuimarĂ£es one works good.
App.Current.Host.Content.ActualHeight(and ActualWidth) does bring the browser size inside. Good for calculating position. And of course you can use LayoutUpdated on your main control to double check the sizes and resize stuff if need be.