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
Related Q & A:
- How to delete a line from a .txt file in node.js?Best solution by c-sharpcorner.com
- How to convert a HTML file to XML file?Best solution by Stack Overflow
- Is there a limit on the size of a new file or a text file?Best solution by Stack Overflow
- How can I burn a .rmvb file onto a DVD for viewing on a regular DVD player?Best solution by Yahoo! Answers
- How is .txt file different from a .dat file in C?Best solution by mycplus.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.