Hi I wanted to draw a field like this photo which I have attached. I would appreciate your help. I have wrote so much now: for (int x = 2; x < 12; x++) { for (int y = 2; y <= 12; y++) { g.drawRect(40*x, 40*y, 40, 40); } } ![a61a6705a7f76105f8ebab3b38dd9dcd](/attachments/large/3/a61a6705a7f76105f8ebab3b38dd9dcd.jpg "a61a6705a7f76105f8ebab3b38dd9dcd")

Member Avatar
Member Avatar
+0 forum 3

Draw a group of shapes on the Tkinter GUI toolkit canvas and animate the group using the common tag names.

Member Avatar
+1 forum 0

Hi everyone, i need your help.. I want to draw a circle,square and rectangle on Jframe on a click of a button.. This program was asked in my test paper, i couldn't get it right though bt i wanna know what my mistake is.. Plz help me.. import javax.swing.*; import java.awt.*; import java.awt.event.*; public class CRS extends JFrame implements ActionListener { JButton b1,b2,b3; Graphics g; Container con; public CRS() { super("Draw Circle in JFrame"); con=getContentPane(); con.setLayout(new FlowLayout()); b1=new JButton("Circle"); b2=new JButton("Rectangle"); b3=new JButton("Square"); con.add(b1); con.add(b2); con.add(b3); b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); } public void Circle() { g.drawOval(50,50,100,100); } public void Rectangle() { …

Member Avatar
Member Avatar
+0 forum 1

how to draw 2 parallel line in visual baisc 6.0 which have same height.. suppose picture box height is 200 then first line starting cordinate is 0,100 and second line cordinate is 100,200.. how we draw..

Member Avatar
Member Avatar
+0 forum 2

I am writing a pure C based win32 applications. I have drawn line. Now i want to translate that line, move the line whereved user wants to move on screen. Then again I drawn another line, I am drawing multiple lines. I have created rectangle region for each line and trying to move the line. When I move the 2nd line over the 1st line on screen the 1st line is getting wiped out. Because I am InvalidateRect() of the rect for the line being moved, so when that rectangle is crossing the other line then the other line is …

Member Avatar
Member Avatar
+0 forum 1

You can draw a number of shapes directly on the PyGame window, and then save the drawing to an image file.

Member Avatar
+3 forum 0

Hithere, I need to take 12v DC from my computer to feed an amplifier. I know there is some red and black wires . But my question is 1.) is there enough current to feed my amplifier( may be 2 or 3 A). 2.) is there any problem to my smps or pc by doing this ?. Please help. Vinod chandran

Member Avatar
Member Avatar
+0 forum 3

Hi, I am given this assignment that should be run in Jython. The assignment says that the program consists of a Java application with a canvas and a textarea for turtle code. I need to create a Jython application that takes turtle code from the Java application, parses it with regular expressions and calls setPixel(x,y) in the Java application to draw a rectangle. the Java program ,setPixel(x, y) is used to control the painting and getCode() to get the code entered in to the turtle code textarea. These methods are both defined in the DYPL Java class. import Translater class …

Member Avatar
Member Avatar
+0 forum 8

I have one problem at the line 20-23. What I need is when the blue box touches the red rectangle, the blue box gets resetted (it goes back to where it starts). However, the problem is, it doesn't touch the red rectangle area properly. Any suggestions? Thanks in advance. float moveX, moveY; float speed = 2; float controlX, controlY; int square = 50; float rectHori = 120; float rectVert = 20; void setup() { size(400, 400); background(255); moveX = width/2; moveY = 50; reset(); } void draw() { background(255); rectMove(); rectControl(); if (dist(controlX, controlY, moveX, moveY) <= rectHori/2 + rectVert/2) …

Member Avatar
Member Avatar
+0 forum 6

A colorful look at the PySide GUI toolkit and its QPainter class and methods. Well commented and demonstrated with the drawing of a number of rectangles and the different ways to apply colors.

Member Avatar
+1 forum 0

Hey guys, I need a function that reads a text file and stores the character someway, (I am assuming a 2D Array would be best?) then a function that reads through the characters and if the char is something specific (like "X") then it would draw a square (QUAD) 10wx10h multiplied by the location. Example: XXXXXX X....X X....X X....X X....X XXXXXX Would draw: [][][][][][] [] [] [] [] [] [] [] [] [][][][][][] X is the square, and . is a space (Nothing there, it would be skipped) Im basically creating a map based on a text file. CODE SO …

Member Avatar
Member Avatar
+0 forum 7

