• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

Graphics

basically, i either need to know how to manipulate screen memory on my PPC powerbook, which i assume will be the same for other macs, in code warrior, or what is the code warrior mac equivilent to graphics.h in PC c?
0
twizat
Asked:
twizat
1 Solution
 
boonstraCommented:
Not an "easy" question, but you want to look at the CGrafPort data structure, and specifically the PixMap pointed to by the PixMapHandle.  To get the screen memory for the main screen, use GetMainDevide() to get the GDHandle of the main graphics device, then look at the PixMapHandle of that device.  Be sure to use GetPixBaseAddr to get the base address of screen memory, use rowBytes to decide how much memory is allocated for each row of pixels, use bounds to convert to screen coordinates, and use pixelSize to determine how many bits are allocated per pixel.

You can find more information by looking at the QuickDraw documentation:
http://developer.apple.com/techpubs/macos8/MultimediaGraphics/QuickDraw/quickdraw.html>, the offscreen graphics documentation:
http://developer.apple.com/techpubs/macos8/MultimediaGraphics/OffscreenGraphicsWorld/offscreengraphicsworld.html>, and some of the graphics sample code:
http://developer.apple.com/samplecode/Sample_Code/Graphics_2D.htm>
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now