Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - gf_context_set_pattern function: (4 Items)
   
gf_context_set_pattern function  
Hi ,

from the help documents, it says the second parameter of this function is pattern which is A pointer to the bitmap 
containing the pattern.

my question is how can I define the bitmap ?

Re: gf_context_set_pattern function  
The pattern is a pointer to an array of characters defining the pattern bitmap.
This array should define an 8X8 single bit/pixel bitmap packing 8 pixels/byte, with no padding.
Re: gf_context_set_pattern function  
Hi Misha,


thanks for your help.


I have an another question, how can I use this 8x8 value combine with ROPs(gf_context_set_rop());


for example,

I want to draw an 8x8 rectangle and set all the needed values like this,


mypattern[8] = {0x00, 0x44, 0x00,0x11, 0x00,0x44, 0x00,0x11 };

fgcolor:    0xFFFF0000

bgcolor:   0xFF0000FF

rop:          GF_ROP_PDSnaon 


 what is the formula to get the result ?
Re: gf_context_set_pattern function  
If I understand you correctly you should try something like this:

-- disable all ROP operation
-- set fgcolor to your "bgcolor"
-- draw a solid rectangle (gf_draw_rect()) where you need it, let's say @ X,Y
-- set the pattern
-- set the ROP
-- set fgcolor to your "fgcolor"
-- draw a solid rectangle again @ X,Y