Quantcast
Channel: Adobe Community: Message List - Photoshop Scripting
Viewing all articles
Browse latest Browse all 27456

how to get any location of image color data?

$
0
0

// =======================================================

var idsetd = charIDToTypeID( "setd" );

    var desc1197 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref958 = new ActionReference();

        var idChnl = charIDToTypeID( "Chnl" );

        var idfsel = charIDToTypeID( "fsel" );

        ref958.putProperty( idChnl, idfsel );

    desc1197.putReference( idnull, ref958 );

    var idT = charIDToTypeID( "T   " );

        var desc1198 = new ActionDescriptor();

        var idTop = charIDToTypeID( "Top " );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc1198.putUnitDouble( idTop, idPxl, 1096.000000 );//i input Coordinate location data

        var idLeft = charIDToTypeID( "Left" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc1198.putUnitDouble( idLeft, idPxl, 2188.000000 );//i input Coordinate location data

        var idBtom = charIDToTypeID( "Btom" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc1198.putUnitDouble( idBtom, idPxl, 1097.000000 );//i input Coordinate location data

        var idRght = charIDToTypeID( "Rght" );

        var idPxl = charIDToTypeID( "#Pxl" );

        desc1198.putUnitDouble( idRght, idPxl, 2189.000000 );//i input Coordinate location data

    var idRctn = charIDToTypeID( "Rctn" );

    desc1197.putObject( idT, idRctn, desc1198 );

executeAction( idsetd, desc1197, DialogModes.NO );

 

 

// =======================================================

var idslct = charIDToTypeID( "slct" );

    var desc1199 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref959 = new ActionReference();

        var ideyedropperTool = stringIDToTypeID( "eyedropperTool" );

        ref959.putClass( ideyedropperTool );

    desc1199.putReference( idnull, ref959 );

    var iddontRecord = stringIDToTypeID( "dontRecord" );

    desc1199.putBoolean( iddontRecord, true );

    var idforceNotify = stringIDToTypeID( "forceNotify" );

    desc1199.putBoolean( idforceNotify, true );

executeAction( idslct, desc1199, DialogModes.NO );

 

 

// =======================================================

var idsetd = charIDToTypeID( "setd" );

    var desc1200 = new ActionDescriptor();

    var idnull = charIDToTypeID( "null" );

        var ref960 = new ActionReference();

        var idClr = charIDToTypeID( "Clr " );

        var idFrgC = charIDToTypeID( "FrgC" );

        ref960.putProperty( idClr, idFrgC );

    desc1200.putReference( idnull, ref960 );

    var idT = charIDToTypeID( "T   " );

        var desc1201 = new ActionDescriptor();

        var idCyn = charIDToTypeID( "Cyn " );

        desc1201.putDouble( idCyn, 55.290000 );//i want to get clor data, c=?

        var idMgnt = charIDToTypeID( "Mgnt" );

        desc1201.putDouble( idMgnt, 54.510000 );//i want to get clor data, m=?

        var idYlw = charIDToTypeID( "Ylw " );

        desc1201.putDouble( idYlw, 69.410000 );//i want to get clor data, y=?

        var idBlck = charIDToTypeID( "Blck" );

        desc1201.putDouble( idBlck, 43.140000 );////i want to get clor data, k=?

    var idCMYC = charIDToTypeID( "CMYC" );

    desc1200.putObject( idT, idCMYC, desc1201 );

    var idSrce = charIDToTypeID( "Srce" );

    desc1200.putString( idSrce, """eyeDropperSample""" );

executeAction( idsetd, desc1200, DialogModes.NO );

 

 

 

 

i draw Rectangle (1px x 1px)...i want to get any location of image color data, Can be achieved by javascript? pls help meUntitled-2.jpg


Viewing all articles
Browse latest Browse all 27456

Trending Articles