iOS Question cutting a part of a web page into another image

Discussion in 'iOS Questions' started by John Woodsmall, Apr 21, 2015.

  1. John Woodsmall

    John Woodsmall Active Member Licensed User

    I have a web page that displays fine. I need to cut a portion of it
    and display it as an image. Also I do not want to display the web page
    only the image that I have cut into an image.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. John Woodsmall

    John Woodsmall Active Member Licensed User

    all i know is :

    WebView2
    .LoadUrl(target0)
    i then display the page where webview2 is.
    So if you don't mind can you show me the simple steps to get the web page into an image
    that I can slice up and then show the image instead of the web page?

    I asume that I can the routines you pointed to...but how?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    This code saves the webview content to a bitmap:
    Code:
    Sub WebView1_PageFinished (Success As Boolean, Url As String)
       
    If Success Then
         
    Dim iv As ImageView
         iv.Initialize(
    "")
         iv.SetLayoutAnimated(
    0100, WebView1.Width, WebView1.Height)
         
    Dim cvs As Canvas
         cvs.Initialize(iv)
         cvs.DrawView(WebView1, cvs.TargetRect)
         cvs.Refresh
         
    Dim bmp As Bitmap = cvs.CreateBitmap
       
    End If
    End Sub
    Note that only the visible WebView content will be saved.
     
  5. John Woodsmall

    John Woodsmall Active Member Licensed User

    ok...i see...
    now how do i
    1.) slice the bmp (above) to match the "good_part" below
    2.) display the sliced bmp into a page as an image?
     

    Attached Files:

  6. Erel

    Erel Administrator Staff Member Licensed User

  7. John Woodsmall

    John Woodsmall Active Member Licensed User

    ok
    so somehow i am ment to call the drawbitmap subrountine above?
    from the webview1 sub above?
    and the canvus will then apear on the page?
    (as you can see I barely know the correct words to talk to you...but I am articulate in other lang.)
     
  8. John Woodsmall

    John Woodsmall Active Member Licensed User

    can you give me an example of a web page reached:WebView2.LoadUrl(target0)
    and then a script that saves(optains it) to an image and then a script that cuts the image
    as required and then displays that image to a page?

    thanks!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice