Indigo Rose Software
  #1  
Old 09-26-2003
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
Grin Making an Image Browser

AutoPlay Media Studio 5.0 Knowledge Base

Making an Image Browser

Document ID: IR10046
The information in this article applies to:
  • AutoPlay Media Studio 5.0 Professional Edition

SUMMARY

This article describes how to make an image browser.

DISCUSSION

As an example, we will create an application that has the user select a folder on his drive, and then populates a listbox object with all of the *.png and *.jpg files within that directory. The user clicks on a file in the listbox object, and clicks the "Open" button to load the selected image into the image object.

  1. Create a project with two button objects, a listbox object, and an image object.

  2. Label Button1 "Load" and Button2 "Open".

  3. Insert the following code into the On Click event for Button1:
    --Disable listbox Updating

    ListBox.SetUpdate("ListBox1", false);

    --Get the desired folder to browse

    folder = Dialog.FolderBrowse("Open Folder", "C:\\");

    --populate tables with all the .jpg and .png files

    file_jpg = File.Find(folder, "*.jpg", false, false, nil);

    file_png = File.Find(folder, "*.png", false, false, nil);

    images = {file_jpg, file_png};

    --do the following for each file:

    for k in images do --loops through the different image types

    for j,file_path in images[k] do --loops through each image file

    --add the item to the listbox, with the name visible and path as data

    ListBox.AddItem("ListBox1", String.SplitPath(file_path).Filename, file_path);

    end

    end



    --Allow the listbox to display the updated content

    ListBox.SetUpdate("ListBox1", true);
  4. Insert the following code into the On Click event for Button2:
    selected = ListBox.GetSelected("ListBox1");  

    for j,k in selected do

    Image.Load("Image1", ListBox.GetItemData("ListBox1", k));

    end

KEYWORDS: AutoPlay Media Studio 5.0, Actions, Image, Set, Get, Opacity, Transparency


Last reviewed: September 26, 2003
Copyright © 2003 Indigo Rose Corporation. All rights reserved.
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On



All times are GMT -6. The time now is 08:49 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software