top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

Unlimited canvas painting program using Python?

+2 votes

How to create a program similar to paint, but the difference would be that the cursor would be always in the middle and the canvas moves or the camera is always fixed on the cursor as it moves around the canvas. And the canvas should be infinite. What would be reasonable to use?

In addition, i want it to draw a line without me having to press a button, just move the mouse.

posted Oct 24, 2013 by Amit Parthsarthi

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

3 Answers

+1 vote

To start with, you'll want some sort of Graphic User Interface, a popular and common (but not the only) one is TkInter, which you can dive into here:

answer Oct 24, 2013 by Meenal Mishra
+1 vote

So, i`ll take the canvas, somekind of mouse tracker, for each mouse location I will draw a dot or 2X2 square or something. Main thing i have never understood, is how can i get the backround to move.

Lets say I have 200X200 window. In the middle of it is the cursor that draws. If i move the mouse the cursor doesn't move, but the canvas moves. So if i move mouse to the left, i get a line that goes to the left. So i probably must invert the canvas movement. If mouse goes left, canvas goes right.

answer Oct 24, 2013 by Ahmed Patel
I think it'll be confusing because it goes against how every other program does it!

In a painting program you can point to other things, such as tools, but if the cursor never moves...

It would be simpler, IMHO, if you just moved the canvas and stopped the cursor going off the canvas when the user is drawing near the edge, so that the user doesn't need to stop drawing in order to expose more of
the canvas.
+1 vote

To hold an (effectively) infinite *bitmap* canvas, you'd (effectively) need an (effectively) infinite amount of memory. However, it could be done with an (effectively) infinite *vector* canvas. That way you could limit the on-screen rendering to just the clipped subset of the vector collection.

You'd still want to make it easy to toggle between "draw" and "stop drawing", but you could make a mouse-click. To implement, just pick a GUI library tkinter, wx, or whatver.

answer Oct 24, 2013 by Sheetal Chauhan
Similar Questions
+1 vote

I want to show simple dots while my program copies the files. I have found the code like:

for i in range(10):
 print '.',

But this will execute ten times as it is predefined and the task to copy will execute after or before this loop based on the location I have placed my line to copy the files using shutil.copy().

I want that the files should be copied and in parallel the progress should be shown and when the files are copied, the progress should exit.

0 votes

Inputs would be:
- Name
- age
- gender
- married/unmarried

User feeds this data once but he/she can check later on also. So in this case program should have option to feed and read data from file.

+3 votes

I'm looking for a simple Address Book program written in Python, I've looked at addressbook 1.0.1 from PyPi but it doesn't quite do what I want. I may have to start with this and modify it but maybe there's something better out there.

In particular I want some sort of import/export ability and I'd really like some more configurability.

Any ideas anyone?

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.