Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

image file from clipboard data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    image file from clipboard data

    Code:
    	dim cc as C
    	dim bb as B
    	cc = clipboard.Get_Data(8)	
    	bb = char_to_blob(cc)	
    	file.From_blob(vyg_lbl_folder+"import.bmp",bb)
    From MS Paint I cut an image (to clipboard). I'm trying to get that clipboard data to an image file. I've been through the docs and the MB looking and trying various things and I just can't get it. Neither cc as C or B works. The "*" parameter is because the docs list this as bitmap data. No joy. Can anyone point me in the right direction please. Much appreciated.
    John Michaels
    "The only thing needed for evil to flourish is for good men to do nothing" - great quote but probably not Sir Edmund Burke

    #2
    Re: fimage file from clipboard data

    Years ago I did something similar however I used files. My script would open microsoft excel, copy a range of cells from a workbook page to the clipboard, paste the clipboard into paint, save the paint as a file and then enter the file into a field in a table.

    I found this in the help files. It worked perfectly. This may be a viable option.

    <FIELD>.MEMO_READ_FROM_FILE()
    Syntax
    <FIELD>.MEMO_READ_FROM_FILE( Filename as C [, Flag as N ] )
    <TABLE>.<FIELD>.MEMO_READ_FROM_FILE( Filename as C [, Flag as N ] )
    Argument
    Description

    Filename
    A fully qualified file name.

    Flag
    Optional.

    Default = "" (Overwrite memo).

    MEMO_APPEND = Appends Filename to the existing memo, rather than overwriting it.


    Description

    The <FIELD>.MEMO_READ_FROM_FILE() method transfers the contents of a file to the memo or bitmap field referenced by the <FIELD> object pointer.

    This function is especially useful for putting Windows Bitmap files (.BMP) into bitmap image fields.

    Flag is an optional parameter that you can specify in the case of memo fields (not bitmap fields) to append the contents of the file to the existing memo, rather than overwriting it.

    Supported By Alpha Five Version 5 and Above

    Example
    This script inserts the selected bitmap file into the Picture field in a new record in the Library table.

    dim tbl as P
    filename = ui_get_file("Choose Bitmap", "Bitmaps(*.BMP)","","X")
    if (filename = "") then
    end
    end if

    tbl = table.current()
    tbl.enter_begin()
    tbl.description = filename
    tbl.picture.memo_read_from_file(filename)
    tbl.enter_end(.T.)
    parent.resynch()
    Alpha 5 Version 11
    AA Build 2999, Build 4269, Current Build
    DBF's and MySql
    Desktop, Web on the Desktop and WEB

    Ron Anusiewicz

    Comment


      #3
      Re: fimage file from clipboard data

      Ron, good to know about that method, but I am starting from cutting image data to the clipboard, wanting that data on the clipboard to get into an image file using xbasic.
      John Michaels
      "The only thing needed for evil to flourish is for good men to do nothing" - great quote but probably not Sir Edmund Burke

      Comment


        #4
        Re: fimage file from clipboard data

        Look at the Clipboard actions you can use. The clipboard contains whatever you have copied.

        Description

        The CLIPBOARD.GET_DATA() method gets data from the clipboard and stores it in Variable. The type of data retrieved from the clipboard is determined by Clipboard_Format. You can register a new Clipboard_Format value with the CLIPBOARD.REGISTER_TYPE() method.

        Supported By

        Alpha Five Version 5 and Above

        Limitations

        Desktop applications only.

        Example

        This script puts the record into change mode and writes data from the clipboard into the account_number field.

        tbl = table.current()

        tbl.change_begin()

        tbl.account_number = :clipboard.get_data()

        tbl.change_end(.T.)


        See Also

        CLIPBOARD Methods
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        Apologies to anyone I haven't managed to upset yet.
        You are held in a queue and I will get to you soon.

        Comment


          #5
          Re: fimage file from clipboard data

          John, I seem to recall trying to do this myself back in December 2011. For some reason I do not think I could get this to work. Hence, I took the file method. I do have a post dated 1-18-12 called "file.to_blob code works in Windows XP, doesn't work in Windows 7".

          I posted a test sample that you may want to down load and try. I don't remember all the details.

          Ron
          Alpha 5 Version 11
          AA Build 2999, Build 4269, Current Build
          DBF's and MySql
          Desktop, Web on the Desktop and WEB

          Ron Anusiewicz

          Comment


            #6
            Re: fimage file from clipboard data

            I came upon this thread, and since I had been part of the one Ron referenced without providing any help there, I thought I better do better. I found this great intermediary function that allows the clipboard data to be previewed, adjusted, and then capable of being made into a bmp or jpg file. Heck I've got lot's of uses for this!! Into the code library with this one!

            Steps: Cut an image to the clipboard and run this script

            Code:
            'set the file to be made from the clipboard image data
            	dim vf_new as C="C:\text_clip.jpg"
            	
            'acquire the image data from the clipboard, 
            	dim vblb as b
            	vblb=clipboard.Get_Data(8)
            	b2 = a5_image_transform(vblb)            ' <<<--- fun new function I found
            	
            'convert to jpg file
            	dim vjpg as B
            	vjpg = bitmap_to_jpeg(b2)
            	file.From_blob(vf_new,vjpg)
            
            'Query user to preview new jpg image file
            	dim vnR as N
            	vnR=ui_msg_box("PREVIEW IMAGE FILE","Preview the new image file now?",65)
            		if vnR=2
            			end
            		end if
            
            'load the selected image and view in dialog  
            	dim inow as C
            	dim rgb_data as B
            	f = file.open(vf_new,FILE_RO_SHARED)
            	ui_bitmap_load("inow",f.readb(10000000))
            	f.close()
            
            	ui_dlg_box("Image Preview",<<%dlg%
            	{lf};
            	{image=inow};
            	{lf};
            	<OK>;
            	%dlg%)
            Last edited by Mike Wilson; 11-24-2013, 05:15 PM.
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment

            Working...
            X