Question:
Uhhh! Software and Programming help! Screen Size Control?
anonymous
2009-10-16 01:32:01 UTC
Hi,

For a very long time now I have been trying to find a tool, or software technique, or ... something that will allow me to make an adjustable screen. I know this seems like a simple thing to do, but i cannot find out how to do it.

For example, with a web browser, you have an adjustable screen where you can scroll and stuff. You can make the web page as large as you want. I am trying to get the same effect in a computer application.

Basically, in the end, I want to be able to make something like a game editor (Warcraft 3 world editor as an example), or something like autocad or labview (not the whole program obviously, but just the basic layout where you have the menu bars and stuff on top, and then the 'main screen you can drag things onto' in the middle.

As an example, I am looking for something like visual studio, where you can drag tools/ components onto a form. The problem is i don't know of a way to make the form (or any container on the form) be of 'infinite size'.

It does not have to be something of within visual studio. In can be any application/ tool/ library/ technique/ way of making a window of arbitrary and infinite size.

I think it is a simple question for anyone who develops applications.
Please someone help me with this question which I had for so long, or at least point me in the right direction.

Also, if anyone knows a good website where I can go to to learn more about software/ graphics/ application development stuff, please let me know.

Thanks in advance.
Three answers:
MarkG
2009-10-17 15:08:29 UTC
Not a difficult thing to do at all with VB. The basic technique is to use horizontal and verticle scroll bars to move the contents of the form.

Rather than move multiple objects at once it is common to first bundle them up into a container like a panel or group box, then move the group box.



For a game map that in which a portion is viewed in a window or form the map is much larger than the viweing window. The scroll bars are used to reposition the map in relation to the voewing window.



To illistrate what is happening consider looking at a paper road map through a card board tube. When you view the raod map up close you would only be able to see a small circular portion of the map at any given time. To look at the other parts of the map you would have to point the tube to a different part of teh map to look at another small circular section. OR keep the tube in the same position and move the map underneth the tub to look at a different part of the map.



It is this last technique of moving the map under the tube which is used in programming. The small viewing window corresponds to a carboard viewing tube in a fixed position. You then move the position of a container (the map) underneth to view a defferent section.



Here is some VB code to copy



CODE-------------------------------

Public Class Form1

'Place two panels onto form along with a HScroll bar

'at the bottom of the form

'Stretch out panel2 to the display size and stretch panel1 to a smaller

'size that will fit into panel2

'

'Cut panel1 and paste it insode of panel 2







Private Sub Form1_Load(ByVal sender As Object, _

ByVal e As System.EventArgs) _

Handles Me.Load

Dim bmp As Bitmap



'load a picture and convert it to a bitmap

bmp = CType(Image.FromFile( & _

"C:\Documents and Settings\" & _

"All Users\Documents\My Pictures\" & _

"Sample Pictures\Water lilies.jpg", True), Bitmap)





'get the image loaded in the picture box and assign it

'to a bitmap object to expose its size properties

Panel1.AutoSize = True



With PictureBox1

'using the size of the bitmap make the

'underlying panel container the same size

'and position it in the upper left corner of

'panel2

.SizeMode = PictureBoxSizeMode.AutoSize

.Image = bmp

.Width = bmp.Width

.Height = bmp.Height

.Top = 0

.Left = 0

End With





HScrollBar1.Minimum = 0

HScrollBar1.Maximum = (PictureBox1.Width)



End Sub



Private Sub HScrollBar1_ValueChanged(ByVal sender As Object, _

ByVal e As System.EventArgs) _

Handles HScrollBar1.ValueChanged

'As the scroll bar is moved right

'the panel1 object is repositioned to the left

'the * -1 makes the value negative so we are setting

'the left side of panel1 more negative (further left)

'one the x-axis

Panel1.Left = HScrollBar1.Value * -1

End Sub

End Class



END CODE---------------------



This example only has the horizontal scroll bar you can figure out how to make the vert scroll work. You may have to replace the path to the picture file depending on your system



I have used the underscores and ampersand (&) to wrap the long lines of code. You can remove these in VB if you want, I did this so YA would not chop them
Nick T
2009-10-16 09:24:32 UTC
It will depend on the language , available Libraries and Operating system.

On Windows, Using Microsoft Visual C++ a standard MDI or SDI window can have what ever "virtual" size you require, scroll bars will appear allowing you to navigate.
?
2009-10-16 08:55:13 UTC
You can change the settings in most programs options, once in the options look for windows or windowed mode, click it and it should close the full screen and become just like a normal windowed appliation.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...