Jump to content

Recommended Posts

Posted

I'm writing a simple prog to calculate the cutting lines for photographic mounts, displaying the results in a graphic. However, both teh graphic and the square drawn into it come out taller than their width when I run the script below.

Is this something to do with a cheap Dell on-board graphics card, or something wrong with my script - or what?

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

Opt('MustDeclareVars', 1)

    Local $msg, $inc, $i, $close, $main, $del

    $main = GUICreate("Mount Calculator",500,550)
    $close = GUICtrlCreateButton("Close", 50, 515, 50)

    GUICtrlCreateGraphic(50, 105, 400, 400)
    ;GUICtrlSetBkColor(-1, 0xf08080)
    GUICtrlSetColor(-1, 0xff)
    GUICtrlSetColor(-1, -1)


    ;GUICtrlSetGraphic(-1, $GUI_GR_HINT, 1)

    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xff00)
    GUICtrlSetBkColor(-1, 0xfdfdfd)
    GUICtrlSetGraphic(-1, $GUI_GR_RECT, 00, 00, 400 , 400)
    
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xf000000)
    GUICtrlSetGraphic(-1, $GUI_GR_RECT, 25, 25, 250, 250)

    GUISetState()
While 1
    ;Sleep(100)
    $msg = GUIGetMsg()

    Select 
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $close
Exit            
            
    EndSelect

Regards,

William

  • Moderators
Posted

saywell,

Must be your graphics card - they are both square on my monitor. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted (edited)

Thanks - I'll try it tonight on my home PC and see how it looks there.

William

[edit]

Update - yes, displays as a square on a 'proper' PC!

Edited by saywell
Posted

i can do so with resolution adjustments.

in 1024x768 its a square.

in 1280 x 800 they are slightly taller than wide.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

iamtheky,

So even though the doc specifies that if w=h then the result is a square, it really depends on device geometry?

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Posted

...was merely pointing out what I am seeing on my box.

I would imagine there is a much more fun reason that hopefully someone smart will explain very smartly.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Posted

I would think it creates a rectangle with heigth equal to width in pixels. How your PC displays that rectangle wouldn't have anything to do with the script, but more with the settings of your graphics adapter and monitor.

To test this you could fire up MS Paint and make a rectangle while pressing shift. If it does not come out square, your display setting are wrong.

First thing to check is if you are using the monitors native resolution, then you can look in the OSD of the display to see if the display settings might be distorting the image, and lastly you can check the same in your gfx adapter settings, provided it has such a setting.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...