Hi there I'm making a project to show how some of algorithms work. Basically i needed to show some drawing pixel by pixel. I made the code below and tried to run it <script> function init() { var paper = Raphael(10, 50, 800, 600); var arr = []; var j = 1; var i = 1; for (var x = 10; x < 800; x = x + 10) { arr[x] = []; for (var y = 50; y < 600; y = y + 10) { arr[x][y] = paper.circle(x, y, 5); } } return arr; } function setPixel(x, y,arr) …

Member Avatar
Member Avatar
+0 forum 3

how can i draw useing c++?

Member Avatar
Member Avatar
+0 forum 2

*Hello people of the DaniWebs! It's been a long time since I've been talking and asking here, under the name of **katmai539**. I've lost account information and also the email address linked to it. I haven't been active in the software development-branch for the past few years but recently I decided to pick up the old habit of coding some stuff, next to my awesome job as a cashier at the local supermarket monopolist Albert Heijn.* Now to BUSINESS! As you can see I'm still using **SDL** for a thing and another. I managed to compile a dll for sdl_draw …

Member Avatar
+0 forum 0

public static void drawIndentedLine (int spaces, String begin, int n, String middle, String end) It should print a single line, terminated with a newline, that begins with the specified number of spaces, followed by the begin string, followed by n copies of the middle string, followed by the end string. I dont know how to do this in eclipse any ideas ?

Member Avatar
Member Avatar
+0 forum 2

package cs1410; import javax.swing.*; public class P2 { public static void main(String []args) { drawDiamond(); } public static void drawDiamond() { int x,y,z; int a=1; String out="\n"; int i=Integer.parseInt(JOptionPane.showInputDialog("Enter your size")); if((i%2)!=0) { int in=(i/2)+(i%2); int bb=in-1; int b=bb+(bb-1); for(x=in;x>0;x--) { for(y=x;y>1;y--) out+=" "; for(z=0;z<a;z++) out+="*"; a+=2; out+="\n"; } for(x=0;x<in-1;x++) { for(y=x;y>=0;y--) out+=" "; for(z=0;z<b;z++) out+="*"; b-=2; out+="\n"; } System.out.print(out); drawDiamond(); } else { System.out.print("Please enter an odd number"); drawDiamond(); } } } for (int i = 0; i < 20; i++) { System.out.print(" "); } for (int i = 0; i < 20; i++) { System.out.print("*"); } System.out.println(); for …

Member Avatar
Member Avatar
+0 forum 1

I am supposed to use this method public static void drawIndentedLine (int spaces, String begin, int n, String middle, String end) This is what I am suppsed to do **It should print a single line, terminated with a newline, that begins with the specified number of spaces, followed by the begin string, followed by n copies of the middle string, followed by the end string.** Am I doing the right thing for my ouput by using system.out.println ? "______________" " ___________" " _________"

Member Avatar
Member Avatar
+0 forum 8

Can someone help me with the code for this assignment i have for school using dr java > Project Assignment:Write a method drawFace() which will draw a face on the picture. Your face should have eyes, mouth and text beneath it that provides it with a name.

Member Avatar
Member Avatar
+0 forum 7

