Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import javax.imageio.ImageIO;
- import javax.swing.ImageIcon;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- public class scaler extends JPanel{
- public void paint(Graphics g) {
- int width = 1000;
- int height = 561;
- BufferedImage img2 = null;
- try {
- img2 = ImageIO.read(new File("D:/Users/Ingeborg/Pictures/nrw2013/tef.png"));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- Graphics2D g2 = img2.createGraphics();
- g.drawImage(img2, 0, 0, width, height, null);
- float spö[] = new float[78];
- float övp[] = new float[78];
- float fpö[] = new float[78];
- float bzö[] = new float[78];
- float grüne[] = new float[78];
- float frank[] = new float[78];
- float neos[] = new float[78];
- float kpö[] = new float[78];
- float pirat[] = new float[78];
- spö[0] = 35.49F;
- övp[0] = 14.79F;
- fpö[0] = 25.24F;
- bzö[0] = 3.29F;
- grüne[0] = 7.45F;
- frank[0] = 7.91F;
- neos[0] = 2.99F;
- kpö[0] = 2.13F;
- pirat[0] = 0.49F;
- int ds[] = new int[78];
- ds[0] = img2.getRGB(767, 306); // Bruck-Mürzzuschlag
- ds[1] = img2.getRGB(745, 448); // Deutschlandsberg
- ds[2] = img2.getRGB(783, 400); // Graz
- ds[3] = img2.getRGB(756, 369); // Graz-Umgebung
- ds[4] = img2.getRGB(842, 361); // Hartberg-Fürstenfeld
- ds[5] = img2.getRGB(792, 462); // Leibnitz
- ds[6] = img2.getRGB(713, 341); // Leoben
- ds[7] = img2.getRGB(592, 332); // Liezen
- ds[8] = img2.getRGB(617, 382); // Murau
- ds[9] = img2.getRGB(686, 374); // Murtal
- ds[10] = img2.getRGB(838, 439); // Südoststeiermark
- ds[11] = img2.getRGB(738, 409); // Voitsberg
- ds[12] = img2.getRGB(807, 366); // Weiz
- }
- public static void main(String[] args) {
- JFrame frame = new JFrame("AT Map");
- frame.add(new scaler());
- frame.setSize(1020, 601);
- frame.setLocation(12,12);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement