für eine Flugsimulation möchte ich eine Navigationskarte erstellen (Peilwinkel, Flugwege usw).
Zuerst die Karte selbst, sie soll mit den Pfeiltaten zoom und verschiebbar sein.
Hier habe ich einen Code gefunden der das so macht, dabei verliert meine Karte (PNG) aber sehr an Qualität.
Code: Select all
/*
* Arrow keys move image
* Shift + Arrow Up Zooms in
* Shift + Arrow Down Zooms out
*/
IfNotExist , %A_ScriptDir%\earth-img.jpg
URLDownloadToFile , http://upload.wikimedia.org/wikipedia/commons/thumb/9/97/The_Earth_seen_from_Apollo_17.jpg/1023px-The_Earth_seen_from_Apollo_17.jpg , earth-img.jpg
;Settings
vert := 305 ; vertical start position of img in gui
lat := 566 ; lateral start postition of img in gui
dist := 8 ; number of pixels per movement. Bigger numbers = faster movement.
size := 1023 ; Used as initial width and height of img (which is square)
;GUI
Gui , Color , 000000
Gui , Add , Picture , w%size% h-1 x%lat% y%vert%, earth-img.jpg
Gui , Show , w1375 h850 , Move the Earth
size := 240 ; Opens full res then resized to 240 by RedrawImage. If opened at 240 image would be pixelated when zoomed.
RedrawImage:
GuiControl, MoveDraw , Static1 , x%lat% y%vert% w%size% h%size%
Exit
GuiClose:
GuiEscape:
ExitApp
;HotKeys
Up::
vert-=dist ; shorthand for "vert := vert - dist"
goto RedrawImage
Down::
vert+=dist
goto RedrawImage
Left::
lat-=dist
goto RedrawImage
Right::
lat+=dist
goto RedrawImage
+Up:: ; zoom in
size+=(dist*2)
vert-=dist
lat-=dist
goto RedrawImage
+Down:: ; zoom out
size-=(dist*2)
vert+=dist
lat+=dist
goto RedrawImage
https://www.autohotkey.com/board/topic/98154-moving-an-image-with-arrow-keys/
wie bekomme ich eine bleibende Qualität der Karte?
Gruß Olaf