zoukankan      html  css  js  c++  java
  • 图形预览小程序

    需求:

    请帮忙制作一个图形预览小程序,主要实现图形文件管理和动画预览功能:

    程序基本过程如下:

    执行程序,选择图形文件存放文件夹后,自动显示相关*.sch文件及动画脚本名

     

     

    实现代码:

     

    __fastcall TForm1::TForm1(TComponent* Owner)

        : TForm(Owner)

    {

    }

    //---------------------------------------------------------------------------

     

    void __fastcall TForm1::FileClick(TObject *Sender)

    {

        ListBox->Clear();

        TListItem * Item = File->InnerListView->Selected;

        if(Item) {

            UnicodeString fileName = File->Path + "\" + Item->Caption;

            UnicodeString directoryName = ChangeFileExt(fileName, ".files");

            if(DirectoryExists(directoryName)) {

                UnicodeString scriptXmlFileName = directoryName + "\DemoScript.xml";

                if(FileExists(scriptXmlFileName)) {

                    CbwXML * xml = new CbwXML(scriptXmlFileName, "CbwDemoScripts");

                    xml->Read();

                    CbwXmlNode * flowNode = xml->RootNode->NodeByName("Flows");

                    if(flowNode) {

                        for(int i = 0; i < flowNode->ElementNumber; ++i) {

                            CbwXmlNode * flowItem = flowNode->Elements(i);

                            UnicodeString description = flowItem->AttributeValueByName("description");

    ListBox->Items->Add(description);

    }

    }

                    delete xml;

    }

            }

    }

    }

    //---------------------------------------------------------------------------

    界面效果:

    有时间再完善一下,做个WIN7风格的资源管理器出来。

  • 相关阅读:
    启动Mysql后找不到服务或出现找不到指定文件
    WEB-MVC模式图示
    Java中Map集合的遍历方式
    sun.misc.BASE64Encoder找不到jar包的解决方法
    Tomcat常用的网站发布方式
    Sql Server查询行号
    Mysql下载安装问题
    【数学】环逆序
    【搜索】【the first editoral】OpenJudge 我是最快的马
    The First Blog
  • 原文地址:https://www.cnblogs.com/drgraph/p/3307274.html
Copyright © 2011-2022 走看看