Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. import java.awt.BorderLayout;
  2. import java.awt.Color;
  3. import java.awt.Graphics;
  4. import java.awt.Graphics2D;
  5. import java.awt.image.BufferedImage;
  6. import java.io.File;
  7. import java.io.IOException;
  8.  
  9. import javax.imageio.ImageIO;
  10. import javax.swing.ImageIcon;
  11. import javax.swing.JFrame;
  12. import javax.swing.JLabel;
  13. import javax.swing.JPanel;
  14.  
  15.  
  16. public class scaler extends JPanel{
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. public void paint(Graphics g) {
  24.  
  25. int width = 1000;
  26. int height = 561;
  27.  
  28. BufferedImage img2 = null;
  29. try {
  30. img2 = ImageIO.read(new File("D:/Users/Ingeborg/Pictures/nrw2013/tef.png"));
  31. } catch (IOException e) {
  32. // TODO Auto-generated catch block
  33. e.printStackTrace();
  34. }
  35.  
  36. Graphics2D g2 = img2.createGraphics();
  37. g.drawImage(img2, 0, 0, width, height, null);
  38.  
  39. float spö[] = new float[78];
  40. float övp[] = new float[78];
  41. float fpö[] = new float[78];
  42. float bzö[] = new float[78];
  43. float grüne[] = new float[78];
  44. float frank[] = new float[78];
  45. float neos[] = new float[78];
  46. float kpö[] = new float[78];
  47. float pirat[] = new float[78];
  48.  
  49. spö[0] = 35.49F;
  50. övp[0] = 14.79F;
  51. fpö[0] = 25.24F;
  52. bzö[0] = 3.29F;
  53. grüne[0] = 7.45F;
  54. frank[0] = 7.91F;
  55. neos[0] = 2.99F;
  56. kpö[0] = 2.13F;
  57. pirat[0] = 0.49F;
  58.  
  59. int ds[] = new int[78];
  60.  
  61. ds[0] = img2.getRGB(767, 306); // Bruck-Mürzzuschlag
  62. ds[1] = img2.getRGB(745, 448); // Deutschlandsberg
  63. ds[2] = img2.getRGB(783, 400); // Graz
  64. ds[3] = img2.getRGB(756, 369); // Graz-Umgebung
  65. ds[4] = img2.getRGB(842, 361); // Hartberg-Fürstenfeld
  66. ds[5] = img2.getRGB(792, 462); // Leibnitz
  67. ds[6] = img2.getRGB(713, 341); // Leoben
  68. ds[7] = img2.getRGB(592, 332); // Liezen
  69. ds[8] = img2.getRGB(617, 382); // Murau
  70. ds[9] = img2.getRGB(686, 374); // Murtal
  71. ds[10] = img2.getRGB(838, 439); // Südoststeiermark
  72. ds[11] = img2.getRGB(738, 409); // Voitsberg
  73. ds[12] = img2.getRGB(807, 366); // Weiz
  74.  
  75. }
  76.  
  77.  
  78. public static void main(String[] args) {
  79.  
  80. JFrame frame = new JFrame("AT Map");
  81. frame.add(new scaler());
  82. frame.setSize(1020, 601);
  83. frame.setLocation(12,12);
  84. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  85. frame.setVisible(true);
  86. }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement