NSImage gets distorted when scrolled
NSImage gets distorted when scrolled
- Subject: NSImage gets distorted when scrolled
- From: Ron Ballesteros <email@hidden>
- Date: Sat, 2 Oct 2004 20:40:11 -0700
I'm working on a small app that has a custom view and I'm currently running into a problem with my NSImage that I draw in the custom view.
The problem that I am having is that when I resize the window and scroll the image that is drawn which is a jpg file, the image gets stretch or smeared (not quite sure of the best way to describe it) in the direction that I scroll.
I searched the archives and I couldn't find anything regarding my said problem. Most of what I found was regarding scrolling when an image is resized.
I haven't dealt a lot with NSImage or CustomViews but below is my testing code.
NSPoint mapPoint = NSMakePoint(0, [mapImage size].height);
if (mapImage) {
[mapImage compositeToPoint: mapPoint operation: NSCompositeSourceOver];
}
// Constructing the path
NSBezierPath *hotSpots = [NSBezierPath bezierPath];
[[NSColor redColor] set];
// Draw some random hot spot points over the map Image for Test
NSArray * hotSpotPoints = [hotSpotList objectAtIndex: spotIndex];
for (j=0; j< [hotSpotPoints count]; j++) {
NSPoint hotSpotPoint = NSPointFromString([hotSpotPoints objectAtIndex: j]);
NSRect hotCenter = NSMakeRect(hotSpotPoint.x, hotSpotPoint.y, 5, 5);
[hotSpots appendBezierPathWithOvalInRect: hotCenter];
[hotSpots stroke];
[hotSpots fill];
}
I would appreciate any pointers to the right direction.
Thanks.
ron _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden