Platforms to show: All Mac Windows Linux Cross-Platform
This FAQ is no longer useful with current operation systems and current plugin versions.
FAQ.How to draw into a CGContext using DrawThemeTextBox?
Feedback.
Answer: The code below writes using a declare to DrawThemeTextBox into a CGContext.
Example:
Feedback.
Answer: The code below writes using a declare to DrawThemeTextBox into a CGContext.
Example:
dim c as CGPictureContextMBS
dim p as Picture
dim r as MemoryBlock
dim s as CFStringMBS
c=new CGPictureContextMBS(300,300)
c.ClearRect CGMakeRectMBS(0,0,300,300)
declare function DrawThemeTextBox lib "CarbonLib" (cfstringhandle as integer, fontid as integer, state as integer, inWrapToWidth as Boolean, rect as ptr, inJust as integer, contexthandle as integer) as integer
'OSStatus DrawThemeTextBox (
'CFStringRef inString,
'ThemeFontID inFontID,
'ThemeDrawState inState,
'Boolean inWrapToWidth,
'const Rect * inBoundingBox,
'SInt16 inJust,
'void * inContext
');
r=NewMemoryBlock(8)
r.Short(0)=0
r.Short(2)=0
r.Short(4)=300
r.Short(6)=300
s=NewCFStringMBS("Hello World")
title=str(DrawThemeTextBox(s.handle,0,0,false,r,0,c.Handle))
p=NewPicture(300,300,32)
p.Graphics.DrawPicture c.CopyPicture,0,0
p.mask.Graphics.DrawPicture c.CopyPictureMask,0,0
Backdrop=p
Notes: If result is not 0, the method fails.Links
MBS Realbasic tutorial videos - Pfarrgemeinde Ministranten Nickenich