Can someone please help me "write a drawTree method for the Turtle class" I am given the following information: World w = new World(); Turtle t = newTurtle (320, 480, w); The turtle will begin at the middle of the bottom of the World, facing North. Use the drawRectangle method to draw the trunk of the tree public void drawTree() {

Member Avatar
Member Avatar
-1 forum 6

Well i have a little problem here is the code [CODE] using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; namespace RockRaidersRecreation { /// Manager for Drawing Verts public class WallDrawManager : DrawableGameComponent { Texture2D wallTexture; BasicEffect basicEffect; Vector3 vector1 = new Vector3(0, 0, 0); Vector3 vector2 = new Vector3(0, 0, -10); Vector3 vector3 = new Vector3(10, 0, 0); Vector3 vector4 = new Vector3(10, 0, -10); List<Wall> wallList = new List<Wall>(); public WallDrawManager(Game game) : base(game) { } public override void Initialize() { wallTexture = Game.Content.Load<Texture2D>(@"textures/2d/dirt"); basicEffect = new …

Member Avatar
+0 forum 0

Basically im trying to make a game where shapes fall from the sky and the user controls the sprite to avoid them. I have it working but only with 1 block falling at a time. I am using the paint method to draw my shapes. I was wondering how to go about coding it so that it created multiple shapes, but they would be created at 1 second intervals so that there is a gap as the follow on from one another. This game is similar to "falldown" for the Iphone however the shapes come from the top. Any advice …

Member Avatar
Member Avatar
+0 forum 2

hi, i have a panel with controls and richtextbox's within it. When the user clicks the save button, i take panel1 and DrawToBitmap, then add the image to a pdf created using abcPDF7. My problem is that i have recently change textbox's with richTextBox's to enable the user more functionality, but they are not being rendered into the image. If i add a normal textbox it works fine, with the exact code, but not with richtextbox. am i missing something? why would it not render? Thanks. [CODE] Doc myDoc = new Doc(); myDoc.TopDown = true; String myTempPath = Path.GetTempPath(); const …

Member Avatar
Member Avatar
+0 forum 1

I am trying to load a background in full screen mode, but when i run my program the screen is just white. Can someone point me to the reason why? [CODE]import java.awt.*; import javax.swing.*; public class DrawComponents { GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice device = env.getDefaultScreenDevice(); GraphicsConfiguration gc = device.getDefaultConfiguration(); Image bg = new ImageIcon("stewie.jpg").getImage(); public void run(){ setFrame(); loadImages(); try{Thread.sleep(5000);} catch(Exception e){} System.exit(0); } public void setFrame(){ JFrame frame = new JFrame(gc); frame.setUndecorated(true); frame.setResizable(false); frame.setIgnoreRepaint(true); device.setFullScreenWindow(frame); device.setDisplayMode(new DisplayMode(800, 600, 32, 0)); } public void loadImages(){ bg = new ImageIcon("stewie.jpg").getImage(); } public void paint(Graphics g) { g.drawImage(bg, 400, 300, null); …

Member Avatar
Member Avatar
+0 forum 3

I want to redraw a JPanel while my program is running. Here's a fragment of my code: [CODE]public class Graph extends JPanel{ public void redrawSomething() { getGraphics().drawRect(15, 5, 20, 5); repaint(); }[/CODE] I tried to call "redrawSomething" but nothing happend. How do I fix it? Is something wrong?

Member Avatar
Member Avatar
+0 forum 7

Hello, I currently have this code to buffer an image: [CODE] public void paintComponent(Graphics g){ Graphics2D g2 = (Graphics2D) g; ImageIcon icon = new ImageIcon("back.gif"); Image image = icon.getImage(); BufferedImage buff = new BufferedImage(image.getWidth(this), image.getHeight(this), BufferedImage.TYPE_INT_ARGB); Graphics2D b = (Graphics2D) buff.createGraphics(); b.drawImage(image,imgX,imgY,this); b.setColor(Color.BLUE); b.fillRect((window.getWidth()/2)-13, (window.getHeight()/2)-13, 26, 26); g2.drawImage(buff, 0, 0, this); } [/CODE] What it (should) do is load a background image. The background moves as I press the arrow keys (changing the imgX and imgY variables). The back.gif image is 5000 pixels square. The issue is that when I don't buffer it flickers, when I use the above code, …

Member Avatar
Member Avatar
+0 forum 2

Hi Guys, i have this code which draws a continuous circle using a timer. Now I have to display it in the form which has a group box with loads of other fields and information. Now can anyone please tell me how can i add the circle into the group box as it can be displayed. Currently the circle is being displayed behind the group box which is not visible. Thank you so much Ashwin [CODE]Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs) Handles Timer1.Tick Me.sweepAngle += 1 If Me.sweepAngle = 360 Then Me.Timer1.Stop() End If Me.Refresh() End …

Member Avatar
Member Avatar
+0 forum 2

My project I am working on is a product location system for a large supermarket. My current issue is that the map I am using to display the product location is assembled from rectangle objects which I will then change the colour of when required. The array storing the locations is dimensioned as LocationArray(x) Where x is equal to the max rows function used on a table in database. Stored information always proceeded with "loc_" and the location. All rectangles are named in accordance with this. I wish to pull the field name stored in the array (which corresponds to …

Member Avatar
Member Avatar
+0 forum 9

i am doing a makeup and hairstyle makeover application in vb.net and i dont know if i can directly edit a photo in a picture box, the features of the project will be: 1. make-up features are a must. 2. it should save the original photo uploaded and the edited one. i am thinking if i can just have labels for the make-up features but the question is will it be saved along with the original photo on the picturebox? OMG, so confusing... can someone help me out with this? it will be greatly appreciated. thanks. :)

Member Avatar
Member Avatar
+0 forum 20

Hello guys, I'm currently working on a project that simulates a projectile motion. So far I'm preparing the flowchart of the program. I'm stuck when it comes to designing the path([B]2D Line[/B]) of the projectile Motion. So my question is, what fields,methods my class need in order to draw (in 2D) the path of a projectile motion. Any help is appreciated! I'm including an attachment of an example of a flowchart that I'm working on.

Member Avatar
+0 forum 0

This little code snippet shows you how you save a wxPython canvas drawing to a standard image file.

Member Avatar
+1 forum 0

The End.