How to solve this??convert CMYKBlack to grayscale

Hi i need to convert CMYKBlack to grayscale.here is the code im using....
in case of textart..
if(style.fillPaint==1)
if( style.fill.color.kind == kFourColor &&
((style.fill.color.c.f.black>0 && style.fill.color.c.f.cyan==0 &&
style.fill.color.c.f.yellow==0 && style.fill.color.c.f.magenta==0) ||
(style.fill.color.c.f.black==0 && style.fill.color.c.f.cyan==0 &&
style.fill.color.c.f.yellow==0 && style.fill.color.c.f.magenta==0)))
style.fill.color.kind=kGrayColor;
percentageOfGray=0;
percentageOfGray=(style.fill.color.c.f.cyan) * 30/100;
percentageOfGray=percentageOfGray + ((style.fill.color.c.f.magenta) * 59/100);
percentageOfGray=percentageOfGray + ((style.fill.color.c.f.yellow) * 11/100);
percentageOfGray=percentageOfGray + (style.fill.color.c.f.black);
if (percentageOfGray*100 >100)
percentageOfGray=1;
style.fill.color.c.g.gray=percentageOfGray;
error = sAITextRun->SetTextRunPathStyle (line,&style );
error = sAITextRun->SetTextRunPathStyle (line,&style )---------This syntax is used in illustrator 10 for setting the converted color..what is the similar syntax to be used in illustrator cs2.
Please someone help me.......
Thanks in advance......
Subha.....

