On Jul 10, 2006, at 6:38 PM, Phil M wrote:

On Jul 10, 2006, at 4:47 PM, Charles Yeomans wrote:

Is there a way to manipulate/access the individual pixels of a Picture using the Handle property?

To get a MemoryBlock, do the following.

dim m as new MemoryBlock(4)
#If TargetWindows
  m.Long(0) =  g.Handle(HandleTypeHDC)
#Elseif TargetMacOS
  m.Long(0) =  g.Handle(HandleTypeCGrafPtr)
#Endif     // Linux not supported
If m.Long(0) = 0 then
  //you didn't get a valid handle
End if
m = m.Ptr(0)

Now m points to whatever the handle points to.

You might find chapter 2 of my declares book <http:// www.declareSub.com/> helpful.

Thank you. Now I just need to learn how a CGrafPtr works... do you have any references on the structure/format of CGrafPtr?


Sure. See http://developer.apple.com/. A CGrafPtr is a pointer to a CGrafPort struct. In it you'll find the portPixMap field, which is a PixMapHandle. That's a handle to a PixMap struct, which appears to contain a pointer to the raw bytes. Have fun.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to