Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Objective-C and Swift
  4. image from custom NSView , image quality is very bad.

image from custom NSView , image quality is very bad.

Scheduled Pinned Locked Moved Objective-C and Swift
help
3 Posts 2 Posters 10 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Le rner
    wrote on last edited by
    #1

    hi all, i have an image with god quality even when i view it in preview and zoom its gud and not pixelate. i have create an custom view class derived from NSView, to draw text above and below the image. and resize the image inside the custom view class in -drawRect method, i draw the text and image. with help of NSMutableAttributedString drawinRect and NSImage drawInRect methods. than get final image like this.

    OffscreenView *view = [[OffscreenView alloc] initWithImage:myimage];

    NSRect			rect = \[view bounds\];
    NSData 			\*data = \[view dataWithPDFInsideRect:rect\];
    

    NSImage *image_bar = [[NSImage alloc] initWithData:data];

    buts this image quality is very badges compare to original image i pass to view. please help me to get god quality image here.

    S 1 Reply Last reply
    0
    • L Le rner

      hi all, i have an image with god quality even when i view it in preview and zoom its gud and not pixelate. i have create an custom view class derived from NSView, to draw text above and below the image. and resize the image inside the custom view class in -drawRect method, i draw the text and image. with help of NSMutableAttributedString drawinRect and NSImage drawInRect methods. than get final image like this.

      OffscreenView *view = [[OffscreenView alloc] initWithImage:myimage];

      NSRect			rect = \[view bounds\];
      NSData 			\*data = \[view dataWithPDFInsideRect:rect\];
      

      NSImage *image_bar = [[NSImage alloc] initWithData:data];

      buts this image quality is very badges compare to original image i pass to view. please help me to get god quality image here.

      S Offline
      S Offline
      Surya_Narayan
      wrote on last edited by
      #2

      does it compressing the image volume as well .

      L 1 Reply Last reply
      0
      • S Surya_Narayan

        does it compressing the image volume as well .

        L Offline
        L Offline
        Le rner
        wrote on last edited by
        #3

        no

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups