iOS Question webview scale to fit get small image

Discussion in 'iOS Questions' started by John Woodsmall, Jul 11, 2018 at 8:15 AM.

  1. John Woodsmall

    John Woodsmall Active Member Licensed User

    when i open a webview with scale to fit on i get a small image that can be expanded with
    fingers.

    if not scale to fit...it is too big and will not expand with fingers.

    how can i expand the size of the starting image?

    (i tried the wkwebview as well...same thing).
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    I guess that the web page itself is larger than the image. If it is a simple image then it will be simpler to download it with iHttpUtils2 and show it with ImageView.
     
  3. Osp

    Osp Member Licensed User

    I would recommend trying some css in the webview to scale the image, there is for example such things:
    background: url(greatimage.jpg); background-size: cover; //(or cntain) if you apply this rule for the html or maybe body or the element the image is "in" it should fill the whole view (if the parent element is filling the whole view as well).
     
  4. John Woodsmall

    John Woodsmall Active Member Licensed User

    i have the path to the image (it is dynamic so i get it from the httputils)
    how do i make the source for the imageview that path?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Code:
    Dim j As HttpJob
    j.Initialize(
    "", Me)
    j.Download(link here)
    Wait For (j) JobDone(j As HttpJob)
    If j.Success Then
       ImageView1.Bitmap = j.GetBitmap 
    'or better j.GetBitmapResize
    End If
    j.Release
     
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