IPhone UIViewContentModeRedraw & UIScrollView zooming is pixellated

Dear Experts,
I have a UIView that draws its content using Quartz2D operations (CGContextAddLineToPoint() etc) inside its drawRect: method. This view is a subview of a scrollview. Everything is fine until I zoom. It seems that the content is magnified as an image, so it looks pixellated. I thought that the solution to this would be to set the view's contentMode to UIViewContentModeRedraw, but this doesn't seem to have helped: my debugging suggests that drawRect is not being called when the UIScrollView changes the magnification.
I think that manual changes to the view's transform property have the same effect, i.e. they also don't cause drawRect to be invoked and the result looks pixelated.
In test code I can get decent results by instead doing the magnification on the graphics context inside drawRect: and calling setNeedsDisplay to ensure that drawRect is called. But I don't think I can wire this hack up to the UIScrollView.
Does anyone else have experience of zooming Quartz2D content?
Thanks for any suggestions -- Phil.

fwiw, I'm seeing the same issue when animating UIView frame resizes. My backing CGPathRef with a 1 pixel stroke border looks stretched during the animation.

Similar Messages

  • IPhone SDK: UIScrollView, zooming works on simulator but not device

    I've got a UIScrollView set up to zoom an image. It worked fine under Beta 5, both on an iPod Touch and in the simulator.
    In Beta 6, after changing the method scrollViewWillBeginZooming to viewForZoomingInScrollView the zoom works fine in the simulator, but it does not work on the iPod.
    Any ideas?

    Excited to hear that you were able to zoom image.
    I am ****** off, sure because I am new in this.
    I got one UIImageView in UIView.
    And I can display Images.
    I like to implement the pinch and zoom function.
    From my googling I understood that UImageView should be inside a UIScrollView
    But I dont have any idea how to do that.
    Can you please send me the sample code for doing the same.
    Thanks in advance.
    If you guys no some books to refer , please inform me.
    Expecting your help

  • What am I inadvertently doing to make my iPhone 4S screen zoom in?

    I'm doing something inadvertently, and constantly, that makes my iPhone 4S screen zoom in or enlarge...so I can only see part of what should be on the screen, whether I'm on the home screen or within an app.  I can't seem to "un-zoom" it so I have to reboot the phone...I'm doing this every day.  What am I doing to cause this?
    Rocketman

    go to settings>general>accessibility
    make sure "Zoom" is off

  • IPhone stuck on zoom. How to get it back to normal display?

    iphone stuck on zoom. How to get it back to normal display?

    use 2 fingers and pinch the screen with your fingers together and it will zoom out

  • Why screen size for iPhone simulator is still 480x320 pixels?

    Hi,
    I just upgraded my xcode to 4.2.1 so I have iOS SDK 5.0 now. However, when I create a project, the screen size in simulator for iPhone is 480x320 pixels. I was told the screen size for iPhone/iPad is now 960x640 pixels. Why in simulator it is still old size? What should I do to get the correct size or I am wrong and the actual device is still 480x320 pixels? Thanks.
    Regards,
    Taizhi

    hi,
    you change between "iPhone" and "iPhone retina" to simulate both physical resolutions.
    For the project it doesn't matter because the logical resolution is still 320 x 460 "Points". The OS does most of the work for you.
    I suggest reading: this: http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/Drawi ngPrintingiOS/SupportingHiResScreens/SupportingHiResScreens.html#//apple_ref/doc /uid/TP40010156-CH15
    Dirk

  • HT4061 The screen on my Iphone 5 has zoomed and it will not go small again. How can I get it back? I can not navigate on the page at all and I can not power down the phone.

    The screen on my iphone 5 has zoomed and I can not navigate on the page. How can I reset it?

    Then go to Settings/General/Accessibility and turn off Zoom.

  • UIScrollView Zooming - Can't get it to work?

    Hello,
    I've been having great success with the iPhone SDK but for some reason I just can't get the zooming to work with a UIScrollView. I've implemented the delegate but the methods are never being fired.. but scrolling works fine. What gives?
    Thanks

    When you create your scrollview..
    scrollView.delegate = self; //(or what ever class is you delegate)
    And setup scrolling by changing these values, read the docs for more info.
    scrollView.minimumZoomScale = 0.5;
    scrollView.maximumZoomScale = 2.0;
    Add this function to your delegate class
    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
    return myView; //(The view you want to scroll)
    I think you need to add UIScrollViewDelegate to your interface line but i don't remember if I did this for scroll or zoom.
    @interface AppDelegate : NSObject <UIApplicationDelegate,UIScrollViewDelegate> {

  • Script to open a file and zoom to pixel

    Hi, I work for a mapping company and one of our digital camera has a fault with the lens resulting in a small black mark appearing in exactly he same location of every image we capture what I would like is a script that can be used to open a file set the zoom say to 100% and move to pixel 3324x5493 so I user can repair it.
    I thought this would be simple but I've been looking all evening without finding anything
    Thanks
    Stu

    I have something started but it isn't quite finished. It will center on the pixel and zoom in, but the only holdback is it increases the canvas size which will need to be cropped later. If you first set the Background layer to a non-Background layer your extra canvas will be transparent which will allow for a simple trim to return to the normal image later.
    function centerON (x,y) {
        var startRulerUnits = app.preferences.rulerUnits;
        var startTypeUnits = app.preferences.typeUnits ;
        var startDisplayDialogs = app.displayDialogs;
        app.preferences.rulerUnits = Units.PIXELS;
        app.preferences.typeUnits = TypeUnits.PIXELS;
        app.displayDialogs = DialogModes.NO;
        var centerDoc=app.activeDocument;
        w=centerDoc.width.value;
        h=centerDoc.height.value;
        hdiff=Math.round(Math.abs((x-w/2)*2));
        vdiff=Math.round(Math.abs((y-h/2)*2));
        if (x>w/2) {var hor="LEFT";}
        else if (x<w/2) {var hor ="RIGHT";}
        else {var hor="CENTER";}
        if (y>h/2) {var ver="TOP"; }
        else if (y<h/2) {var ver="BOTTOM"; }
        else {var ver="MIDDLE"; }
        newwidth=w+hdiff;
        newheight=h+vdiff;
        switch (ver) {
            case "TOP":
            switch (hor) {
                case "LEFT": anchor=AnchorPosition.TOPLEFT; original=[0,0,w,h]; break;
                case "RIGHT": anchor=AnchorPosition.TOPRIGHT; original=[hdiff,0,hdiff+w,h]; break;
                case "CENTER": anchor=AnchorPosition.TOPCENTER; original=[0,0,w,h]; break;
            }; break;
            case "BOTTOM":
            switch (hor) {
                case "LEFT": anchor=AnchorPosition.BOTTOMLEFT; original=[0,vdiff,w,vdiff+h]; break;
                case "RIGHT": anchor=AnchorPosition.BOTTOMRIGHT; original=[hdiff,vdiff,hdiff+w,vdiff+h]; break;
                case "CENTER": anchor=AnchorPosition.BOTTOMCENTER; original=[0,vdiff,w,vdiff+h]; break;
            }; break;
            case "MIDDLE":
            switch (hor) {
                case "LEFT": anchor=AnchorPosition.MIDDLELEFT; original=[0,0,w,h]; break;
                case "RIGHT": anchor=AnchorPosition.MIDDLERIGHT; original=[vdiff,0,vdiff+w,h]; break;
                case "CENTER": anchor=AnchorPosition.MIDDLECENTER;original=[0,0,w,h]; break;
            }; break;
        app.runMenuItem(charIDToTypeID("FtOn"));
        centerDoc.resizeCanvas(newwidth,newheight,anchor);
        app.runMenuItem(charIDToTypeID("ActP"));
        app.refresh();
    //    centerDoc.trim();
    //    centerDoc.crop(original);
        app.preferences.rulerUnits = startRulerUnits;
        app.preferences.typeUnits = startTypeUnits;
        app.displayDialogs = startDisplayDialogs;
    centerON(234,3500);
    For centerON(234,3500); you would of course input your own x,y coordinates where you want to center the image.
    The issue I'm having is that if I trim or crop the image, it will sometimes re-center the image elsewhere. I've tried using a crop with hide to center on the pixel then Reveal All to show the whole image again, but that also re-centers the image. Though, that may actually be a better way for you to do it afterall. Instead of increasing the canvas size, you could crop with hide to put the center on the pixel you want, then when finished just Reveal All.
    It would just be easier if Photshop kept focus centered during a crop.

  • UIScrollView - zooming a view hierarchy and resetting zoom

    Hi,
    I want to reset zooming in scrollViewDidEndZooming - meaning:
    - during zooming the zoom view content is changing as expected
    - as soon as the user has finished zooming, the zoom view content should resize to what it was before
    So in scrollViewDidEndZooming I resize the frame of my content view UIImageView:
    - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
    CGRect rectMask = view.orgFrame;
    view.frame = rectMask;
    ...which works fine for the content view itself BUT NOT for its children which I added to it via addSubview.
    Why are the subviews zooming correctly during the user interaction but not reacting to the frame-reset?

    1. System Preferences/Universal Access: there you can turn on Zoom, which you can operate with the scroll wheel of your mouse.
    2. The Spellchecker uses whatever language you have selected for the system. Again, go to System Preferences/International/Language and do as it suggests: drag British English to the top.

  • IPhone 6 Display Zoom Known Issues?

    I have an iPhone 6 64 GB and have noticed some peculiarities of the display zoom setting (Settings -> Display & Brightness -> Display Zoom -> View). When set to "zoomed" everything is enlarged to the same size of an iPhone 5S. However, when set to "standard", which takes full advantage of the larger display, there appears to be a few issues:
    1) Lock screen remains "zoomed" - Look at the top of the iPhone and the cell strength, carrier, WiFi, and time are all larger when locked.
    2) Some apps that claim to be optimized for iOS 8 have "zoomed in" look (Facebook, Spotify, anything Google). This also zooms the keyboard. How frustrating !
    I was wondering if others are having this same issue. Is this an app developer issue, an iOS 8 for all users, or an issue unique to me? All official Apple apps have appropriate "standard" setting, along with some others (Twitter and Beats Audio).

    it happens the same to me. Apple support made me clean restore from DFU mode. Then configured as new iPhone and same thing happens.
    The lock screen is zoomed and all no apple apps Except Twitter and telegram.
    It's pretty weird. They told me to send it to repair, but I will wait some days and see if there is a software update.

  • IPhone isn't using all pixels on the screen?

    Hi All
    About one month ago i finally pulled myself together and bought myself the iPhone (great phone ) however, i just looked closely at the phone today and noticed one thing. When i am looking at the border of the screen (right before the "real black" it is, as if there are a row of about 3 pixels around the screen. That aren't used. Is that a faulty phone, or is that normal? (i will try to post some pictures when i get home later tonight)

    yeah i still think its a new problem for me...i didn't notice it for the first 4 months i had the phone and then all of the sudden i did a month ago...i just don't care enough to send it to apple and be phoneless for a few weeks

  • Iphone 6 camera has flickering pixels

    at first the camera took good pictures, and then the pixels started to flicker and now the pictures are very pixellated and almost cartoonish.. is this happening to anyone else?!

    Hi. Is this still happening? I'm a journalist with TomGuide.com tracking iPhone 6 camera issues. Does it look anything like the situation in this video? https://www.youtube.com/watch?v=aLv1OneOI6U
    Thanks. Sean

  • Newly opened Iphone 5 64G has dead pixels!!

    Hi,
    I bought Iphone 5 64G in Singapore and when I opened the phone, I noticed that there are 4 vertical lines on the upper left portion of the screen. It becomes more visible if the background is white. I believe these are dead pixels. I am from Philippines and now I would like to send it to apple for warranty. Can I have it replaced/repaired here in the Philippines? Thanks!

    If you bought your iPhone from Apple directly and are within Apple's return period - 30 days in most countries - then you should be able to return the iPhone for refund and then can buy the configuration you now want. If you're beyond the return period, then Apple will not take your iPhone as a trade-in to one with a higher capacity. They'll only replace it with the same model.
    If you purchased from a dealer, then that dealer's return policies if any would apply.
    Regards.

  • Does iPhone camera have zoom feature?

    I have not found where this is, does the iPhone camera have a zoom feature???

    No, the camera doesn't have a zoom. However, once the photo is taken, you can zoom in on it by dragging outward from the center with your fingers.
    -SB

  • IPhone notes No zoom?

    Hi,
    Can anyone helpme, needing reading glasses, and when I forgotten them I used to be able to 'zoom' into my notes in IOS6 by using two fingers and "Stretching" the page to make the text any size I liked, I have now upgraded to IOS7 and cant do this anymore, I have changed the accessibility options / Zoom / Larger type / Bold Text / Increase contrast,  but I dont want to make the text bigger for everything, only as before is this not possible?
    Yours frustrated with IOS 7

    Please take your criticisms and suggestions to the new created iPhone feedback page.

Maybe you are looking for

  • Xorg 1.9 fails to initialize on a usb-installation of Arch [SOLVED]

    As a side project, I decided to install Arch on a usb drive. I just installed Xorg (using the group). Thus far, I've run xorg -configure, then moved the xorg.conf.new to /etc/X11/xorg.conf I added in a "Synaptics" section, since this is on a laptop r

  • How to use dynamic selection screen inputs in main program

    hi all,   its a report where in it calls one dynamic selection screen( user need to enter the parameters here) after that i need to use those inputs for some check, can any buddy help how to use/ get that input parameters into main program. regards,

  • HTTP Listener problems

    Good day all, I have some problems regarding HTTP Listener: 1. I cannot startup my www listener on port 80, only Node Manager listener can be started. It gives out the errors: OWS-08811 & OWS-08851. 2. I even cannot either view or edit the configurat

  • Need help on page layout.

    Hi all, I have 3 issues like 1. I need to create 3 LOV's(these 3 values should come from VO) in the AF Query. 2. I have 2 tables, which radio button i have selected the related data should needs to come in the 2nd table. logic is ready I have written

  • Quantity should come automatically in MI04 line items

    Hi, Suppose there are 10 line items in MI04. In 1st five line items against material, we insert the Quantity but not for last 5. We want that in last 5 line items, Quantity must pick automatically from system. Means in last 5, Perpetual Inventory qua