Jump to content

Pressing some "parts" of a pic to show Info about it.


Recommended Posts

Hey guys,

Here is my script. See the Gui Below v v v Posted Image

Posted Image

Posted Image

And thats the Code of it :

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("World Map", 811, 659, 126, 18)
GUISetBkColor ( 0xFFFFFF )
$Pic1 = GUICtrlCreatePic("World Map.JPG", 8, 8, 793, 521 )
$Group1 = GUICtrlCreateGroup("Information", 8, 536, 793, 113)
$Label1 = GUICtrlCreatelabel("This is ...... etc ", 28, 556, 200, 40)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

World Map Pic : http://www.mapsofworld.com/images/world-map.jpg

I need your help ,guys , to do the following : :P

  • Press on , for Example , China to Display information about it in the information spaces below. ( I need to do the same for at least every big country there )
  • I want the region of Pressing area to be at least around the country's name.( like invisible rectangle/Circle around the name )
  • How Can I use the "Html" thing to Display like Bold, Colorful and maybe sized words .... I want this in stead this normal black label ... I think its like <bb> .... </bb> something like that .... Which command should i use ?
  • I want the pic to be inside the code of the Script i.e. no need to be in an external file to be called in AutoIt.
  • My Koda Version is not suitable with the constants of AutoIt v3.2.12.0 .... please link me to the lates one that works with v3.2.12.0 of AutoIt.
  • I want to Update/Change my script LINES after it compiled .... is there such a command line to do it ? and How , If yes ?
  • One last thing, I noticed that Upx is very easliy Decompiled by any newbie ... is there a better packer than that one ? ... please link me to it.
Please specify or Quote the Question you are going to answer. Those many question might sound like I want other people to do all the job for me ... Believe me, I tried my best to search and even figure it out myself before I ask them here. :P

Beside, I was waiting until I have like worthy Questions to ask about before I make my first topic here. I know that you prefer like one Question per one topic sometimes. I hope its not a problem this way. :)

Thanx for reading. :mad:

I Hope you can help me. :D

[quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]

Link to comment
Share on other sites

About Q1&2:

Try this:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("World Map", 811, 659, 126, 18)
GUISetBkColor ( 0xFFFFFF )
$Pic1 = GUICtrlCreatePic("World Map.JPG", 8, 8, 793, 521 )
$Group1 = GUICtrlCreateGroup("Information", 8, 536, 793, 113)
$Label1 = GUICtrlCreatelabel("Information will be shown here...", 28, 556, 200, 40)

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    $mousepos = MouseGetPos()
    $mouseposcolor = PixelGetColor( $mousepos[0], $mousepos[1] )
    $country = IniRead(@ScriptDir & "\COLORDEFINITIONS.ini", "COLOR DEFINITIONS", $mouseposcolor, "NotFound")
    If $country == "NotFound" Then
        $Label1 = GUICtrlCreatelabel("This country wasn't found in the Databank. Please Add the country with the Color: " & $mouseposcolor & ".", 28, 556, 200, 40)
    Else
        $Label1 = GUICtrlCreatelabel("This is " & $country & ".", 28, 556, 200, 40)
    EndIf
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

You also need a COLORDEFINITION.ini file that has all the colors in it..

[COLOR DEFINITIONS]
12445555 = "Russia"

That is what I made so far... and its working the only problem is you might need another map because that one hasn't always the same color for the countries.. the pixels have a lot difference...

and the text is flashin/flackerin??

you might add something that checks if the mouse was moved before all my code comes to action.. that might solve it... but right now im too tired to think of more :) hope I helped you a bit

byebye

Edited by Verox743

Started with AutoIt on 12th June, 2008.

Link to comment
Share on other sites

About Q1&2:

Try this:

.....

Nice Idea, Verox743 :)

Thanx for adding the lines to my script to make life easier for me ^^

I got the message ... I will try to fit the other countries in a way :P ...

2 Questions have been Answered .... 5 to go !! :P

Edited by Derak

[quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]

Link to comment
Share on other sites

The color ref idea is a good idea.

But if you use the image that you have posted then it'll be hit and miss on the colors, since the jpg image seems to have many pixel colors in just one color. (Zoom in on the image and you'll see what I mean).

If you would like to create a cleaner world map image, where you can specify the color for each country and once specified the country is just one color (even when zoomed in). Then look here http://english.freemap.jp/world_paint/world_paint.html.

It's free and quite a neat online paint your own world map.

Cheers

Link to comment
Share on other sites

The color ref idea is a good idea.

But if you use the image that you have posted then it'll be hit and miss on the colors, since the jpg image seems to have many pixel colors in just one color. (Zoom in on the image and you'll see what I mean).

If you would like to create a cleaner world map image, where you can specify the color for each country and once specified the country is just one color (even when zoomed in). Then look here http://english.freemap.jp/world_paint/world_paint.html.

It's free and quite a neat online paint your own world map.

Cheers

That's what i ment and there you go got your new world map :)

nice link you got there

Started with AutoIt on 12th June, 2008.

Link to comment
Share on other sites

The color ref idea is a good idea.

......

Nice map, smashly

Thanx for linking me to that painting site.

Really Helpful. :)

Still, 2 Questions have been Answered .... 5 to go !! :P

Edited by Derak

[quote]#include <AutoIt.au3> [indent]$Nothing = Impossible[/quote] [/indent]

Link to comment
Share on other sites

3. How Can I use the "Html" thing to Display like Bold, Colorful and maybe sized words .... I want this in stead this normal black label ... I think its like <bb> .... </bb> something like that .... Which command should i use ?

Use valuaters "Text Anywhere"

4. I want the pic to be inside the code of the Script i.e. no need to be in an external file to be called in AutoIt.

Check out Zedna's resource compiler, and do some searches on "compiling resources"

5. My Koda Version is not suitable with the constants of AutoIt v3.2.12.0 .... please link me to the lates one that works with v3.2.12.0 of AutoIt.

The link is on the main site.

6. I want to Update/Change my script LINES after it compiled .... is there such a command line to do it ? and How , If yes ?

Execute might be what you want. Just save your script and recompile if you have to change something. I don't think you're anywhere near the level of needing a dynamic interpreter tossed in.

7. One last thing, I noticed that Upx is very easliy Decompiled by any newbie ... is there a better packer than that one ? ... please link me to it.

AutoIt no longer has the decompiler for this version.
Link to comment
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
 Share

  • Recently Browsing   0 members

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