PictureBox Picture from Web (Internet) Image

Thank you for your help in advance.  I have been attempting to display a web image in a SAP UDO form using the following in C# but have not been successful:
I use this code section to initiate the picture item and bind them:
SAPbouiCOM.PictureBox oPictureBox;
oForm.DataSources.UserDataSources.Add("picsource", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 100);
oItem = oForm.Items.Item("30");
oPictureBox = (SAPbouiCOM.PictureBox)oItem.Specific;
oPictureBox.DataBind.SetBound(true, "", "picsource");
I first attempted to do it through datasource:
oForm.DataSources.UserDataSources.Item("picsource").ValueEx = "http://www.myfavoritesite.com/images/picture.jpg";
Next I tried using the .Picture (direct) method:
oPictureBox.Picture = "http://www.myfavoritesite.com/images/picture.jpg";
Neither method worked for me.  I able to have the Picture pull from any place on my computer or the network but am wondering if someone can show me a way to pull an image from a website.  Perhaps I cannot use a SAP object to do this?  Can I use a .NET object in a SAP form?  Thanks for any suggestions you can provide.

HI,
You can use an activeX object for it.
If somebody tell's me the Picturebox Class ID it can work, but see the following code:
  oItem = oForm.Items.Add("3", BoFormItemTypes.it_PICTURE)
        oItem.Width = 280
        oItem.Height = 300
        oItem.Top = 5
        oItem.Left = 5
        Dim url As String = "http://www.itelligence.hu/hu/images/header_compass_sharp.jpg"
        Dim oPictureBox As SAPbouiCOM.PictureBox = oItem.Specific
        oPictureBox.Picture = LoadPictureBoxFromWeb(url)
  Function LoadPictureBoxFromWeb(ByVal url As String) As String
        Try
            Dim FileName As String = url.Substring(url.LastIndexOf("/") + 1)
            FileName = String.Format("{0}\{1}", Windows.Forms.Application.StartupPath, FileName)
            Dim request As WebRequest = WebRequest.Create(url)
            Dim response As WebResponse = request.GetResponse()
            Dim oPictureBox As New System.Windows.Forms.PictureBox
            oPictureBox.SizeMode = PictureBoxSizeMode.AutoSize
            oPictureBox.Image = System.Drawing.Image.FromStream(response.GetResponseStream)
            oPictureBox.Image.Save(FileName)
            Return FileName
        Catch
            Return ""
        End Try
        Return True
    End Function
Regards,
J.

