How to open a PPM file?

Drawing a rectangle in a PPM file?

  • I've created the following code but I'm having trouble with datatypes/pointers... The code should draw a rectangle into a PPM image file. http://pastebin.com/zEHQEvn8 prog2.cpp: In function `void drawRectangle(int, int, int, int, int**, int*)': prog2.cpp:63: error: invalid conversion from `int*' to `int' prog2.cpp:66: error: invalid conversion from `int*' to `int' prog2.cpp:69: error: invalid types `int[int]' for array subscript prog2.cpp:70: error: invalid types `int[int]' for array subscript prog2.cpp:71: error: invalid types `int[int]' for array subscript prog2.cpp: In function `void writeToPPM(int, int, int*)': prog2.cpp:104: error: invalid types `int[int]' for array subscript prog2.cpp:104: error: invalid types `int[int]' for array subscript prog2.cpp:104: error: invalid types `int[int]' for array subscript prog2.cpp:106: error: invalid types `int[int]' for array subscript prog2.cpp:106: error: invalid types `int[int]' for array subscript prog2.cpp:106: error: invalid types `int[int]' for array subscript Could someone please help me get this working? Thanks :)

  • Answer:

    Here: import PythonMagick as pm im = pm.Image('1920x1080', 'gray70') im.strokeColor(pm.Color(1600,0,0,0)) im.fillColor(pm.Color(0,0,0,65535)) rectangle = pm.DrawableRectangle(20,20,1900,1060) im.draw(rectangle) im.magick('PPM') im.display() < Mazz.

Devon at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.