How do i stop the blurring when zooming in on a UIScrollView? - c#

I have been trying to find out how to redraw a view when i have zoomed in on it, i have looked at many examples (mainly native code) but am still struggling to get it fully working.
So let me try and explain what i am attempting....
I have a UIScrollView With a UIView(container) in it this in turn has many views within it each with UITextFields inside, the functionality i am looking for is when a user clicks on any of the view it is zoomed in on and then goes back into place when the user is finished with it which does all actually work fine except for the quality of the zoomed in view is terrible.
I am using a UIScrollViewDelegate but not really sure what to put in the ZoomedEnded function to handle the redraw, I have tried using the CATiledLayer but am not really sure how this is used and i always just end up with a black screen.
There is not much code to show as
svCertScroller.SetZoomScale(2.34f, true);
Works fine and in the UIScrollDelegate event ViewForZoomingInScrollView just returns the view i want zoom in on but i don't have anything in ZoomingEnded event at the moment I have tried loads but nothing even seems to get close.
So any help on what to put inside this event to sharpen up the zoomed in view would be great.
Thanks in advance.

Make the scroll canvas larger and plot the contents at a higher resolution.

Related

Resizing columns not refreshing properly

I made some change, I don't know what, and now when I try to resize columns on my DataGridView it just moves the line the control doesn't redraw properly. Basically parts of the control just don't redraw at all until I do something like move another window over them to force a redraw.
The only thing I can think of is that I tried suspending and resuming layout to fix another issue. It didn't work so I removed those lines of code. Don't see how that could affect it since those lines of code are not even there anymore though?
Not even sure how to debug this further.
I added a call to Refresh() the control in its OnColumnDisplayIndexChanged event and that seems to have fixed it.
A strange, but not problematic, side effect is that I can now see the columns moving for a half a second as the application programmatically sets the column widths after loading data. I guess this makes sense, however in the past it would only display after the code had updated the widths. But oh well, that's not a big deal.

Viewport3D not updating visuals after performing RenderTargetBitmap

Rendering a Viewport3D with a RenderTargetBitmap.Render call seems to cause the Viewport3D to no longer update its visual content. The interactive actions still work though, such a hover-over and clicking.
I've created an example in which I have a viewport which contains a button. I then render the viewport with RenderTargetBitmap. After this render, I try to toggle the visibility of the button but the visuals of the button no longer update which is unexpected. It is however not possible to click on the button as you would expect when it is collapsed. Toggling back the visibility to visible allows me to click the button again so it seems that only the visuals are no longer processed correctly.
It seems that the viewport loses track of the correct buffer it should use and keeps displaying the old version no matter what. I would like the viewport to just keep updating its visuals as it did before the render call, any ideas what I am missing here?
I've uploaded the demonstrator on bitbucket, the sourcefiles can be viewed here:
Sourcecode
The demonstrator is also available as a VS2010 solution:
download solution
If you require any other information please let me know, I'll try to answer your questions as detailed as possible.
I was having a similar issue. After the call to RenderTargetBitmap's Render(), I noticed that, for example, any color changes applied to the visuals within the Viewport were not being displayed. As you state, the interactive actions like clicking, rotating, hover-over, etc. were still working.
Within my application the Viewport being rendered was itself sitting inside (i.e. a child of) a Grid. I found that if, after the call to RenderTargetBitmap's Render() method, I removed the Viewport from and then readded the Viewport to the Grid's 'Children' list, the visuals within the Viewport continued to update as they did before the call to Render().

Ajax ModalPopupExtender positioning issue, not aligned in center

I am using Ajax toolkit and ModalPopExtender specifically, works fine, just have a big time issue with its positioning, I am using it to display images and all images have different height and width and hence some times it appears like bottom left of the screen with half of it going off the screen, I could have fixed it by specifying values for X and Y coordinates, but since the images sizes changes, if image is to small then user need to scroll the pointer all the way up.
The thing is it appears at a random location but as soon as I scroll or re size page, it relocates it self to the exact center of the screen (where its actually required).
Experts, kindly suggest a work around.
Thanks in advance.
Looks like there is no rigid solution to it, We contacted MSDN team as well, solved by replacing it with the Jquery Light Box.

Adding anchor line to a Bing Maps custom pushpin and allowing the user to drag

I am currently working on a Silverlight application using the Bing Map control, i am using a custom pushpin made up of an Image and a text block within a grid element, which works fine, this also allows me to have hover and right click events for each pushpin so all good so far, however there is a need for me to enable the user to drag the pushpin in any direction and have an a line connecting it to its actual position, sort of like an anchoring point.
I am struggling to see how to do this, I have seen lots of information on making the pushpins have the capability to be moved by the mouse but the line and anchor part is causing me a bit of a problem. Currently i keep my pushpins in various Observable Collections so that when they are updated the UI updates. If anyone has an Idea on a clean way of adding this functionality please let me know it will be much appreciated.
Many Thanks
I haven't got time to knock up a complete example. However I'll give away the basis of the solution. Replace the template with one based on a Canvas. For example you could have an ellipse to be the actual point on the map, a draggable border that has the ContentPresenter and a line to act as a tether.
The code needed is a) allow the Border to be dragged about and b) to move one end of the line about so that it lies under the Border.
I am still interested in other approaches but I have come up with a solution of paring my pushpin element with a MapPolyline, this in conjunction with the mouse handling to allow the user to drag the pushpin updates both, it is pretty effective and will do for now. I would still like to hear from anyone else with better suggestions though.

Putting ModalPopupExtender in a constant location

I've got a series of ModalPopupExtenders that I'm using to implement popup dialogs on an ASP.NET 2.0 page.
When they popup it's fairly easy to specify the location where they appear using the constructor using X and Y coordinates but I'm unsure how to deal with changes of window size which alters where they should be in cartesian space. I need them to appear relative to some other elements on the page.
I've tried hooking into the onresize javascript function in IE but this is broken and fires whenever a div changes size (problematic really given that i have lots of CollapsiblePanelExtenders in the UI.
Anybody ever done this and have any suggestions how i can get this working?
Edit : This code helps no end in capturing the resize event...
http://blog.stchur.com/2006/09/06/the-ie-resize-bug-revisited/
I've figured out how to do this.
I use onClickClick to display the modal popup after figuring out where to put them by getting the x + y coordinates from a known control from the DOM. Upon resize (from http://blog.stchur.com/2006/09/06/the-ie-resize-bug-revisited/) i've decided to just hide the popups
ModalPopupExtender has a property called RepositionMode for exactly this purpose

Categories