Here's my offer...

Moderators: Scott McCloud, Moderators
Images can indeed be shown in your posts. However, there is no facility at present for uploading images directly to this board. Therefore you must link to an image stored on a publicly accessible web server, e.g. http://www.some-unknown-place.net/my-picture.gif. You cannot link to pictures stored on your own PC (unless it is a publicly accessible server) nor to images stored behind authentication mechanisms such as Hotmail or Yahoo mailboxes, password-protected sites, etc.
Well...someone hasn't heard of ImageShackWillie wrote:![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Indeed. Also, a Google search shows a great list of places which offer free image hosting.Fett101 wrote:Well...someone hasn't heard of ImageShackWillie wrote:![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
Code: Select all
import javax.swing.*;
import java.awt.*;
import java.util.regex.Pattern;
public class DrawMcCloud extends JFrame {
public DrawingArea pic;
public DrawMcCloud(Dimension d) {
super("Drawing Scott McCloud");
pic = new DrawingArea(d);
getContentPane().add(pic);
pack();
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
private class DrawingArea extends JPanel {
private char[] type;
public String[] points;
public int[][][] param;
public Color[] colours;
private Pattern plusses = Pattern.compile(" ??\\+ ?");
private Pattern commas = Pattern.compile(" ??, ?");
public DrawingArea(Dimension d) {
setPreferredSize(d);
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
param = new int[points.length][][];
type = new char[points.length];
for (int i=0; i<points.length; i++) {
type[i] = points[i].charAt(0);
param[i] = parsePoints(points[i].substring(2));
}
for (int i=0; i<points.length; i++) {
g.setColor(colours[i]);
switch (type[i]) {
case 'p':
g.drawPolygon(param[i][0], param[i][1], param[i][0].length);
break;
case 'P':
g.fillPolygon(param[i][0], param[i][1], param[i][0].length);
break;
case 'o':
g.drawOval(param[i][0][0], param[i][1][0], param[i][0][1], param[i][1][1]);
break;
case 'O':
g.fillOval(param[i][0][0], param[i][1][0], param[i][0][1], param[i][1][1]);
break;
case 'r':
g.drawRect(param[i][0][0], param[i][1][0], param[i][0][1], param[i][1][1]);
break;
case 'R':
g.fillRect(param[i][0][0], param[i][1][0], param[i][0][1], param[i][1][1]);
break;
case 'a':
g.drawArc(param[i][0][0], param[i][1][0], param[i][0][1], param[i][1][1], param[i][0][2], param[i][1][2]);
break;
case 'A':
g.fillArc(param[i][0][0], param[i][1][0], param[i][0][1], param[i][1][1], param[i][0][2], param[i][1][2]);
break;
case 'l':
case 'L':
g.drawLine(param[i][0][0], param[i][1][0], param[i][0][1], param[i][1][1]);
break;
}
}
g.setFont(new Font("Garamond", Font.BOLD, 18));
g.drawString("Scott understands Java", 67, 35);
}
private int[][] parsePoints(String points) {
String[] holder = plusses.split(points);
int[][] param = new int[2][holder.length];
String[] point;
for (int i=0; i<holder.length; i++) {
point = commas.split(holder[i]);
param[0][i] = Integer.parseInt(point[0]);
param[1][i] = Integer.parseInt(point[1]);
}
return param;
}
}
public static Color shirtRed = new Color(251, 50, 0);
public static Color shirtGreen = new Color(102, 204, 104);
public static Color boltYellow = new Color(230, 230, 0);
public static Color javaCupBlue = new Color(92, 78, 199);
public static Color skinColour = new Color(255, 204, 153);
public static void main(String[] pointy) {
DrawingArea pic = new DrawMcCloud(new Dimension(350, 350)).pic;
pic.setBackground(new Color(184, 185, 153));
pic.points = new String[103];
pic.colours = new Color[103];
pic.colours[0] = shirtGreen;
pic.points[0] = "P:110,170+110,360+240,360+240,170+175,140";
pic.colours[1] = Color.black;
pic.points[1] = "p:110,170+110,360+240,360+240,170+175,140";
pic.colours[2] = Color.black;
pic.points[2] = "l:121,165+121,360";
pic.colours[3] = Color.black;
pic.points[3] = "l:133,160+133,360";
pic.colours[4] = Color.black;
pic.points[4] = "l:145,154+145,360";
pic.colours[5] = Color.black;
pic.points[5] = "l:205,154+205,360";
pic.colours[6] = Color.black;
pic.points[6] = "l:217,160+217,360";
pic.colours[7] = Color.black;
pic.points[7] = "l:229,165+229,360";
pic.colours[8] = Color.black;
pic.points[8] = "l:110,348+240,348";
pic.colours[9] = Color.black;
pic.points[9] = "l:110,336+240,336";
pic.colours[10] = Color.black;
pic.points[10] = "l:110,324+240,324";
pic.colours[11] = Color.black;
pic.points[11] = "l:110,312+240,312";
pic.colours[12] = Color.black;
pic.points[12] = "l:110,300+240,300";
pic.colours[13] = Color.black;
pic.points[13] = "l:110,288+240,288";
pic.colours[14] = Color.black;
pic.points[14] = "l:110,276+240,276";
pic.colours[15] = Color.black;
pic.points[15] = "l:110,264+240,264";
pic.colours[16] = Color.black;
pic.points[16] = "l:110,252+240,252";
pic.colours[17] = Color.black;
pic.points[17] = "l:110,240+240,240";
pic.colours[18] = Color.black;
pic.points[18] = "l:110,228+240,228";
pic.colours[19] = Color.black;
pic.points[19] = "l:110,216+240,216";
pic.colours[20] = Color.black;
pic.points[20] = "l:110,204+240,204";
pic.colours[21] = Color.black;
pic.points[21] = "l:110,192+240,192";
pic.colours[22] = Color.black;
pic.points[22] = "l:110,180+240,180";
pic.colours[23] = Color.black;
pic.points[23] = "l:113,168+237,168";
pic.colours[24] = Color.black;
pic.points[24] = "l:140,156+210,156";
pic.colours[25] = shirtGreen;
pic.points[25] = "P:110,170+50,320+140,335+140,305+90,296+110,246";
pic.colours[26] = Color.black;
pic.points[26] = "p:110,170+50,320+140,335+140,305+90,296+110,246";
pic.colours[27] = shirtGreen;
pic.points[27] = "P:240,170+300,320+210,335+210,305+260,296+240,246";
pic.colours[28] = Color.black;
pic.points[28] = "p:240,170+300,320+210,335+210,305+260,296+240,246";
pic.colours[29] = shirtRed;
pic.points[29] = "R:155,150+40,210";
pic.colours[30] = Color.black;
pic.points[30] = "r:155,150+40,210";
pic.colours[31] = boltYellow;
pic.points[31] = "P:190,170+164,205+175,203+160,230+186,195+175,197";
pic.colours[32] = Color.black;
pic.points[32] = "p:190,170+164,205+175,203+160,230+186,195+175,197";
pic.colours[33] = skinColour;
pic.points[33] = "O:140,110+10,20";
pic.colours[34] = Color.black;
pic.points[34] = "o:140,110+10,20";
pic.colours[35] = skinColour;
pic.points[35] = "O:200,110+10,20";
pic.colours[36] = Color.black;
pic.points[36] = "o:200,110+10,20";
pic.colours[37] = skinColour;
pic.points[37] = "O:145,80+60,80";
pic.colours[38] = Color.black;
pic.points[38] = "o:145,80+60,80";
pic.colours[39] = Color.black;
pic.points[39] = "l:110,197+60,322";
pic.colours[40] = Color.black;
pic.points[40] = "l:110,223+70,323";
pic.colours[41] = Color.black;
pic.points[41] = "l:91,297+80,324";
pic.colours[42] = Color.black;
pic.points[42] = "l:101,298+90,326";
pic.colours[43] = Color.black;
pic.points[43] = "l:111,299+100,327";
pic.colours[44] = Color.black;
pic.points[44] = "l:121,301+110,329";
pic.colours[45] = Color.black;
pic.points[45] = "l:130,303+120,331";
pic.colours[46] = Color.black;
pic.points[46] = "l:140,305+130,332";
pic.colours[47] = Color.black;
pic.points[47] = "l:240,197+290,322";
pic.colours[48] = Color.black;
pic.points[48] = "l:240,223+280,323";
pic.colours[49] = Color.black;
pic.points[49] = "l:259,297+270,324";
pic.colours[50] = Color.black;
pic.points[50] = "l:249,298+260,326";
pic.colours[51] = Color.black;
pic.points[51] = "l:239,299+250,327";
pic.colours[52] = Color.black;
pic.points[52] = "l:229,301+240,329";
pic.colours[53] = Color.black;
pic.points[53] = "l:220,303+230,331";
pic.colours[54] = Color.black;
pic.points[54] = "l:210,305+220,332";
pic.colours[55] = Color.black;
pic.points[55] = "l:54,310+140,324";
pic.colours[56] = Color.black;
pic.points[56] = "l:58,300+140,314";
pic.colours[57] = Color.black;
pic.points[57] = "l:62,290+90,295";
pic.colours[58] = Color.black;
pic.points[58] = "l:66,280+94,285";
pic.colours[59] = Color.black;
pic.points[59] = "l:70,270+98,275";
pic.colours[60] = Color.black;
pic.points[60] = "l:74,260+102,265";
pic.colours[61] = Color.black;
pic.points[61] = "l:78,250+106,255";
pic.colours[62] = Color.black;
pic.points[62] = "l:82,240+110,245";
pic.colours[63] = Color.black;
pic.points[63] = "l:86,230+110,234";
pic.colours[64] = Color.black;
pic.points[64] = "l:90,220+110,223";
pic.colours[65] = Color.black;
pic.points[65] = "l:94,210+110,213";
pic.colours[66] = Color.black;
pic.points[66] = "l:98,200+110,202";
pic.colours[67] = Color.black;
pic.points[67] = "l:102,190+110,191";
pic.colours[68] = Color.black;
pic.points[68] = "l:106,180+110,180";
pic.colours[69] = Color.black;
pic.points[69] = "l:296,310+210,324";
pic.colours[70] = Color.black;
pic.points[70] = "l:292,300+210,314";
pic.colours[71] = Color.black;
pic.points[71] = "l:288,290+260,295";
pic.colours[72] = Color.black;
pic.points[72] = "l:284,280+256,285";
pic.colours[73] = Color.black;
pic.points[73] = "l:280,270+252,275";
pic.colours[74] = Color.black;
pic.points[74] = "l:276,260+248,265";
pic.colours[75] = Color.black;
pic.points[75] = "l:272,250+244,255";
pic.colours[76] = Color.black;
pic.points[76] = "l:268,240+240,245";
pic.colours[77] = Color.black;
pic.points[77] = "l:264,230+240,234";
pic.colours[78] = Color.black;
pic.points[78] = "l:260,220+240,223";
pic.colours[79] = Color.black;
pic.points[79] = "l:256,210+240,213";
pic.colours[80] = Color.black;
pic.points[80] = "l:252,200+240,202";
pic.colours[81] = Color.black;
pic.points[81] = "l:248,190+240,191";
pic.colours[82] = Color.black;
pic.points[82] = "l:244,180+240,180";
pic.colours[83] = skinColour;
pic.points[83] = "P:140,315+143,305+150,300+147,317+155,321+175,321+175,328+155,328+140,325";
pic.colours[84] = Color.black;
pic.points[84] = "p:140,315+143,305+150,300+147,317+155,321+175,321+175,328+155,328+140,325";
pic.colours[85] = skinColour;
pic.points[85] = "P:210,315+207,305+200,300+203,317+195,321+175,321+175,328+195,328+210,325";
pic.colours[86] = Color.black;
pic.points[86] = "p:210,315+207,305+200,300+203,317+195,321+175,321+175,328+195,328+210,325";
pic.colours[87] = Color.black;
pic.points[87] = "A:145,90+20,40+80,120";
pic.colours[88] = Color.black;
pic.points[88] = "A:185,90+20,40+100,-120";
pic.colours[89] = Color.black;
pic.points[89] = "A:151,80+48,20+335,230";
pic.colours[90] = Color.black;
pic.points[90] = "A:152,77+20,20+180,90";
pic.colours[91] = Color.black;
pic.points[91] = "A:137,77+50,20+270,45";
pic.colours[92] = Color.white;
pic.points[92] = "O:148,103+25,25";
pic.colours[93] = Color.black;
pic.points[93] = "o:148,103+25,25";
pic.colours[94] = Color.white;
pic.points[94] = "O:177,103+25,25";
pic.colours[95] = Color.black;
pic.points[95] = "o:177,103+25,25";
pic.colours[96] = Color.black;
pic.points[96] = "a:165,140+20,10+200,140";
pic.colours[97] = Color.black;
pic.points[97] = "l:175,115+180,130";
pic.colours[98] = Color.black;
pic.points[98] = "l:180,130+174,130";
pic.colours[99] = javaCupBlue;
pic.points[99] = "P:170,318+165,313+165,303+185,303+185,313+180,318";
pic.colours[100] = Color.black;
pic.points[100] = "p:170,318+165,313+165,303+185,303+185,313+180,318";
pic.colours[101] = javaCupBlue;
pic.points[101] = "P:155,315+165,321+185,321+195,315+185,318+165,318";
pic.colours[102] = Color.black;
pic.points[102] = "p:155,315+165,321+185,321+195,315+185,318+165,318";
pic.repaint();
}
}