How to create a bitmap from a FlashPro Shape?

CS Extension Builder n00b here.  I am looking for a way to generate a bitmap from a FlashPro Shape object.   The bitmap doesn't have to be a FlashPro Bitmap object... just an in-memory bitmap, or even a .png file on disc.  Any ideas on how to accomplish this?

Hi,
It's a two-step procedure:
First, plot the data on your canvas, probably using CanvasDrawPoint (, , ); there are three NI examples for Canvas: use Help / Find Examples
Second, you can save the canvas control to a file using SaveCtrlDisplayToFile from the toolbox library. As an alternative, you could use GetCtrlDisplayBitmap and then SaveBitmapToBMPFile.
Wolfgang

Similar Messages

  • How to get a bitmap from CNiGraph in VC++

    I want to get bitmap of measurement graph control somthing like the CVI function GetCtrlBitmap in VC++.
    I tried m_Graph.Images("Plot Area"), no function in CNiImage class to get bitmap, the same case for the CNiPicture class.

    For Visual C++ 6.0, I would recommend updating to a recent Platform SDK to get the GDI+
    C++ API. To create a bitmap from a graph with the GDI+ C++ API, first add
    this to your stdafx.h:
    #include "gdiplus.h"
    using namespace Gdiplus;
    #pragma comment(lib, "gdiplus.lib")
    Next, add the GetEncoderClsid helper function from the MSDN article Retrieving
    the Class Identifier for an Encoder to your project. Once you've updated
    the stdafx.h and added the GetEncoderClsid helper function to your project,
    the following example demonstrates how to do the equivalent of the previous
    example with the GDI+ C++ API:
    // Determine dimensions of the control.
    RECT controlBounds;
    graph.GetClientRect(&controlBounds);
    int bmpWidth = controlBounds.right - controlBounds.left;
    int bmpHeight = controlBounds.bottom - controlBounds.top;
    // Start GDI+
    ULONG_PTR gdiPlusToken;
    GdiplusStartupInput gdiPlusStartupInput;
    ::GdiplusStartup(&gdiPlusToken, &gdiPlusStartupInput, NULL);
    // Define a scope so that GDI+ objects will get cleaned-up before
    // GdiplusShutdown is called.
    // Create the bitmap with the same dimensions of the control.
    Bitmap bmp(bmpWidth, bmpHeight);
    // Create a GDI+ Metafile object for the enhanced metafile returned
    // by CNiGraph::ControlImage.
    CNiPicture controlImage = graph.ControlImage();
    Metafile controlMetafile(reinterpret_cast<HENHMETAFILE>(controlImage.Handle));
    // Draw the metafile to the bitmap with the control dimensions.
    std::auto_ptr<Graphics> pGraphics(Graphics::FromImage(&bmp));
    pGraphics->DrawImage(&controlMetafile, 0, 0, bmpWidth, bmpHeight);
    // Get the encoder CLSID for bitmaps.
    CLSID bmpClsid;
    ::GetEncoderClsid(L"image/bmp", &bmpClsid);
    // Save the bitmap to a file with the bitmap encoder CLSID.
    bmp.Save(L"C:\\graph.bmp", &bmpClsid);
    // Shutdown GDI+
    ::GdiplusShutdown(gdiPlusToken);
    - Elton

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • How to create an invoice from multiple sales doc.

    Hi,
    how to create an invoice from multiple sales doc.
    thanx,
    sourav

    hello, friend.
    assuming that your settings in VTFA and VTFL allow, you can create 1 invoice for many sales orders or deliveries by using VF04.  choose all documents that apply and click "collective billing document". 
    you can also click on "simulation" if you want to test if the combination is possible and the system will give you a split analysis if this is not possible.
    regards.

  • How to create set hierarchies from FI SL.

    Hi Experts,
    How to create set hierarchies from FI SL. Could you please tell me
    Step by step procedures or send to this mail id [email protected]
    Thanks
    Regards,
    Sathis.J

    Hi,
    FI-SL
    http://help.sap.com/saphelp_nw2004s/helpdata/en/28/5ccfbb45b01140a3b59298c267604f/frameset.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/41/65be27836d300ae10000000a114b54/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/ee/cd143c5db89b00e10000000a114084/frameset.htm
    Hope This Helps.
    Thanks,
    Sankar M

  • How to create database link from oracle to sql server

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal
    Hi Vishal,
    I found a lof of information regarding how to create a database link from Oracle to SQL Server, please see:
    https://www.google.co.in/?gws_rd=cr&ei=vd3XUvGFO8TgkAXqlYCADg#q=how+to+create+database+link+from+oracle+to+sql+server
    We discuss SQL Server related issue in this forum. If you have any more question regarding Oracle, please post it in Oracle communities forum for better support.
    Regards,
    Elvis Long
    TechNet Community Support

  • How to Create adf table from java bean

    Hi,
    How to Create adf table from java class (Not from ADF BC).
    Thanks
    Satya

    @vlsn -- you have to follow what shay said.
    Do the following in Model layer ::
    create a table property java class with your columns setters and getters like :
    *public class gridProps {*
    private int sno;
    private String orderNum;
    *public void setSno(int sno) {*
    this.sno = sno;
    *public int getSno() {*
    return sno;
    *public void setOrderNum(String orderNum) {*
    this.orderNum = orderNum;
    *public String getOrderNum() {*
    return orderNum;
    Create another table java class which will populate the values to your column values and return the collection :
    *public class gridPopulate {*
    private  List<gridProps> gridValues ;
    *public List<gridProps> setToGrid(ArrayList<ArrayList> valuesToSet) {*
    *if (valuesToSet == null) {*
    return gridValues;
    gridValues = new ArrayList<gridProps>();
    if(btnValue.equals("completeBtn"))
    return gridValues;
    for(ArrayList<String> tempArr:valuesToSet)
    gridProps gp = new gridProps();
    gp.setSno(Integer.valueOf(tempArr.get(0)));
    gp.setOrderNum(tempArr.get(1));
    return gridValues;
    Right click gridPopulate class and create this as data control.This class will be seen in Data control list.Under this data control,Drag the grid property collection(created earlier) to your page.Then execute your binding(gridPopulate) according to your logic.
    Thanks.(My jdev version 11.1.1.5.0)

  • How to create session id from different string controls

    how to create session id from different string controls

    fais,
    Please create the VI you are talking about and save some default data into all of the controls. Also on the front panel, place the session ID that should be generated by that data. Now, post your VI to a response so I can download it. I can then take this VI and help you create the functionality. (Please post what version of LabVIEW you are using.)
    My guess it that you are going to need to use a good number of string concatenations as well as a few string indexes to get parts of strings out. As for the date, you can use a Property node with the Numeric Text.Text property to get the actual string displayed on the front panel for the date and parse out the parts that you want.
    Randy Hoskin
    Applications Engineer
    National Instruments
    h
    ttp://www.ni.com/ask

  • How to create chord charts from midi using logic pro x

    How to create chord charts from midi using logic pro x

    Depending on what you mean by Chord charts (Tabs?)
    Use the Score.......
    http://help.apple.com/logicpro/mac/10/#lgcpf755d649

  • How to create dll file from c code to use in compactrio 9004 RT controller

    Hi.
    I am using Compactrio 9004 Real time controller and i am new to this. I have a C code and i want to use this with the RT controller.I red that that can be done by creating a dll file and can be called in labview.Can any body expalin how to create a DLL from the c code and be used with this RT controlelr?
    Regards,
    Vishnu

    vishnu123 wrote:
    Hi,
    Earlier in this forum itself in cRIO 900x controllers will run Pharlap and run C/C++ code compiled into .dll files.Can you please tell how to transfer the created DLL to RT controller memory throght FTP?
    Thanks and regards,
    Vishnu
    There is another KB article about this for Pharlap based controllers. And you are right the earlier CompactRIO controllers were Pharlap based. Basically for a deployed application to work, you need to put the DLL through FTP in "/ni-rt/system". If you deploy it directly from the project everything will be loaded into memory through the project environment itself including directly dependable DLLs, (but of course won't survive a power cycle).
    I hope you are aware that while Windows DLLs can work on Pharlap OS they by no means will do so always. The Pharlap OS has not a fully featured Windows API. Also you need to be careful which version of Visual C you are going to use depending on the Pharlap OS version, since the VC runtime DLLs already present on the controller will need to be the same as the ones your Visual C environment likes to link in. Recent Pharlap OS versions use the msvcr71.dll. It's very possible that those runtime libraries can't just simply be copied from a normal Windows installation but might have been recompiled by NI specifically for their controller targets.
    So to avoid problems it's a good idea to make sure your DLL uses the same runtime library DLL or make your DLL to include the static MS runtime.
    Rolf Kalbermatter
    Message Edited by rolfk on 02-05-2008 09:51 AM
    Message Edited by rolfk on 02-05-2008 09:53 AM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to create Default Schema from within the application

    Hi friends
    I am creating users using the following within my application using this syntax
    BEGIN
    APEX_UTIL.CREATE_USER
    (:P124_USER_ID, :P124_USER_NAME,:P124_USER_FIRST_NAME,:P124_USER_LAST_NAME,' ',:P124_USER_EMAIL_ID,'xxxx');
    END;
    The default workspace for the user is set as blanks. I would like to set it to be the default workspace as per the current logged in user.
    Can you help me with the syntax for this
    thank you in advance
    Laxmi

    Laxmi,
    The subject of the post is "How to create Default Schema from within the application".
    But your question asks how to set the "default workspace" for a newly created user.
    Those are different questions and not the ones I think you need answered.
    Let me answer this question "How can you set the default schema for an account when creating the account and set it to the same value used for the default schema attribute of the administrator account used to authenticate to the currently running application?".
    In the apex_util.create_user call use named parameter notation and fetch the information about the currently logged-in user first, e.g.,declare
      l_workspace               varchar2(256);
      l_user_name               varchar2(256);
      l_first_name              varchar2(256);
      l_last_name               varchar2(256);
      l_web_password            varchar2(256);
      l_email_address           varchar2(256);
      l_start_date              varchar2(256);
      l_end_date                varchar2(256);
      l_employee_id             varchar2(256);
      l_allow_access_to_schemas varchar2(256);
      l_person_type             varchar2(256);
      l_default_schema          varchar2(256);
      l_groups                  varchar2(256);
      l_developer_role          varchar2(256);
      l_description             varchar2(256);
    begin
    apex_util.fetch_user (
      p_user_id                  => apex_util.get_current_user_id,
      p_workspace                => l_workspace,
      p_user_name                => l_user_name,
      p_first_name               => l_first_name,
      p_last_name                => l_last_name,
      p_web_password             => l_web_password,
      p_email_address            => l_email_address,
      p_start_date               => l_start_date,
      p_end_date                 => l_end_date,
      p_employee_id              => l_employee_id,
      p_allow_access_to_schemas  => l_allow_access_to_schemas,
      p_person_type              => l_person_type,
      p_default_schema           => l_default_schema,
      p_groups                   => l_groups,
      p_developer_role           => l_developer_role,
      p_description              => l_description);
    apex_util.create_user(
      p_user_id        => :P124_USER_ID,
      p_user_name      => :P124_USER_NAME,
      p_first_name     => :P124_USER_FIRST_NAME,
      p_last_name      => :P124_USER_LAST_NAME,
      p_email_address  => :P124_USER_EMAIL_ID,
      p_web_password   => 'xxxx',
      p_default_schema => l_default_schema);
    end;Scott

  • How to create a Gradientcolor from two existing swatches

    Hello all,
    I have 2 colors in the swatches palette.has anyone how to create a new gradient color from this to swatches.
    So far I can get my to colors from the palette and extract their color:
    aSwatch1 = sAISwatchList->GetSwatchByName( colList, colorName1 );
    aSwatch2 = sAISwatchList->GetSwatchByName( colList, colorName1 );
    iErr = sAISwatchList->GetAIColor( aSwatch1, &colorP1);
    iErr = sAISwatchList->GetAIColor( aSwatch2, &colorP2);
    // now somehow create a new gradient:
    iErr = sAIGradient->NewGradient( &gradientHnd );
    but what do now. to get the new color from colorP1 and colorP2. I need a simple linear gradient.
    Any hints?
    regards
    Michael

    Hello,
    > Please, excuse any ignorance below. I'm not well versed in the actual artistic side of Illustrator, just the implementation
    excused because you're the one of the few people here who give thoe most usefull answers
    > Isn't that to be expected though? From my admittedly limited understanding, the gradient being saved is really just a sequence of colour stops. I would have thought since the angle of the gradient is more of a property of how its applied to the path (or whatever) that it wouldn't make sense to save it on the gradient colour.
    No, not from my view (and needs ).
    The color for the gradient has a type of AIGradientStyleMap. this struct contains the angle für the linear gradient etc. This color is added to the swatchpalette so it shoud keep the value.
    If you replace the CreateGradientSwatch function in SnpGradien.cpp of the SnippetRunner with the following code a 2nd swatch with an different angle is added to the swatchpalette when creating a new linear gradient is created (name seems not what it should but 2 swatches are created. Applying this 2 swatches to a rectangle also the angle is changed as it should be.
    So from my point of view Illustrator doesn't take the angle when a new color/swatch is created in the swatch panel. Why the angle is saved by creating a style is another question and difficult to answer without looking inside the source of Illustrator
    ASErr SnpGradient::CreateGradientSwatch(const AIGradientHandle gradient, AISwatchRef& swatch)
    ASErr result = kNoErr;
    try {
    // Insert new swatch at end of general swatch group.
    swatch = sAISwatchList->InsertNthSwatch(NULL, -1);
    // Get gradient name.
    ai::UnicodeString gradientName;
    result = sAIGradient->GetGradientName(gradient, gradientName);
    aisdk::check_ai_error(result);
    // Set swatch name.
    result = sAISwatchList->SetSwatchName(swatch, gradientName);
    aisdk::check_ai_error(result);
    // Create the swatch color using the gradient.
    AIColor swatchColor;
    swatchColor.kind = kGradient;
    swatchColor.c.b.gradient = gradient;
    swatchColor.c.b.gradientAngle = 30;
    swatchColor.c.b.gradientLength = 1;
    AIRealPoint origin = {0,0};
    swatchColor.c.b.gradientOrigin = origin;
    swatchColor.c.b.hiliteAngle = 0;
    swatchColor.c.b.hiliteLength = 0;
    SnippetRunnerLog::Instance()->WritePrintf("gradientAngle: %.1f",swatchColor.c.b.gradientAngle);
    SnippetRunnerLog::Instance()->WritePrintf("gradientLength: %.1f",swatchColor.c.b.gradientLength);
    SnippetRunnerLog::Instance()->WritePrintf("gradientOrigin (v / h): %.1f /  %.1f", swatchColor.c.b.gradientOrigin.v, swatchColor.c.b.gradientOrigin.h);
    SnippetRunnerLog::Instance()->WritePrintf("gradientAngle: %.1f",swatchColor.c.b.gradientAngle);
    SnippetRunnerLog::Instance()->WritePrintf("hiliteLength: %.1f",swatchColor.c.b.hiliteLength);
    // Set the swatch color.
    result = sAISwatchList->SetAIColor(swatch, &swatchColor);
    aisdk::check_ai_error(result);
    // making a 2nd swatch
    AISwatchRef swatch2;
    swatch2 = sAISwatchList->InsertNthSwatch(NULL, -1);
    result = sAISwatchList->SetSwatchName(swatch2, (ai::UnicodeString("Grad2")));
      // Create the swatch color using the gradient.
      AIColor swatchColor2;
      swatchColor2.kind = kGradient;
      swatchColor2.c.b.gradient = gradient;
      swatchColor2.c.b.gradientAngle = 60;
      swatchColor2.c.b.gradientLength = 1;
      swatchColor2.c.b.gradientOrigin = origin;
      swatchColor2.c.b.hiliteAngle = 0;
      swatchColor2.c.b.hiliteLength = 0;
    result = sAISwatchList->SetAIColor(swatch2, &swatchColor2);
    catch (ai::Error& ex) {
    result = ex;
    return result;
    The CS3/CS4 question is easy: for CS3 i use the CS3 SDK and for CS4 I#m working with the CS4 SDK :-)

  • How to create a Report from WebDympro

    Hi All,
    I just want to know how I can create a report from WebDynpro? I need to pull data from R/3 using a RFC function module, but I don't know if it exists a software to create reports.
    Thanks in advance
    Alexis Ramirez

    Hi Rich,
    Even i had a similar kind of problem. I wanted to fetch data from BI through the XMLA Connector which are created in Query Designer and then i wanted to fetch these fields and rearrange them and put it in a report format by colouring certain fields. Can the same can be done in WebDynpro.

  • Flash CS4 - how to create event flow from children to parents?

    In my opinion natural event flow direction is from children
    to its parants.
    E.g. when in dialog box buttons are pressed it is natural to
    inform only
    this dialog box about these actions. When dialog box can't
    handle particular
    event then passes it to its parent and so on .
    Unfortunately this direction is not well supported by Flash.
    To achieve
    support for this event direction it is necessary to call
    parent.dispatchEvent() with bubbling option off. This
    solution is
    inconvenient because sometimes I can't predict what event
    types will be
    triggered inside dialog components. Most likely there is no
    function to
    catch all events which have no defined handlers in dialog in
    order to be
    possible to pass them one level higher.
    Have you got any experience with building communication model
    between
    objects in Flash applications?
    Regards,
    Marek

    XML shema is basically an XML file. So u need to know how to create an XML,
    provided u know how the shema file should be.
    Creating an XML :
    http://forum.java.sun.com/thread.jspa?threadID=5181031&messageID=9705786#9705786

Maybe you are looking for