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 216817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:35:59+00:00 2026-05-11T18:35:59+00:00

I toying with a project where I can position objects runtime on the screen.

  • 0

I toying with a project where I can position objects runtime on the screen. I also have an small “preview”-window, where I want to see the outline of the objects.

I have an object array who have size and location on the “scene”. Now I want to loop through my scene-objects and create one picturebox in the preview-window for each object in the “scene”.

So, I have the size of the “Scene” and an array of the objects that are visible on the scene. Every object have an size and location mapped to the scene.

I also have a preview window that have an dynamic size. How do I create a preview that scales down to the preview window? To make it easy, I loop through the scene objects in the scene and create a picturebox on the preview-form for each object, that uses the preview-forms size to do the scaling.

SceneSize=new size(800,600) 
PreviewSize=new size(80,60) 

For each obj as SceneObject in Scene
   dim p as new picturebox
    p.size=?? scaling here (we have obj.size and obj.location)
    p.location=?? scaling here (we have obj.size and obj.location)
    previewWindow.controls.add (p)

next

Any example in .Net would be nice.

Thanks.

  • 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-05-11T18:35:59+00:00Added an answer on May 11, 2026 at 6:35 pm

    This did the trick, it wasn’t harder than that.

    Function GetPreviewRectangleForObject(ByVal ScreenSize As Size, ByVal PreviewSize As Size, ByVal OriginalRect As Rectangle) As Rectangle
        Dim xFactor As Integer = ScreenSize.Width / PreviewSize.Width
        Dim yFactor As Integer = ScreenSize.Height / PreviewSize.Height
        With OriginalRect
            Return New Rectangle(.X / xFactor, .Y / yFactor, .Width / xFactor, .Height / yFactor)
        End With
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 122k
  • Answers 122k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Inner classes are essentially a hack introduced in Java 1.1.… May 12, 2026 at 12:45 am
  • Editorial Team
    Editorial Team added an answer These links might be useful to you: Google Windows+CE+c+IDE Free… May 12, 2026 at 12:45 am
  • Editorial Team
    Editorial Team added an answer set /p dirname=<FILE cd %dirname% The documentation for set (for… May 12, 2026 at 12:45 am

Related Questions

SAP HR apparently has several models for describing the relationship between Position (S), Job
I am trying to work with TinyMCE in creating a multi-textbox, click-to-edit type graphical
I'll try to explain my problem the best I can, here goes: I have
I've got about 100 unit tests and with a coverage of %20, which I'm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.