Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8860763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:19:54+00:00 2026-06-14T15:19:54+00:00

I am using Lightview 3 to display an image within an iframe. This has

  • 0

I am using Lightview 3 to display an image within an iframe. This has a form that allows the user to zoom in and out of the image and submit the form to generate a thumbnail based on the image in view when the form has been submitted.

The issue I have is that we have to use massive images (width 1100px+) etc.. so having this open in a lightview doesn’t really look great as you have scrolling bars within the iframe.

What is the best way to have the image displayed at half of its size and using some form of scaling when it does create the thumbnail of the fullsize image correctly. Can anyone suggest some methods to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:19:56+00:00Added an answer on June 14, 2026 at 3:19 pm

    I have done this type of thing many times. My environment is ASP.NET using Visual Basic and the technologies I used to achieve my desired result where FancyBox, JCrop, and Uploadify.

    First I set up FancyBox (haven’t used FancyBox2 yet) to open a modal popup window with a iframe with a page that has a preview area (344×270 in my case) and a place to upload an image using uploadify.

    Once an image is uploaded, validated, and thumbnail created I create an object that holds information about this image. This includes file name, extension, original width and height, and a new width and height to scale the image to fit my 344×270 preview (cropbox) area.

    To find this new width and height I use the following code written in VB.NET:

    Dim objImage As System.Drawing.Image = System.Drawing.Image.FromFile(path)
    Dim orig_h = objImage.Height
    Dim orig_w = objImage.Width
    Dim cropbox_width, cropbox_height As Integer
    If objImage.Width > objImage.Height Then
        cropbox_width = 344
        cropbox_height = (344 / objImage.Width) * objImage.Height
    
        If cropbox_height > 270 Then
            Do Until cropbox_height <= 270
                 cropbox_width = cropbox_width - 1
                 cropbox_height = (cropbox_width / objImage.Width) * objImage.Height
             Loop
         End If
     Else
        cropbox_height = 270
        cropbox_width = (270 / objImage.Height) * objImage.Width
    
        If cropbox_width > 344 Then
            Do Until cropbox_width <= 344
                   cropbox_height = cropbox_height - 1
                   cropbox_width = (cropbox_height / objImage.Height) * objImage.Width
             Loop
         End If
      End If
    

    Basically, I’m trying to determine if its portrait or landscape then find the aspect ratio to scale it down to fit my preview (cropbox) area.

    Once this is determined I add them to my object, serialize it and send it back to the upload page (FancyBox iframe), set the image path of the preview (cropbox) area, set it’s height and width from the returned object, store the original height and width, and then initiate JCrop.

    From here they can crop the image for which I have code to crop the original based on how they have cropped the preview image. I won’t go over this code and technique because you didn’t ask about cropping.

    I know this isn’t exactly what you asked for since it sounds like there will be no uploading or cropping going on, but I thought my code for scaling the image down might point you in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to display an avatar of user that wrote a comment. I'm using
I am using listview to display data, inside listview i am using image in
I am using listview to display data, inside listview i am using image in
I am using a ListView to load and display thumbnails for image files. The
I am attempting to print out a line which contains an image tag within
I'm using this method to display a table and its content from SQLite on
I am using listview to display three textviews(values for these text views where come
I have a ListView which is using a GridView to display a DataTable and
I am trying to display images in a WinForms ListView that is in details
I'm pulling some data from DB, and need to display it in form of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.