Similar Messages

  • How can I copy an image/picture from the internet into a word document

    I am trying to copy and paste an image or picture from the internet and insert it into a word document. I select and copy the image from the internet page. I then go to the word document and select past special. When I select 'paste special' it only allows text to be copied and no images or pictures. If I also try to drag the image and place it in the word document. It does not allow me to do so. Any suggestions to fix this issue?

    Considering this is a MS Word issue I'd recommend reposting to that forum. You can find one at:
    http://www.officeformac.com/productforums/
    Regards,
    Roger

  • How do I import pictures from the internet?  Which tutorial tells how?

    I've got this great computer that I absolutely love but I still don't know how to use so many things and I can''t seem to find what I need to know in the tutorials and manuals.
    I am still trying to figure out how to import pictures from web sources so that I can save them for reference or to share.
    How do I do this and where can I find the printed info?
    The only thing I can figure out right now is to print out the pic and then scan it back onto the desktop. I hope this is not the only way.
    Thanks for your help...
    Mac Pro Laptop Mac OS X (10.4.5)

    itzamirakul,
    In most cases, it is much simpler than you would think.
    In this case, all you need to do is click on the image and drag it out of the browser window to some location... your Desktop, or a folder on your Desktop.
    Scott

  • Download picture from web

    Hello everybody,
    I want to load a picture from the internet and used normal TCP-commands
    (TCPOpen, 'Get', TCPRead). Last week I found the following article
    (with vi):
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/b92648089952cdd386256d0f00792187?OpenDocument
    But now I'm stucked:
    When the internet address starts with "http://www."  then LabView
    gets the picture. When the internet address starts with a different
    name (i.e. not "www") LabView cannot find the picture even when the
    address uses the http-protocol
    ("http://images.chron.com/apps/comics/images/2005/12/5/Dilbert.133.g.gif"
    What to do?
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

    Hi All,
          JPG_to_picture didn't like this URL
    http://images.chron.com/apps/comics/images/2005/12/5/Dilbert.133.g.gif
    (Datasocket Read produces an error - nothing returned), but data was returned with the following URL
    http://images.chron.com/apps/comics/images/2005/12/5/Dilbert.133.g.gif[text]
    .. of course one would still have to deal with the GIF.text (like tst already said)
    Message Edited by Dynamik on 12-06-2005 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!

  • After upgrading to Yosemite (I don't have iPhoto anymore, only PHOTOS) my pictures will not import from my iPad or iPhone 5s or any picture from web, it shows "Database Error: failured to persist version"

    After upgrading to Yosemite (I don't have iPhoto anymore, only PHOTOS) my pictures will not import from my iPad or iPhone 5s or any picture from web, it shows "Database Error: failured to persist version".  Any help will be greatly appreciated.

    Sorry,
    Yes, the error message is exactly like that  ("Database error: failured to persist version")
    No photos will import at all.  I use USB to import from iPhone 5s or iPad 2. 
    About the difference?  iPhoto and Photos .  Are there two softwares?
    I also will like to merge and/or synchronize all my photos I had saved to iCloud backups, Macbook Pro,  iPhone 5s and iPad hard drives using iPhoto.  It's call iPhoto library.  At one point I turned off streaming. 
    Thanks again Larry HN.

  • Can't see my saved picture from the internet

    hi guys, i have one serious problem, i cant see my picture that has been saved before from the internet. so when i got a picture from google and i saved it, i cant find it in my "pictures" in the media categories on my playbook. do anyone knows where the playbook stores my saved picture from the internet? please help me T.T
    Solved!
    Go to Solution.

    hey entimp,thanks for your reply. but i found out that there are only "all pictures" and "wallpaper" within my pictures app, there isnt "downloads". what do you think??  

  • How do I cut and paste a picture from the Internet to PowerPoint on a Mac?

    HHow do I cut and paste a picture from the Internet to PowerPoint on a Mac?

    Kind of depends on where the picture is. Usually you can just select it and if you can move it you can drop it onto the desktop.
    You should always check usage rights when you use a picture off the Internet. If it's for a school project or personal then there should be no problem.
    Pictures that require a royalty fee are usually marked.

  • I'm having trouble importing pictures from the internet....when I drag the picture to the icon, it gives me the option to import all duplicates. Even when I click "NO", it STILL imports every picture I have imported AGAIN, including the new one! WHY??

    I'm having trouble importing pictures from the internet....when I drag the picture to the icon, it gives me the option to import all duplicates. Even when I click "NO", it STILL imports every picture I have imported AGAIN, including the new one! WHY??

    carolinechx wrote:
    i know the description may be a little bit too confusing
    Mostly because you are not using any capital letters or paragraph returns and your post is difficult to read.

  • How Do I Download Pictures from the Internet?

    This is the first time I've tried to download a picture from the internet with my new computer and the old right click method is not working.  I used to right click and get the dropdown menu with options for saving the picture.  How do I do this now?

    I get nothing when I control click.  Is there some new way to do this?  I really liked that function.  I actually just upgraded to Mavericks so I don't know if this problem is with Mountain Lion or Mavericks because I don't believe I have tried it with the new computer which came with Mountain Lion.  I had just Lion before.
    Never thought about drag and drop.  I will do do that, but I do like that right click thing. With my mouse, I can do nothing except move it around. Aren't there some other functions that a mouse can do....like right click?

  • How do you add a picture from the internet to Keynote

    I am trying to do a Keynote Presentation but don't know how to add pictures from internet

    Simplest way:
    1.Save the image you want from the internet on your desktop. Then just drag and drop it on your presentation.
    2. If you want, use a photo masterslide and drop the picture you want onto the standard picture the theme has.
         Then you can resize it if needed.
    3. Or: Insert -> Choose... -> and select your photo from your directory.

  • Saved pictures from the internet missing.

    Since downloading IOS8 I can't find pictures that I newley save from the internet. I clicked on two photos tonight and clicked the save photo option. When I went to the photo app they are nowhere to be found.

    right click, SAVE AS, choose download location on your Mac
    usually in the downloads folder
    Finder  > go > downloads

  • How do I stop my MacBook Air saving every picture from web sites I visit

    How do I stop my MacBook Air saving every picture from any websites I visit mainly cars

    What browser are you using?
    Have you tried a different browser?
    Ciao.

  • Saving pictures from web pages..is that possible

    Is it possible while viewing a picture on a web page..to save that image and send it to my email. I just got my iphone and Im not sure how to do that.??
    Thanks so much

    In a word, no.
    You cannot do so from a web page or with photos received via email.

  • Inserting Picture (from Web- through Webdav) to Word document using VSTO code

    Hi,
    I have been trying to insert an image/picture to current selection in word. with help of code -
    Microsoft.Office.Interop.Word.InlineShape s = this.Application.Selection.InlineShapes.AddPicture(
    @"http://127.0.0.1:9001/test/myimage.png", true, true, Type.Missing);
    This code works fine if image is on desktop or network shared location but some issues for URL exposed through Webdav.
    On inserting the picture word shows - "The linked image cannot be displayed....." message. If we close and open word document again then image appears properly.
    Some observations:
    1. If we use same option through Ribbon  "Insert -> Picture -> Enter path and click on "Link to File" then we get Prompt for Wevdav password (Only once, later Word caches it) and linked images appear properly.
    2. Updating the shape explicitly wouldnt help. 
    s.LinkFormat.Update();
    What we are looking for is, Does Ribbon "Insert" functionality do something additional to prompt Webdav authentication to cache? if we want to achieve the same? what needs to be invoked before we make call to AddPicture API?
    Thanks
    H

    Thanks for the response.. 
    No, when document is opened again, then you dont need to enter the password. 
    Somehow on document open event MS word knows how to retreive password from cookie for given domain.
    When you insert the image using ribbon -> insert picture option, 
    MS Word first looks into cache if the domain cokkie already available then bypass authentication/password prompt
    Otherwise it would show the prompt and store the cookie in cache again.
    The mystry is how MS-Word interacts with this "cached cookies"
    while doing more reading on this, it seems MS Word has been using Klink.dll for this kind of functionality https://support.microsoft.com/en-us/kb/899927 but it would be great if you can provide more pointers.
    >>Could you share an image link of Webdav?
    Since, it's my local webdav server, you would not be able to access the image link, may be you can upload an image to sharepoint (as sharepoint also supports webdav) and use that for reproducing this problem at your end.
    Thanks
    H

  • When trying to access pictures from web site upload (Blogger),access denied

    It's my first week using a Mac, so I'm a beginner. For some reason I can't access the pictures that I have loaded in iPhoto from websites (for uploading). Pictures that are not inside iPhoto load fine.
    I tried looking at my permissions settings, etc, but can't see any reason why it won't let me. I've seen two iterations of this. One type is that it greys out the iPhoto file so I can't click on it, and the other time it allows me to click on it but doesn't expland it (there is no triangle beside it indicating additional files inside).
    Accessing iPhoto directly allows me to get at every picture I have, and edit at will.
    Help would be greatly appreciated!

    Scubabear
    Welcome to the Apple Discussions.
    What version of iPhoto are you using? This sounds like an iPhoto v7 issue. (iPhoto Menu -> About iPhoto)
    There are three ways (at least) to get files from the iPhoto Window.
    1. *Drag and Drop*: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    2. *File -> Export*: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    3. *Show File*: Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.
    To upload to MySpace or any site that does not have an iPhoto Export Plug-in the recommended way is to Select the Pic in the iPhoto Window and go File -> Export and export the pic to the desktop, then upload from there. After the upload you can trash the pic on the desktop. It's only a copy and your original is safe in iPhoto.
    This is also true for emailing with Web-based services. If you're using Gmail you can use THIS
    If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser. Or, if you want to access the files with iPhoto not running, then create a Media Browser using Automator (takes about 10 seconds) or use THIS
    Also, for 10.5 users: If you use the extended Open or Attach dialogue (with Column View) you can scroll to the bottom of the Shortcuts and find the Media browser there. Select any pic you want from there.
    Regards
    TD

Maybe you are looking for

  • Limiting Swap File Usage

    i have an issue with my main drive, and whilst i am getting this sorted, in the meantime i have installed a new installation of mavericks onto a 16gb flash drive. now a usual fresh install of mavericks takes about 5.8gb and this should leave me a few

  • Trobule in saving log in file which is in my context path

    Hello all, i am facing problem while saving log into Log file from servlet. I am using Log4j library and eclipse as IDE. When i push any log information to log file, it make log file default to eclipse path not in my servlet context path. I am using

  • Final cut pro fcp 6.0.6 unexpected quit using OS 10.6.8

    Just upgraded to OS 10.6.8 and installed MacKeeper (big mistake) and FCP 6.0.8 quits during start up?  Trashed MacKeeper and re-installed everything but Final Cut Pro still quits during start up?  Everything else seems fine - any sugegstions about wh

  • Production Variance to sales order...

    Hi Experts, It is possible to settele Production Variance to sales order item(MTO with valuted sales order). The production order is created with reference to sales order.... Please someone tell me how can settele variance to sales order to view the

  • SOAP request being sent only half sometimes

    Hi All, Sometimes, the SOAP request being sent (By Clicking a Button) has all the fields filled with data like say for example, <doc:contact>                   <gen:gender>Female</gen:gender>                   <gen:firstName>FNAME</gen:firstName>