Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Graham Cox
> On 15 Jan 2016, at 10:42 PM, Andreas Höschler wrote: > > But how does NSBitmapImageRep know which pixel resolution to choose? How does > it derive Pixels=1702x1798 when I create the imageRep with a {{0, 0}, {851, > 899} rect It has a ‘size’ property which can be different fron the ‘pixels

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Andreas Höschler
Hi Quincey, > On Jan 15, 2016, at 11:24 , Andreas Höschler > wrote: >> >> However, I generated the image rep with a 851 x 899 view and wrote it into a >> PNG file (code in earlier mail). > > Yes, I saw, but you didn’t include (or I couldn't find) the log output tha

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Quincey Morris
On Jan 15, 2016, at 11:24 , Andreas Höschler wrote: > > However, I generated the image rep with a 851 x 899 view and wrote it into a > PNG file (code in earlier mail). Yes, I saw, but you didn’t include (or I couldn't find) the log output that showed the size of the NSImage object, even though

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Gary L. Wade
> On Jan 15, 2016, at 10:15 AM, Quincey Morris > wrote: > > …number of pixels you get back will vary according to which Mac you run this > on. …or on which screen you're using. You can see the point/pixel disparity more easily by adding a non-Retina monitor to a Retina Mac and moving your win

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Quincey Morris
On Jan 15, 2016, at 03:42 , Andreas Höschler wrote: > > It seems I have a lack of understanding of the difference of points and > pixels. With “retina” displays, there can be 2 or 3 pixels for each unit of the drawing coordinate system (points). When you did this: > NSBitmapImageRep *re

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Andreas Höschler
Hi Quincey, thanks a lot for your response. Please read below ... >> This should in a view with size {851, 899} get me a purple line starting >> close to the lower left corner and ending close to the top right corner. But >> that's not the case. The picture is drawn zoomed in!?? > > I’m not su

Re: drawRect: wrong scale in a programmatically created window

2016-01-14 Thread Quincey Morris
On Jan 14, 2016, at 13:26 , Andreas Höschler wrote: > > This should in a view with size {851, 899} get me a purple line starting > close to the lower left corner and ending close to the top right corner. But > that's not the case. The picture is drawn zoomed in!?? I’m not sure I understand com

drawRect: wrong scale in a programmatically created window

2016-01-14 Thread Andreas Höschler
Hi all, I have a command line tool in a Terminal session (service) that generates PNGs via NSBezierPath drawing. In this tool I create the view and corresponding window like so mapView = [[ESMMapView alloc] initWithFrame:NSMakeRect(0, 0, _imageSize.width, _imageSize.height)];