Newbie: Help with drawing images please
Newbie: Help with drawing images please
- Subject: Newbie: Help with drawing images please
- From: <email@hidden>
- Date: Tue, 22 Apr 2003 16:31:56 +0000
Hello there.
I've got this problem with drawing images in NSView. I'm trying to make this card game in order to learn Cocoa, and I'm running into obstacles between Cocoa and Java, since I come from a Java background. I'm initializing NSImages using the [ NSImage imageNamed: NSString ] initializer and drawing it on my NSView using the [ NSImage drawInRect: NSMakeRect( x, y, WIDTH, HEIGHT ) fromRect: NSMakeRect( 0, 0, imageSize.width, imageSize.height ) operation: NSCompositeCopy fraction: 1 ]. Now the is drawn alright, but it is heavily pixelated, as in I have a really hard time trying to understand the suit or the number of the card. Is there something I'm missing here? This game I'm making is actually a port of a version I originally made in Java. There I initialized the image using image = Toolkit.getDefaultToolkit(). getImage( String ) and I painted the image with g.drawImage( image, x, y, WIDTH, HEIGHT, JFrame ). WIDTH and HEIGHT have the same values in the Java and Cocoa versions and I'm using the exact copies of the JPEG files for both, yet in Java the Images are drawn clearly and legibly. In Cocoa my eyes hurt just by looking at it. Is there a step or optimation that I'm missing? Help please. Thanks!
Jino Noel
Wannabe Programmer
It is a miracle that curiosity survives formal education. -Albert Einstein
---
MacMail - the Webmail service especially for Mac users worldwide
http://www.macmail.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.