Announcement

Collapse
No announcement yet.

gbTweet Discusson

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

  • gbTweet Discusson

    I think the discussion of gbTweet has gotten broader than just the scope of "Invoke PHP Script", so I'm continuing it in this thread.

    The latest version is gbTweet v2, which now uses a RichEdit control to display the tweet history. This version is URL enabled. Download here.


  • #2
    In particular, I'd like to look into how I might modify gbTweet to send files/images, including displaying the images or thumbnails in gbTweet (within the RichEdit control).

    I've run across posts by Jose on, such as the one here, post #6, on the topic of ...

    How to implement the IRichEditOleCallback interface using the current PB native COM support ...
    I did a quick look at his code and it definitely allows using an image in the control. I did a quick drag and drop of an image into his example and the image showed right up.

    I need to look at his example more and see how I might apply it to what I want to do with gbTweet.

    Comment


    • #3
      As usual, Jose comes through. His post provided the direction I needed to allow gbTweet to support images. Here's an image of a version of gbTweet with an inserted image. I've added the OLE code version of gbTweet to the zip file, here. You're welcome to it but the OLE version is still in work.

      Next up is inserting an image at a location by code, rather than by pasting, and I need to look into how the PHP script can be used to receive/transfer an image.

      Click image for larger version

Name:	gbtweet3.jpg
Views:	1
Size:	32.4 KB
ID:	773523

      All I really did was include RichOLE.inc, insert Jose's code for the Class CRichEditOleCallback, and add these 3 lines of Jose's where the RichEdit was created ...

      Code:
         Local pRichEditOleCallback As IRichEditOleCallbackImpl
         pRichEditOleCallback = Class "CRichEditOleCallback"
         RichEdit_SetOleCallback hRichEdit, ObjPtr(pRichEditOleCallback)
      That was much simpler than I had expected ... well, after working with it for a couple of hours and making a dozen mistakes while using a DDT version ... then it was much simpler!

      Thanks, Jose!

      Comment


      • #4
        And, yes, Eric, I know that I'm talking to myself repeatedly. I'll try to keep it down.

        Comment


        • #5
          Hmm... looking at the About box example by Borje, as mentioned in this post by Anne, the solution there for loading images seems to be by loading an RTF file that contains the image.

          For gbTweet, I was thinking about having a tag within a text file, then replacing the tag with an image from a local file, from the internet via a URL, or from an embedded resource image - not using the clipboard if at all possible so as to avoid interference of gbTweet with other running actions by the user.

          For example, the characters : and ) might be replaced with , such as is done in forum posts or other messenger apps.

          ... adding to this a bit more ...

          I was thinking that regardless of the source (local file/embedded resource/internet URL, as specified by the text tag), I want to put the image into a memory bitmap then insert that memory bitmap at the location of a tag in the displayed text file, then remove the tag. I don't yet know if that's possible, but that's the direction I was thinking.

          Comment


          • #6
            That's true, Gary. The solution given by Borje and Jose involves loading an RTF file. This is an already prepared file containing all the images
            and it is done using MS Wordpad ( please don't use MS Word).

            https://forum.powerbasic.com/forum/u...772#post755772

            Comment


            • #7
              No success yet on finding a non-clipboard approach to inserting an image into a RichEdit control, but I did run across this, IRichEditOle::InsertObject method, which suggests an approach. Some info here on that method for inserting a file object, but not necessarily for an image object.

              I also ran across this comment from a 2000 thread ...

              Look into using OLE2 Client support. To insert the bitmap, create an embedded object
              from a file. OLE provides the OleCreateFromFile function call to make this easier.
              At least, it's point from which to continue searching.
              This suggests that when you create an REObject from a file, that the RichEdit control can recognize that the object is an image, and then display that image.

              It's a starting point for further searching!

              Comment


              • #8
                Gary. Would drag and drop help with an image getting an image. I know there are various image types. But really I cannot remember the last time i pasted an image in the clipboard, text all the time but not an image.
                p purvis

                Comment


                • #9
                  Paul,
                  When I drop an image on the RichEdit using Jose's code, the default image app icon is displayed, along with the image file name. I can then doubleclick on the app icon to open the image. I tried it on an Excel file and it worked that way too.

                  But in my case, I want the original text file to to contain sufficient information to insert the appropriate images. It's really not unlike an HTML file, where an IMG tag has that information.

                  I would expect to insert such a tag myself, such as "<img=paul.jpg>" or "<img=#234>" or "<img=http://www.garybeene.com/images/cowgirl.jpg>". At least that continues to be the intended means of embedding the file information in the text file, so that gbTweet can act on the tag and display the defined image.

                  But, I'm still searching for the solution to the image insertion. Documents like this one ... "Q220844: HOWTO: Insert a Bitmap Into RTF Document Using RichEdit Control" ... are convincing me that it's possible. This quote from that document:

                  ...IRichEditOle interface which, however, provides the InsertObject method. This requires a fully-populated RichEdit Object (REOBJECT) structure to be passed.
                  That's the focus of my search at the moment. Jose and Borje have both done work in this area, but I'm still sorting out what I'm finding.

                  Comment


                  • #10
                    Gary. As I am installing Windows 7. I see something called Microsoft Chat Active X. Sorry I don't have time to look into it but you might want to look into it with brief words I am seeing using gpedit.msc and adjusting some settings on our systems.
                    p purvis

                    Comment

                    Working...
                    X