Alpha DevCon 2018
Results 1 to 4 of 4

Thread: Is there a way to batch copy images from one database to another?

  1. #1
    Member preston2's Avatar
    Real Name
    Preston
    Join Date
    Nov 2011
    Posts
    763

    Default Is there a way to batch copy images from one database to another?

    Looked through all the docs and could not find a way to do this.

    Right now it seems I have to right click on each one, one at a time, and then select "copy to" and then specify the adb file to copy that one image to.

    I guess I could just keep doing that but it would be nice to not have to spend an hour or more doing that.

  2. #2
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,017

    Default Re: Is there a way to batch copy images from one database to another?

    I think this help can give the start point.
    from help.
    Manipulating Global Bitmaps

    Adding a Global Bitmap

    The code below creates a bitmap of a small red square and saves it in the database as RedSwatch.

    dim r as C

    dim g as C

    dim b as C

    dim rd as N

    dim gd as N

    dim bd as N

    dim d as P

    dim dn as C

    list = ""

    counter = 0

    hourglass_cursor(.t.)

    dn = a5.Get_Name()

    dn = stritran(dn,".adb",".alb")

    d = dictionary.open(dn,FILE_RW_EXCLUSIVE)

    ui_bitmap_create("tmpimg", .15,.15)

    ui_bitmap_draw("tmpimg", <<%code%

    set_brush("#255,0,255")

    inner_rect(0,0,.15,.15)

    set_brush("#255,0,0")

    set_pen("black")

    fill_rect(.025,.025,.1,.1)

    %code%)

    d.enter_begin()

    d.name = "RedSwatch"

    d.type = "GBMP"

    f = d.field_get("contents_m")

    b1 = ui_bitmap_save("tmpimg")

    f.value_put(b1)

    d.enter_end(.t.)

    d.close()

    hourglass_cursor(.f.)

    ControlPanel.Refresh()

  3. #3
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,123

    Default Re: Is there a way to batch copy images from one database to another?

    Images and scripts are in the control panel\app library. I have a tiny allocated application I call "shared_app" for the explicit purpose of holding both scripts and images that I want to have available all my applications. I then simply include this within the app I am working on and add the library of the "shared_app" to the app I am working on and the scripts and images are available to the current app.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  4. #4
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,373

    Default Re: Is there a way to batch copy images from one database to another?

    Hi Mike,
    I do it that way too. Initially you do need to copy the images and scripts to the adb you want to use as a library, but then you can add the alb file(s) from that adb to any other adb you want. Or you can make an aex file and add it to the addins_installed folder...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. How can you "batch-send" a bunch of emails from a database?
    By nlights in forum Application Server Version 11 - Web/Browser Applications
    Replies: 7
    Last Post: 06-30-2017, 04:23 PM
  2. Send Images in email after saving in database
    By Rajen334 in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 05-25-2016, 07:01 AM
  3. How to import Images into database
    By owenchaka in forum Alpha Five Version 10 - Desktop Applications
    Replies: 2
    Last Post: 02-17-2011, 11:54 AM
  4. Linking images in forms to database
    By Marcusk in forum Database Design
    Replies: 3
    Last Post: 10-26-2010, 05:31 PM
  5. batch copy
    By bhphoto47 in forum Alpha Five Version 4
    Replies: 1
    Last Post: 10-11-2001, 04:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •