Sign in to follow this  
Followers 0
Burgs

Placing images outside window bounderies?

1 post in this topic

Greetings,

The attached image is part of a GUI interface that contains a window setup with a background picture image of a bunch of hexes. I'm using the following script to attempt to place little orange 'plus signs' centered within each hex in the window. My problem is that only the first column of 'visible' (within the window area) hexes are being populated with the 'plus signs' (can be seen in the attached image)...the entire image with the hexes should have one orange 'plus sign' in each hex (a total of 2585 because there are 55 'COLUMNS' and 47 'ROWS' of hexes)...any ideas appreciated as to why it is not populating all the hexes...? Thank you in advance.

NOTE: The window containing the 'hex map' is 768 x 576, while the background image (the 'hexes') is 2048 x 2048 pixels...

...
Global $MapWidth = 768
Global $MapHeight = 576
Global $BEACON[2585] ;55 'COLUMNS' * 47 'ROWS'
Global $MapFile2 = "C:\Program Files\AppX\Maps\MapX.jpg"
...
Map_Window()
...
Func Map_Window()

Global $MapBack = GUICreate("", $MapWidth, $MapHeight, 0, 28, $WS_CHILD, -1, $MainGUI)
GUISetState(@SW_SHOW)

; background picture
$TheMap = GUICtrlCreatePic($MapFile2, 0, 0, 2048, 2048, -1, $WS_EX_CLIENTEDGE)
GUISetState(@SW_SHOW)

Local $MAP_COLUMNS = 55
Local $MARK_COUNT = 1
Local $MARK_mover = 1 ;determine "odd" or "even" column...0 = EVEN, 1 = ODD
Local $MARK_MAX = -1472
;this is the 'bottom edge' of the map (2048 x 2048)...value is MAP Y size (2048) - 'MAP_WINDOW' Y ($MapHeight) size (576)...map must be moved this value to 'scroll up'...
Local $X_adjust = 40
Local $Y_adjust = 42
Local $MARK_X_START = 49.75 ;start X PLOT for "1st" BEACON...
Local $MARK_Y_START = 2 ;start Y PLOT for "1st" BEACON...
Local $MARK_X_PLOT = $MARK_X_START
Local $MARK_Y_PLOT = $MARK_Y_START

For $x = 0 To UBound($BEACON) - 1
if $x <> 0 Then
if $MARK_COUNT <= $MAP_COLUMNS Then
if $MARK_Y_PLOT > $MARK_MAX Then $MARK_Y_PLOT += $Y_adjust
     ;$MARK_Y_PLOT > $MARK_MAX (add another Plus sign "below"...)
if $MARK_Y_PLOT <= $MARK_MAX Then
$MARK_X_PLOT = $MARK_X_START + ($X_adjust * $MARK_COUNT)
$MARK_Y_PLOT = $MARK_Y_START
$MARK_mover += 1
if $MARK_mover > 1 Then $MARK_mover = 0
if $MARK_mover == 0 Then $MARK_Y_PLOT += ($Y_adjust / 2)
$MARK_COUNT += 1; //increase counter...
EndIf ;$MARK_YPLOT <= $MARK_MAX (begin a new column...)
EndIf ;$x NOT 0
$BEACON[$x] = GUICtrlCreatePic("C:\Program Files\AppX\Plus.gif", $MARK_X_PLOT, $MARK_Y_PLOT, 11, 11, $SS_NOTIFY)
GuiCtrlSetState($BEACON[$x],$GUI_DISABLE)
EndIf ;$MARK_COUNT <= $MAP_COLUMNS...(not enough BEACONS placed...keep going)
Next
EndFunc

Share this post


Link to post
Share on other sites



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
Sign in to follow this  
Followers 0