Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF

TOPIC:

how fill color in rect ? 10 years 9 months ago #3265

  • truculent
  • truculent's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 64
  • Thank you received: 0
dear radaee our problem is :
when use : Page_addAnnotRect(page, mat, &rect, g_rect_Width * m_scale, g_rect_color, fill_color);
we fill rect with a color with alpha 1 :|
for example when draw rect with red color it fill with red but with alpha 1 and not transparent :(

you hint me with your Hint :
CGFloat clr[4];
clr[0] = //red, ... range [0,1];
clr[1] = //green, ... range [0,1];
clr[2] = //blue, ... range [0,1];
clr[3] = //alpha, ... range [0,1];
CGContextSetFillColor(m_ctx, clr);
CGContextFillRect(m_ctx, CGRectMake(...));

i change only clr[3] = 0.5;
but not different in my alpha in fill rect !
also when i change it my frame of reader's color change (not rect color change )

Please Log in or Create an account to join the conversation.

Last edit: by patel_patel_patel.

how fill color in rect ? 10 years 9 months ago #3266

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
OK, the alpha channel must be in stroke color(g_rect_color).
alpha channel in fill_color is 0 if no filling, or 255 if has filling.

Please Log in or Create an account to join the conversation.

how fill color in rect ? 10 years 9 months ago #3274

  • truculent
  • truculent's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 64
  • Thank you received: 0
i really cant understand your mean :(
your mean there is no way to fill color with alpha ( for EXM : 0.5 ) ?
i want to draw rect Like your Android SDK [in android SDK when draw rect they fill with e color with custom alpha]

Please Log in or Create an account to join the conversation.

how fill color in rect ? 10 years 9 months ago #3275

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
annotation just has 1 alpha information, both for stroke and fill or other graphics.
parameters has 2 color.
alpha informatioin is in sroke color.
fill color use same alpha value to stroke if fill_color alpha value is not zero.

Please Log in or Create an account to join the conversation.

how fill color in rect ? 10 years 9 months ago #3277

  • truculent
  • truculent's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 64
  • Thank you received: 0
can you help me :|

i try all of way but result is

upload7.ir/images/16534463092081659262.png

Please Log in or Create an account to join the conversation.

how fill color in rect ? 10 years 9 months ago #3278

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
just try:

Page_addAnnotRect(page, mat, &rect, g_rect_Width * m_scale, 0x80FF0000, 0xFF0000FF);
The following user(s) said Thank You: patel_patel_patel

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum