Alpha Video Training
Results 1 to 11 of 11

Thread: text to image file data

  1. #1
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,198

    Default text to image file data

    We have a repository of data used as a library for assets for marketing materials. The majority are image files. I have a form with a BMP object that shows the file contents. When the file contents holds data that is in BMP format, all is good. What I need is to be able to show the file content when the data is a text file. Is there a method using xbasic code to convert data in a text file to bmp format data so the data in a text file can be viewed in a bmp object?
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

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

    Default Re: text to image file data

    Are the file extensions either BMP or TXT? If so couldn't you use a conditonal object on the form to test the type of file you need to display?
    Robin

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

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

    Default Re: text to image file data

    Hi Robin,
    The form for the asset table has 15 bitmap objects (see image). The button in the embedded browse "show" calls a script that changes the file name for each of the BMP objects display for the 15 sequential records. Yes I could overlay a second text object over the BMP object and have them both within conditional objects, but I rather not have to do all that. If there was a method to convert text to binary image file data, that would be much easier. The images presented are small, thumbnail files depicting the master high resolution library files. The button above each BMP object opens the master high resolution file.
    Attached Images Attached Images
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,358

    Default Re: text to image file data

    The only way I could find would be by running a Macro to launch paint and save the text as a bmp.
    Perhaps this coud be run outside AS
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  5. #5
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,198

    Default Re: text to image file data

    Hi Ted,
    If text data written to the clipboard could be pasted into Paint, yes, this could be a strategy, however, this isn't possible. I am wanting to not have to re-type the text into an image application then to be saved as an image file.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  6. #6
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,358

    Default Re: text to image file data

    Maybe I misunderstood Mike, but in my version of Paint, I can paste directly from the Clipboard into a new instance of Paint.
    I tested this using some script in a Word document, copy and paste and save as.Mike Wilson Image.bmp
    If you cannot get at the text, then that is more of a problem I must admit.

    I've not used macros for a while, but seem to remember that they can be pretty useful.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  7. #7
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,198

    Default Re: text to image file data

    Well Ted,
    You must have that very, very special version of Paint, or maybe copying text data to the Clipboard on your side of the pond works differently, but trying this in both XP version and Win 10 version of Paint brings no joy. Thanks for your efforts. I think I'll be going with users opening the text, performing a Print Screen, and processing that image data for the thumbnail from the clipboard data. I think it might be a workable alternative.
    Last edited by Mike Wilson; 08-05-2019 at 12:38 PM.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  8. #8
    "Certified" Alphaholic
    Real Name
    Finian Lennon
    Join Date
    Apr 2000
    Location
    Atlanta, GA
    Posts
    1,804

    Default Re: text to image file data

    Mike:

    Have you looked at the CHAR_TO_BLOB() function at all? I think you could use it and/or the UI_BITMAP_CREATE(), UI_BITMAP_DRAW() and FILE.TO_BLOB() functions to do what you want, unless I musunderstand what it is you're trying to do.
    Finian

  9. #9
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,358

    Default Re: text to image file data

    I should have said Win7 Mike.
    I'll try Win10.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  10. #10
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,198

    Default Re: text to image file data

    Hi Finian,
    Thanks for your thoughts. I played with the CHAR_TO_BLOB() a bit today and it holds some promise. Yet today I was confronted with the new request to be able to also capture assets from web pages that can be a mix of text and images. So I spent the day working the angle of screen prints to clipboard to blobs to image reduction scripts to openings in apps for cropping and file saving... I work though xdialogs, intricate dialogs, with scripting to present and modified images in the dialog, that supplies tremendous capabilities, and I am so, so close to getting to functionality to cover all the possibilities. If it wasn't a challenge it wouldn't be fun, right?
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  11. #11
    "Certified" Alphaholic
    Real Name
    Finian Lennon
    Join Date
    Apr 2000
    Location
    Atlanta, GA
    Posts
    1,804

    Default Re: text to image file data

    I've dealt with some of the things you mention - file size reduction, cropping and zooming and combining text and images. In the latter I write the details of a ticket to the top of the image of the materials we have purchased. The script is only 30 or 40 lines but it took me some time to wrap my head around how to apply the various functions to get the desired result. And I hope not to have to do so again!

    In the FWIW department, I have repurposed the old EzTwain scanning ActiveX as my vehicle for cropping and zoomimg. It's very easy to build theXdialog to display the image and the it eliminates the need for all the complexities involved in the low level functions in Alpha. I'm so glad I bought my own Eztwain license years ago and that ActiveX continues to sail along in Windows 10.
    Finian

Similar Threads

  1. Rebuilding Image File Reference data in a Db
    By Ted Giles in forum Windows Desktop Applications
    Replies: 18
    Last Post: 10-24-2017, 07:12 AM
  2. Image File Reference Field - show in a data bound Image on UX?
    By TheSmitchell in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 02-25-2016, 02:27 PM
  3. image file from clipboard data
    By john michaels in forum Alpha Five Version 11 - Desktop Applications
    Replies: 5
    Last Post: 11-24-2013, 05:08 PM
  4. Data entry for Image File Reference field
    By Sandy Garrett in forum Alpha Five Version 8
    Replies: 6
    Last Post: 10-27-2009, 09:39 PM
  5. Convert Text file to Data
    By popellis in forum Alpha Five Version 7
    Replies: 8
    Last Post: 01-26-2006, 08:20 AM

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
  •