How to import a picture into a Psd file using codes?

I'm trying to import a picture into a psd file as a new layer, but i can't find the method of photoshop object in visual studio 2010 object browser. Is it possible to do this job using vb.net codes?
Any suggestion will be gratuated!

I beleive Michael L Hale stated that he used the ScriptListener to generate code for PhotoShop "menu File>Place".  Many things can not be done through in Photoshop Scripting through the Adobe's normal scripting methods Adobe provided for scripting.  However Adobe also supplied  the ScriptListener.8li plugin which when installed is a bit like the actions palette's action recorded without controls.  Everthing that can be recorded in Photoshop is written to two files on your desktop in script code one in Javascript the other VBS.  The Script code use an Action Manager Method so thing not posible with normal scripting methods can be use in scripts.  The only way to start and stop recording these two script files it to install ScriptListener.8li before you start Photoshop and to uninstall it after you exit Photoshop. Awarkward but better then nothing there is no logic just step, step, step like actions and the code is not all that readable.  However you can take that code and modify it to use vars to turn steps into javascript functions and whatever VBS uses.
For example Place
REM =======================================================
DIM objApp
SET objApp = CreateObject("Photoshop.Application")
REM Use dialog mode 3 for show no dialogs
DIM dialogMode
dialogMode = 3
DIM idPlc
idPlc = objApp.CharIDToTypeID( "Plc " )
    DIM desc3
    SET desc3 = CreateObject( "Photoshop.ActionDescriptor" )
    DIM idnull
    idnull = objApp.CharIDToTypeID( "null" )
    Call desc3.PutPath( idnull, "D:\\Temp\\Portrait\\dsc6234.psd" )
    DIM idFTcs
    idFTcs = objApp.CharIDToTypeID( "FTcs" )
    DIM idQCSt
    idQCSt = objApp.CharIDToTypeID( "QCSt" )
    DIM idQcsa
    idQcsa = objApp.CharIDToTypeID( "Qcsa" )
    Call desc3.PutEnumerated( idFTcs, idQCSt, idQcsa )
    DIM idOfst
    idOfst = objApp.CharIDToTypeID( "Ofst" )
        DIM desc4
        SET desc4 = CreateObject( "Photoshop.ActionDescriptor" )
        DIM idHrzn
        idHrzn = objApp.CharIDToTypeID( "Hrzn" )
        DIM idRlt
        idRlt = objApp.CharIDToTypeID( "#Rlt" )
        Call desc4.PutUnitDouble( idHrzn, idRlt, 0.000000 )
        DIM idVrtc
        idVrtc = objApp.CharIDToTypeID( "Vrtc" )
        DIM idRlt
        idRlt = objApp.CharIDToTypeID( "#Rlt" )
        Call desc4.PutUnitDouble( idVrtc, idRlt, 0.000000 )
    DIM idOfst
    idOfst = objApp.CharIDToTypeID( "Ofst" )
    Call desc3.PutObject( idOfst, idOfst, desc4 )
Call objApp.ExecuteAction( idPlc, desc3, dialogMode )

Similar Messages

  • How to scan more pages into one PDF file using hP inkjet 2515

    Dear friend 
    How to scan more pages into one PDF file using hP inkjet 2515 

    Dear friend 
    How to scan more pages into one PDF file using hP inkjet 2515 

  • How to import an alpha channel from .PSD file?

    I have a photoshop file (.psd) with an alpha channel. When I import this file into AE, I do not see the alpha being available or perhaps I don't know how to find it. I've followed this instruction but nothing happens afterwards. Okay, so my question is, when I drop the .psd file into my comp, how or where do I enble the alpha channel?

    I am not sure this a bug.
    It could be. But note that I can produce an identical case in which this behavior is not a bug.
    The thing is, in the world of video applications, Alpha Channel means "fourth channel used to store transparency values".
    In Photoshop, it normally means the same thing, but it can also mean "arbitrary channel created and stored for whichever reason the user may want it on the future". Typically, to save a selection so that it can be retrieved later. In fact, you can have many of these arbitrary channels.
    So, imagine this scenario:
    1. User makes a selection of the outline of the house.
    2. Instead of cutting the pixels outside the house, or creating a layer mask, the user goes to the Channels panel and hits the "Save selection as channel" button (or equivalent menu command).
    Photoshop creates a fourth channel (or even a fifth or a sixth if there were additional channels already), which is called "Alpha" but the user never did anything to make the information in that channel produce transparency.
    If after making the selection, the user would have cutted pixels or created a layer mask, then that operation would be relfected on what we normally consider as Alpha channel.
    In this case, what you can do is go to channels pannel, control click the thumbnail so that the channel is loaded as selection, then create a layer mask (Layer > Layer Mask > Current selection) from that selection. That's it.

  • How to import legacy claims into Oracle Trade Management using API

    Oracle has provided OZF_Claim_PUB .create_claim API to create claim but there is no documentation about mandatory fields/examples. Please provide an example usage of API.

    I haven't used this particular API, but have used similar for claims. These API's are quite well documented in the doc:
    Oracle® Marketing
    API Reference Guide
    Release 11i
    Part No. B10587-01

  • How to edit/update data into an XML file using Flex and Actionscript

    I can read an external xml file, please see the code below:
    protected function button1_clickHandler(event:MouseEvent):void
    var GrowthChartsDataGrid:XML;
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest("../GrowthChartsDataGrid.xml");
        loader.load(request);
        loader.addEventListener(Event.COMPLETE, onComplete)
    function onComplete (event:Event)
         var loader:URLLoader = URLLoader(event.target);
         GrowthChartsDataGrid = new XML(loader.data);
         GrowthChartsDataGrid.GrowthChartGridView += <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>
         texttesting.text = GrowthChartsDataGrid.toString();
    I can read an XML file and can add an extra node and can display it in a text filed. But I want to update the XML file contents which will come from the txtMonth and txtWeight text boxes.
    Please any suggestions???

    First of all thanks for your quick reply .
    I actually want to add another node inthe xml file. Files is at a local location and i can read the file and add an extra node (but I cant store this extra node in the actual XML file). But I want to save XML with the extra node.
    For exmaple,
    my current xml is:
    <?xml version="1.0" encoding="utf-8"?>
    <GrowthChartGridView>
        <Month> 1
        <Weight>3.5</Weight></Month>
    <Month> 2
        <Weight>3.9</Weight></Month>
    <Month> 3
        <Weight>4.5</Weight></Month>
    </GrowthChartGridView>
    and at run time, I can create a new node using the data from two textboxes at button click event.
         GrowthChartsDataGrid.GrowthChartGridView += <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>
    Now what I want to do is, I want to add this node back in to my XML. Therefore, the result I am looking for is, my local XML should update like this.
    <?xml version="1.0" encoding="utf-8"?>
    <GrowthChartGridView>
        <Month> 1
        <Weight>3.5</Weight></Month>
    <Month> 2
        <Weight>3.9</Weight></Month>
    <Month> 3
        <Weight>4.5</Weight></Month>
    <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>  //I can read data from text boxes so its fine but I can not store this in to                                                                                                          my original XML
    </GrowthChartGridView>
    Thanks

  • How to import pictures into excel sheet without using report generation

    Dear Friends
    I want to know how to import the picture or picture file into excel sheet without using report generation..
    kindly come up with any suggestions or example code
    Regards
    Karthick
    Solved!
    Go to Solution.

    Thank you Rajesh 
    i am going through that vi
    Rajesh Nair wrote:
    Please go through below link
    http://zone.ni.com/devzone/cda/epd/p/id/3638
    Eventhough one subVI is missing i think it will be usefull for you.
    Regards
    Rajesh R.Nair
    Rajesh Nair wrote:
    Please go through below link

  • I have imported my pictures into aperture, how do I export into jpeg files so i can share files with friends who dont use aperture ?

    I have imported my pictures into aperture, how do I export into jpeg files so i can share files with friends who dont use aperture ?

    If you want the same export settings on some or all of the images you can select all that have the same export requirements and export them as a group.
    If all the images have the same requirements then you can select them all and run the export command.

  • Can you import more pictures into a photo book that is already in work?

    Can you import more pictures into a photo book that is already in work? I have already spent many hours trying to create a photo album but came across more pictures to choose from. However, I don't know how to get these new pictures into the "list" of potential photos for the book in progress. I can't stand the thought of having to start over by selecting the 2000 photos plus these new ones and starting all over again!?!

    I have found more pictures that I want to include. They are, say, in a folder on my desktop. I can't simply pull a picture (or the folder) from the desktop and insert it into the album or the list of potential pictures across the top.
    to import into an existing book (which is just a special kind of album) simply drag the photos from their source (the desktop in your example) to the book in the source pane on the left (not to the book in the library window but the book icon in the source pane
    Likewise to use photos from your iPhoto library just drag them from the library to the book
    I also tried imported the pictures, from the desktop folder, into iphoto, creating new event. I don't think there is a way of accessing that new event from the album in work/progress.
    Likewise to use photos from your iPhoto library just drag them from the library to the book in the source pane on the left
    I also tried merging the new "event" into an existing event that I had selected for the album. That doesn't work either???
    That is correct - there is no connection between the source of the book and the book - the book stands alone and you add direct to it in the source pane exactly as you would add to any other album
    LN

  • When i import my pictures into lightroom, they are blurry,  when i click develop they automatically

    when i import my pictures into lightroom, they are blurry,  when i click develop they automatically focus, but when i click library, they blur again...  i use canon and jpeg, why is this and how do i fix it?

    Yes,   in library ive zoomed into 1:1 and the image is nice and sharp, but when i zoomed out, the sharpness disapears and the image is blurry again.  I see a lot of people are having this problem. I also called adobe and talked to someone and they had no idea whats going on,

  • How do I place pictures into photo stream ?

    How do I place pictures into photo stream? (5s)

    Hi there Chirique,
    It looks like the article below may have the information you are looking for.
    iCloud: My Photo Stream FAQ
    http://support.apple.com/kb/HT4486
    -Griff W. 

  • I want to import a MS Word Index into a .pdf file using Adobe Pro.  How do I do that?

    I want to import a MS Word Index into a .pdf file using Adobe Pro. It is for a book.  The book has been converted to a .pdf for printing, but it needs an Index for the last page of the book.  I tried to embed a new index (starting from scratch but no luck.  Any suggestions?  Thank you for your time.

    Now I want to search this "myArrayStrings.get(r)" in another file. How to do that?Store the returned String. Do the same thing you did to read the first file to read the second file (i.e. read it in line-by-line and store the lines in a list). Then check if that list contains the String you stored from the first list.
    E.g. (using your code):
    String name = myArrayStrings.get(r); // assuming r is initialized somewhere before this
    if ( otherList.contains( name ) ) { // assuming otherList is your second list
        // do something
    }

  • How is it possible, that a pdf file turns into a psd file while sending with mail

    I have send a pdf file as attachment with mail. the file shows correctly as pdf file. but when the file arrived at the addressed location it turned into a psd file. in addition it seems there is a problem sending png and ai files. once those files have arrived through mail I am getting the feedback, that the files are are not scalable, they are fuzzy or completely messed up.
    has anyone an idea, where the problem comes from?
    thanks for response
    angelika

    Hello,
    toddisalive wrote:
    Additionally, I have found an AppleWorks file that could be the script, but it is ZERO bytes in size, and Pages won't even open it, saying that it is not a valid AppleWorks file.
    if the size of this file is really ZERO bytes, either the original file contained an empty data fork and a resource fork which was stored elsewhere (*) or the file is too damaged to retrieve anything. Moreover, as AppleWorks never generates file with empty data fork, at least to my knowledge, ....
    Concerning the Movie Magic ScreenWriter files, the application seems to exist for Yosemite http://www.write-bros.com/movie-magic-screenwriter.html ( but it seems "expensive"  and I do not know if it accepts to import old files )....
    (*) maybe in .TOTO or __MACOSX/.TOTO if the filename is TOTO

  • How to import epub/pdf into macvericks' ibooks ?

    how to import epub/pdf into macvericks' ibooks ?

    Placing the PDF into an InDesign document shouldn't be a problem, but if it is, please post back. What I think you're asking for is how to edit a PDF with InDesign, which can't be done. You would need the source document, edit that and then export to another PDF (if PDF is the end goal). There are some programs that can edit PDFs or convert PDFs to other formats (Word, InDesign, etc.), and they will work to one extent or another. You should expect to have to rework parts of it should you go that way. Keep in mind that PDF is generally considered a final document that isn't intended to be edited.

  • How to import the IDOC into Seeburger BIC mapping designer

    Hi All,
    Can u please tell me how to import the IDOC into Seeburger BIC mapping desginer.
    I have scenario My scenario is SAP GTS 7.0.....>Seeburger BIS.....>Atlas customs system for Germany
    Idoc coming from SAP GTS to Seeburger BIS and then convert to EDIFACT send
    to Atlas systeam.
    Regards,
    Ramesh.

    Hi Ramesh
    BIC is a tool from Seeburger to transmit the XML data to EDI and EDI to XML.
    Seeburger mapping programs for transferring the XML data to EDI data and EDI data to XML data, but not for the structure changing, in the IR your mapping program is same.
    Receiver side you need AS2 Adapter for converting data to EDI target structure. we have many EDI versions are available, for converting the EDI to XML or vice versa AS2 gives some default mapping programs, xml to EDI or EDI to XML convertion done through this mapping programs.
    Seeburger AS adapter provider provides some mapping programs(for example EDI4010 version or other), if you are using the same EDI version(4010) then you can use that mapping programs, if the version is different then we can manually generate the Seeburger X2E and E2X mappings for the corresponding version and signal(850 or 810 or ..), for this seeburger provides the mapping designer tool (BIC), there we can develope the X2E and E2X mapping programs and configure this in the Seeburger work bench.
    Regards
    Ramesh

  • How to import csv data into Oracle using c#

    Hello,
    How to import csv data into Oracle using c #. Where data to be imported 3GB in size and number of rows 7512263. I've managed to import csv data into Oracle, but the time it takes about 1 hour. How to speed up the time it takes to import csv data into oracle. Thank you.
    This is my code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    using System.Threading;
    using System.Text.RegularExpressions;
    using System.IO;
    using FileHelpers;
    using System.Data.OracleClient;
    namespace sqlloader
    class Program
    static void Main(string[] args)
    int jum;
    int i;
    bool isFirstLine = false;
    FileHelperEngine engine = new FileHelperEngine(typeof(XL_XDR));
    //Connect To Database
    string constr = "Data Source=(DESCRIPTION=(ADDRESS_LIST="
    + "(ADDRESS=(PROTOCOL=TCP)(HOST= pt-9a84825594af )(PORT=1521 )))"
    + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=o11g)));"
    + "User Id=xl;Password=rahasia;";
    OracleConnection con = new OracleConnection(constr);
    con.Open();
    // To Read Use:
    XL_XDR[] res = engine.ReadFile("DataOut.csv") as XL_XDR[];
    jum = CountLinesInFile("DataOut.csv");
    FileInfo f2 = new FileInfo("DataOut.csv");
    long s2 = f2.Length;
    int jmlRecord = jum - 1;
    for (i = 0; i < jum; i++)
    ShowPercentProgress("Processing...", i, jum);
    Thread.Sleep(100);
    if (isFirstLine == false)
    isFirstLine = true;
    else
    string sql = "INSERT INTO XL_XDR (XDR_ID, XDR_TYPE, SESSION_START_TIME, SESSION_END_TIME, SESSION_LAST_UPDATE_TIME, " +
    "SESSION_FLAG, VERSION, CONNECTION_ROW_COUNT, ERROR_CODE, METHOD, HOST_LEN, HOST, URL_LEN, URL, CONNECTION_START_TIME, " +
    "CONNECTION_LAST_UPDATE_TIME, CONNECTION_FLAG, CONNECTION_ID, TOTAL_EVENT_COUNT, TUNNEL_PAIR_ID, RESPONSIVENESS_TYPE, " +
    "CLIENT_PORT, PAYLOAD_TYPE, VIRTUAL_TYPE, VID_CLIENT, VID_SERVER, CLIENT_ADDR, SERVER_ADDR, CLIENT_TUNNEL_ADDR, " +
    "SERVER_TUNNEL_ADDR, ERROR_CODE_2, IPID, C2S_PKTS, C2S_OCTETS, S2C_PKTS, S2C_OCTETS, NUM_SUCC_TRANS, CONNECT_TIME, " +
    "TOTAL_RESP, TIMEOUTS, RETRIES, RAI, TCP_SYNS, TCP_SYN_ACKS, TCP_SYN_RESETS, TCP_SYN_FINS, EVENT_TYPE, FLAGS, TIME_STAMP, " +
    "EVENT_ID, EVENT_CODE) VALUES (" +
    "'" + res.XDR_ID + "', '" + res[i].XDR_TYPE + "', '" + res[i].SESSION_START_TIME + "', '" + res[i].SESSION_END_TIME + "', " +
    "'" + res[i].SESSION_LAST_UPDATE_TIME + "', '" + res[i].SESSION_FLAG + "', '" + res[i].VERSION + "', '" + res[i].CONNECTION_ROW_COUNT + "', " +
    "'" + res[i].ERROR_CODE + "', '" + res[i].METHOD + "', '" + res[i].HOST_LEN + "', '" + res[i].HOST + "', " +
    "'" + res[i].URL_LEN + "', '" + res[i].URL + "', '" + res[i].CONNECTION_START_TIME + "', '" + res[i].CONNECTION_LAST_UPDATE_TIME + "', " +
    "'" + res[i].CONNECTION_FLAG + "', '" + res[i].CONNECTION_ID + "', '" + res[i].TOTAL_EVENT_COUNT + "', '" + res[i].TUNNEL_PAIR_ID + "', " +
    "'" + res[i].RESPONSIVENESS_TYPE + "', '" + res[i].CLIENT_PORT + "', '" + res[i].PAYLOAD_TYPE + "', '" + res[i].VIRTUAL_TYPE + "', " +
    "'" + res[i].VID_CLIENT + "', '" + res[i].VID_SERVER + "', '" + res[i].CLIENT_ADDR + "', '" + res[i].SERVER_ADDR + "', " +
    "'" + res[i].CLIENT_TUNNEL_ADDR + "', '" + res[i].SERVER_TUNNEL_ADDR + "', '" + res[i].ERROR_CODE_2 + "', '" + res[i].IPID + "', " +
    "'" + res[i].C2S_PKTS + "', '" + res[i].C2S_OCTETS + "', '" + res[i].S2C_PKTS + "', '" + res[i].S2C_OCTETS + "', " +
    "'" + res[i].NUM_SUCC_TRANS + "', '" + res[i].CONNECT_TIME + "', '" + res[i].TOTAL_RESP + "', '" + res[i].TIMEOUTS + "', " +
    "'" + res[i].RETRIES + "', '" + res[i].RAI + "', '" + res[i].TCP_SYNS + "', '" + res[i].TCP_SYN_ACKS + "', " +
    "'" + res[i].TCP_SYN_RESETS + "', '" + res[i].TCP_SYN_FINS + "', '" + res[i].EVENT_TYPE + "', '" + res[i].FLAGS + "', " +
    "'" + res[i].TIME_STAMP + "', '" + res[i].EVENT_ID + "', '" + res[i].EVENT_CODE + "')";
    OracleCommand command = new OracleCommand(sql, con);
    command.ExecuteNonQuery();
    Console.WriteLine("Successfully Inserted");
    Console.WriteLine();
    Console.WriteLine("Number of Row Data: " + jmlRecord.ToString());
    Console.WriteLine();
    Console.WriteLine("The size of {0} is {1} bytes.", f2.Name, f2.Length);
    con.Close();
    static void ShowPercentProgress(string message, int currElementIndex, int totalElementCount)
    if (currElementIndex < 0 || currElementIndex >= totalElementCount)
    throw new InvalidOperationException("currElement out of range");
    int percent = (100 * (currElementIndex + 1)) / totalElementCount;
    Console.Write("\r{0}{1}% complete", message, percent);
    if (currElementIndex == totalElementCount - 1)
    Console.WriteLine(Environment.NewLine);
    static int CountLinesInFile(string f)
    int count = 0;
    using (StreamReader r = new StreamReader(f))
    string line;
    while ((line = r.ReadLine()) != null)
    count++;
    return count;
    [DelimitedRecord(",")]
    public class XL_XDR
    public string XDR_ID;
    public string XDR_TYPE;
    public string SESSION_START_TIME;
    public string SESSION_END_TIME;
    public string SESSION_LAST_UPDATE_TIME;
    public string SESSION_FLAG;
    public string VERSION;
    public string CONNECTION_ROW_COUNT;
    public string ERROR_CODE;
    public string METHOD;
    public string HOST_LEN;
    public string HOST;
    public string URL_LEN;
    public string URL;
    public string CONNECTION_START_TIME;
    public string CONNECTION_LAST_UPDATE_TIME;
    public string CONNECTION_FLAG;
    public string CONNECTION_ID;
    public string TOTAL_EVENT_COUNT;
    public string TUNNEL_PAIR_ID;
    public string RESPONSIVENESS_TYPE;
    public string CLIENT_PORT;
    public string PAYLOAD_TYPE;
    public string VIRTUAL_TYPE;
    public string VID_CLIENT;
    public string VID_SERVER;
    public string CLIENT_ADDR;
    public string SERVER_ADDR;
    public string CLIENT_TUNNEL_ADDR;
    public string SERVER_TUNNEL_ADDR;
    public string ERROR_CODE_2;
    public string IPID;
    public string C2S_PKTS;
    public string C2S_OCTETS;
    public string S2C_PKTS;
    public string S2C_OCTETS;
    public string NUM_SUCC_TRANS;
    public string CONNECT_TIME;
    public string TOTAL_RESP;
    public string TIMEOUTS;
    public string RETRIES;
    public string RAI;
    public string TCP_SYNS;
    public string TCP_SYN_ACKS;
    public string TCP_SYN_RESETS;
    public string TCP_SYN_FINS;
    public string EVENT_TYPE;
    public string FLAGS;
    public string TIME_STAMP;
    public string EVENT_ID;
    public string EVENT_CODE;
    I hope someone can give me a solution. Thanks

    The fastest way is to use external tables or sql loader (sqlldr). (If you use external tables or sql loader, you don't use C# at all).

Maybe you are looking for

  • Network drives ejecting for no reason

    I am setting up the office network and a few of the network drives keep ejecting for no reason. It's on a MAC/Windows network, and the Raid is a MEDEA brand RAID system. Thanks

  • Can't open file 2

    I have a finished project in indesign. It crashed and now it won't open and I'm freaking out. I'm new to Mac, and can't seem to either locate or open the autosave file.  The error message reads "can't open file, may not support format missing plug in

  • Network Issues After Update

    Today I decided to do a full pacman -Syu and I received a bunch of updates which it asked me to install. I went ahead as normal and everything seemed to install fine. However, upon rebooting the machine I found that the internet connection was acting

  • How much data canbe cache in SGA

    Hai everybody, my company using Oracle 11g 11.2.0.1.0 - Production database, my os is RHEL 5.5 ,my server's physical memory is 30.9 GB ( cat /proc/meminfo ) ie the SGA size [ (30.9*40/100)=12.5 GB ] so i use 12.5GB SGA size for one instance, we need

  • Vmware Server web UI stops working.

    I have installed Vmware Server from AUR. It seems like it works fine for a short time. I can access the web interface after the initial configuration is done. But the problem is that is suddenly stops responding after a while. I still have not got to