FSMakefsRefUnicode()
Hi
Can anyone of you please tell me how to use the FSMakefsRefUnicode( ) function in XCODE.I need to open a picture file and print it on the screen.So I have a variable 'cfilename' where I store the path for the picture file.How can I use that variable in the function FSMakefsRefUnicode()?
Can anyone of you please tell me how to use the FSMakefsRefUnicode( ) function in XCODE.I need to open a picture file and print it on the screen.So I have a variable 'cfilename' where I store the path for the picture file.How can I use that variable in the function FSMakefsRefUnicode()?
Don't. There are much easier ways to load an image from a path than making an FSRef for it (and even if you absolutely must use an FSRef for some reason, FSMakeFSRefUnicode is not the way to get it).
I'd recommend NSImage's initWithContentsOfFile: as being the easiest way to load an image given a path.
FSPathMakeRef is the easiest way to turn a path into an FSRef...
I'd recommend NSImage's initWithContentsOfFile: as being the easiest way to load an image given a path.
FSPathMakeRef is the easiest way to turn a path into an FSRef...
hi,can u please provide me a sample code for laoding an image file given a file path?
Code:
NSImage * myImage = [[NSImage alloc] initWithContentsOfFile: @"/Path/to/file.png"];
Hi,
Can u pls suggest me an alternative way to print strings on the screen...I tried to use drawstring() but it is deprecated in Mac os 10.4.So what other API's are available equivalent to drawstring()?
Can u pls suggest me an alternative way to print strings on the screen...I tried to use drawstring() but it is deprecated in Mac os 10.4.So what other API's are available equivalent to drawstring()?
You can find documentation, references, and guides on developer.apple.com. Understanding where to go to find answers to this sort of question will benefit you far more than just the answers by themselves.
It sounds like you're coming from a Toolbox/Carbon background. Unless you're specifically tied to Carbon for some reason, the Cocoa API is likely to suit your purposes far better for modern applications.
http://developer.apple.com/referencelibr...index.html
It sounds like you're coming from a Toolbox/Carbon background. Unless you're specifically tied to Carbon for some reason, the Cocoa API is likely to suit your purposes far better for modern applications.
http://developer.apple.com/referencelibr...index.html
hi,
I am a new user to Mac OS.I need to port a C project from Mac os 9 to Mac os 10.4.So while porting it to xcode I found that few API's which we used in our project has been deprecated.One such API is DrawString() to print text on the screen.In the Apple developer reference document they have asked to use ATSU or Quartz as an alternative.I used CGContextShowatPoint() API but it is not printing the text.Please help me with this.
Code I used is:
-------------
#include <ApplicationServices/ApplicationServices.h>
char str[100];
sprintf(str,"Press any key to exit");
CGContext *context;
CGContextShowTextAtPoint(context,400,300,str,strlen(str)-1);
Please tell me what is wrong in the above code.
It is a carbon application.
I am a new user to Mac OS.I need to port a C project from Mac os 9 to Mac os 10.4.So while porting it to xcode I found that few API's which we used in our project has been deprecated.One such API is DrawString() to print text on the screen.In the Apple developer reference document they have asked to use ATSU or Quartz as an alternative.I used CGContextShowatPoint() API but it is not printing the text.Please help me with this.
Code I used is:
-------------
#include <ApplicationServices/ApplicationServices.h>
char str[100];
sprintf(str,"Press any key to exit");
CGContext *context;
CGContextShowTextAtPoint(context,400,300,str,strlen(str)-1);
Please tell me what is wrong in the above code.
It is a carbon application.