Sorry, I've been sick for a few days, just got back. Hopefully this will still be useful to you (or someone else!).
First, I just want to mention that there's a suite for doing this kind of thing, the AIColorConversionSuite (AIColourConversion.h). I'd take a look at that; it might simply your conversion code.
As for setting the text colour in CS on, here's the code we use in our application for setting text's stroke colour:
------------- snip --------------
ASSERT(sATEPaint);
ASSERT(sAITextFrame);
TextRangeRef textRangeRef = 0;
// this code is inside an object that represents
// text art, so it has a member that has the art
// handle. This handle is retrieved using GetHandle()
// so just replace 'GetHandle()' with your AIArtHandle
// variable
AIErr error = sAITextFrame->GetATETextRange(GetHandle(), &textRangeRef);
THROW_EXCEP_IF(error);
ATE::ITextRange textRange(textRangeRef);
ATE::ICharFeatures charFeatures = textRange.GetUniqueLocalCharFeatures();
// colour is a pointer to our own colour object; its
// a pointer so that a 'null' stroke can be set
if (colour) {
ATE::ApplicationPaintRef paintRef = 0;
AIColor aiColour;
// this is the colour model of the document,
// which is either CMYK or RGB
EColourModel model = CDocumentList::GetCurrentDocument().GetColourModel();
// we have classes, CRGBColour & CCMYKColour that automatically do
// colour conversion for us -- they use the AIColorConversionSuite
if (eColourModelRGB == model) {
aiColour = (AIColor)(*colour);
} else if (eColourModelCMYK == model) {
aiColour = (AIColor)(CCMYKColour(*colour));
error = sATEPaint->CreateATEApplicationPaint(&aiColour, &paintRef);
THROW_EXCEP_IF(error);
ATE::IApplicationPaint paint(paintRef);
// obviously you'd use SetFillColor here if you wanted fill
charFeatures.SetStrokeColor(paint);
charFeatures.SetStroke(true);
} else {
charFeatures.SetStroke(false);
textRange.SetLocalCharFeatures(charFeatures);
------------- snip --------------
Note that THROW_EXCEP_IF is a macro of ours that throws an exception if error != kNoErr.

Similar Messages

  • How to solve this problem?please suggest.

    Hi all,
               I am getting like this error,
    Record 9304 :Contents 0.00 0000 from field UMSA1 cannot be converted in type CURR ->lo     RSAR197     
    Error in an arithmetic operation in record 9304 RSAR     117     
    Error records written to application log     RSM2     708
    Actually 32 datapackets are there for this info package,at 31 datapacket error is getting,31 datapacket is not available in PSA.
    At datapacket level this error message is also there
    Error in an arithmetic operation in record 9304
    Please explain me how to solve this error.
    Thanks & Regards,
    mano

    *Hi, I am getting the same error*
    Error records written to application log
    Error in an arithmetic operation in record                                               489
    Record                                               489:Contents        四川省长江滥曝扇备总 from field UMSA1 cannot
    Record 489 :Contents 四川省长江滥曝扇备总 from field UMSA1 cannot be converted in type CURR ->lo
    This happened for the customized master data Z********(customer number). Data source; 0CUSTOMER_ATTR
    I have undertaken the following actions but all failed.
    1. Replicated the data source, activated the transfer structure through a program and the load was run but the load failed with the same issue.
    2. Pushed the data till PSA and tried to edit it in the PSA, but here too the load failed with the same issue.
    It is understood that the data source 0CUSTOMER_ATTR is obtained from the Funtion Module: MDEX_CUSTOMER_MD
    Out of 5 data packages, I could find only 3 data packages in PSA which are successful, the remaining had error and could not be found in PSA. Checked in R/3 but could not catch the correct record, since, did not had proper info. UMSA1 refers to Annual Sales, which are empty in R/3 and BW as well.
    The UMSA1 field in data source 0CUSTOMER_ATTR in BW.
    Data Type: CURR, Length: 15, Decimal: 2, curr/unit: UWAER
    The UMSA1 field in R/3
    Data Type: CURR, Length: 15, Decimal: 2
    Request your timely suggestions.
    Raj

  • I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem?

    Problem with an incoming message. For example, during my conversation the second line receives a call, I hear the sound in dynamics such as "piiiip piiiip," but when in this situation I recieve SMS and i hear established melody and I do't hear the person on all over SMS. How to solve this problem? Perhaps someone tell me? save in advance

    Not Charge
    - See:     
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. The cable for 5G iPod (lightning connector) seems to be more prone to failure than the older cable.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar

  • I'm trying to connect my 30" Cinema Display to my new Mac Pro along with a new Apple 23'" monitor.  The new Apple monitor is fine.  On the cinema monitor everything is blown up pretty large.  Any ideas on how to solve this?

    I'm trying to connect my 30" Cinema Display to my new Mac Pro along with a new Apple 23'" monitor.  The new Apple monitor is fine.  On the cinema monitor everything is blown up pretty large.  Any ideas on how to solve this?

    The 30" display needs a DUAL-LINK adapter.
    <http://store.apple.com/us/product/MB571Z/A/mini-displayport-to-dual-link-dvi-ada pter>

  • Hi, when ever I'm using 3G, on my Iphone4 sim stops working and Network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem.

    Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem. Thanks.

    Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
    Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore.

  • I Try to open an Indesign document. The message: it is made in a newer version. Go tot CC: Help/Give your Adobe id/Start Indesign again and try to open the document. This doesn't work. How to solve this problem?

    I Try to open an Indesign document. The message: it is made in a newer version. Go tot CC: Help/Give your Adobe id/Start Indesign again and try to open the document. This doesn’t work. How to solve this problem?

    What version are you running?
    What version was it made with?

  • After installing Lion os I cannot see my desktop 1 nor can I see my open windows when I go to finder, I just get the grey/black background that comes with mission control. Any ideas as to how to solve this problem?

    The top picture is what my Desktop 1 looks like. And the picture below is what my desktop looks like after clicking mission control. Ive tried changing wallpapers, changing preferences, etc. and I still can't figure out what's wrong. As you can see, on mission control you can't see any of the open windows, or anything that I have placed on my desktop. Any ideas as to how to solve this issue?

    Hello cor-el, thanks for your reply. I changed my settings for downloads to desktop and it has appeared on there. When I double click I am asked which program I want to open file. I click firefox and another box "opening install" says I have chosen to open the file which is an application and do I want to save it. This is the only real option so I press save file. I get a box saying this is an executable file which may contain viruses - do you want to run. I press ok and the final box showing C drive file name and desktop appears stating application not found.
    This happens the same whenever I try to install.
    To my untrained eye the application is not being recognised as an application and I cannot work out how to get it to do that.
    My plugin is still showing as out of date.
    Is there anything you could suggest. Thanks for your time.

  • Hello guys..!! I have got my new  iphone 4 2 days ago.The same day it got a problem of auto restart in every 1, to 2 minutes. I updated and restored it many times...but of no use... can any one help me how to solve this problem..!!

    Hello guys..!! I have got my new  iphone 4 2 days ago.The same day it got a problem of auto restart in every 1, to 2 minutes. I updated and restored it many times...but of no use... can any one help me how to solve this problem..!!

    Go to Settings/General/Reset - Erase all content and settings. the connecto to iTunes and restore as a New phone. Do not restore any backup. If the problem persists you have a hardware problem. Take it to Apple for exchange.
    This assumes that the phone is not hacked or jailbroken. If it is you will have to go elsewhere on the internet for help.

  • TS1702 Does any one know how to solve this iPod touch error: I am tryin to pay for an app but I can because it says that I don't have enough space when I actually have more than enough space to download it so please help me

    Does anyone know how to solve this problem: I a trying to download a paid app but I cannot because the AppStore says that info not have enough space to download it even though I have more than enough space so if any of you know what can solve this problem then please let me know

    The app is compressed and needs swap space to install. As a rule of thumb you need 3 times the listed size of the app available, or in your case 4.6GB. You only have 1.7GB.

  • Iphone 4 is hiting in ios 5.1.1. any one know how to solve this problem??

    iphone 4 is hiting in ios 5.1.1. any one know how to solve this problem??

    This sounds like a hardware problem and should be taken to Apple if the heating / "hiting" becomes disturbing to you. If you feel that your iPhone has a heating / "hiting" problem and needs to be repaired, please contact Apple Support and they can further assist you in having it inspected, repaired, or even replaced. In the past, the overheating of Apple products has been known to cause harmful problems to a few particular users. Please evaluate your situation and take further action if you feel necessary.
    http://www.apple.com/support/contact/

  • Transaction failed for unknown reason (100) Unable to complete backup at this time. Does anyone know how to solve this issue?

    Transaction failed for unknown reason (100) Unable to complete backup at this time. Does anyone know how to solve this issue?
    Thanks.

    The system is set up to backup files to the iCloud at the end of the day. This has ot happen for sometime now and the mesaage I get is the back up error.

  • How to solve this error java.util.MissingResourceException

    Hi Friends,
    I had developed one web dynpro application by using  Internationalization - I18N of WebDynPro (Java)  Application (Blog)   but I got one error that is
    <b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.language.lang, locale en_US</b> 
    Actually i created two properties file
    1. lang_en.properties
    2. lang_ta.properties
    I stored this two properties file in this package com.sap.example.language
    and this my code in DOInit()
    sessionLocale =  WDClientUser.getCurrentUser().getLocale();
    resourceHandler = ResourceBundle.getBundle("com.sap.example.language.lang",sessionLocale);
         catch (WDUMException e)
         e.printStackTrace();
         wdContext.currentContextElement().setUsername_label(resourceHandler.getString("testview.username"));
         wdContext.currentContextElement().setPassword_label(resourceHandler.getString("testview.password"));
    How to solve this error?
    Guide me.
    Advance Thanks,
    Balaji

    Hi Friends,
    I had developed one web dynpro application by using Internationalization - I18N of WebDynPro -Java Application (Blog) but I got one error that is
    <b>java.util.MissingResourceException: Can't find bundle for base name com.sap.example.language.lang, locale en_US</b>
    Actually i created two properties file
    1. lang_en.properties
    2. lang_ta.properties
    I stored this two properties file in this package com.sap.example.language
    and this my code in DOInit()
    sessionLocale = WDClientUser.getCurrentUser().getLocale();
    resourceHandler = ResourceBundle.getBundle("com.sap.example.language.lang",sessionLocale);
    catch (WDUMException e)
    e.printStackTrace();
    wdContext.currentContextElement().setUsername_label(resourceHandler.getString("testview.username"));
    wdContext.currentContextElement().setPassword_label(resourceHandler.getString("testview.password"));
    How to solve this error?
    Guide me.
    Advance Thanks,
    Balaji

  • Get error message when syching iPod, iPod cannot be synced. You do not have enough access priveleges for this operation.  How to solve this?

    Get error message when syching iPod, iPod cannot be synced. You do not have enough access priveleges for this operation.  How to solve this?

    Hello FranBNYC
    It sounds like a permissions issue with your library, check out the article below to check and make sure that things are set correctly.
    Trouble adding music to iTunes library or importing audio CD
    http://support.apple.com/kb/ts1387
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Hi, my Ipod Schuffle (4 gen) dissapears from windows vista right after I execute Itunes, I've change the drive letter, erase temps in App data file, verified USB drivers, etc... Can someone guide on how to solve this?

    Hi, my Ipod Schuffle (4 gen) dissapears from windows vista right after I execute Itunes, I've change the drive letter, erase temps in App data file, verified USB drivers, etc... Can someone guide on how to solve this?

    If you want the shuffle to be always visible in Windows (outside of iTunes), you need to Enable disk use.
    Select the shuffle in the iTunes sidebar, under DEVICES.  Over to the right, select the Summary tab.  You should see a checkbox that says Enable disk use.  Check it and click Apply.
    NOTE:  If disk use is enabled, you have to Eject the shuffle in iTunes, BEFORE you physically disconnect it.  If disk use is NOT enabled, you can disconnect the shuffle at any time, as long as iTunes is not doing something with it at that moment (such as syncing); the shuffle's light will then be blinking (to indicate DO NOT DISCONNECT).
    So, unless you want to use the shuffle like a USB flash drive (carry random files on it), you may want to NOT Enable disk use.

  • I'm using windows 8 on my pc, and i have just downloaded the latest version of itunes, after i upgraded the latest version of itunes, it can't detect my iphone, but my windows/my pc does. Anyone knows how to solve this problem?

    I'm using windows 8 on my pc, and i have just downloaded the latest version of itunes, after i upgraded the latest version of itunes, it can't detect my iphone, but my windows/my pc does. Anyone knows how to solve this problem?

    Hi jstutsman,
    If you are having issues with your iPod nano not being recognized in iTunes after a recent update, you may find the steps and links listed in the following article helpful:
    iPod not appearing in iTunes - Apple Support
    Regards,
    - Brenden

Maybe you are looking for