cairo lib update : version 1.10

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
hichem
User
User
Posts: 26
Joined: Sun Sep 04, 2005 4:18 pm

cairo lib update : version 1.10

Post by hichem »

here is my work on cairo , i have updated the package to version 1.10
only for windows.
not all the lib is ported. because i une pango for rendering text,glyph...etc

the cairo website : http://www.cairographics.org

here is the package for cairo 1.10: http://www.4shared.com/file/ed03PUDJ/cairo.html

not forget to place an image png in the folder (without this the test code not work properly)

happy new year.
Last edited by hichem on Mon Jan 03, 2011 7:03 pm, edited 2 times in total.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

This is just very cool ! Thanks for sharing it.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Neat :D

Thanks for sharing this with us.
hichem
User
User
Posts: 26
Joined: Sun Sep 04, 2005 4:18 pm

Post by hichem »

thanks guys,
note please that i haven't tested all the functions be carful when using it.

here is an other example a nice effect (at my point of view)for splash window without using any image

Code: Select all

XIncludeFile "cairo180.pbi"

  Procedure splash_background(win.i)
  
    Protected cr, pat
    
    cr = GetProp_(WindowID(win),"context")
    
    pat = cairo_pattern_create_linear (0.0, 0.0,  0.0, 256.0)
    cairo_pattern_add_color_stop_rgba (pat, 1, 0.9, 0.65, 0.42, 1)
    cairo_pattern_add_color_stop_rgba (pat, 0, 0.9, 0.8, 0.42, 1)
    cairo_rectangle (cr, 0, 0, WindowWidth(win),WindowHeight(win))
    cairo_set_source (cr, pat)
    cairo_fill (cr)
    cairo_pattern_destroy (pat)
   
    pat = cairo_pattern_create_radial (115.2, 202.4, 25.6, 102.4,  102.4, 128.0);
    cairo_pattern_add_color_stop_rgba (pat, 0, 1, 1, 1, 0.4);
    cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.1);
    cairo_set_source (cr, pat);
    cairo_arc (cr, 128.0, 128.0, 176.8, 0, 2 * #M_PI);
    cairo_fill (cr);
    cairo_pattern_destroy (pat)
            
  EndProcedure 
  
  
Global rr.RECT, ps.PAINTSTRUCT  
  
If OpenWindow(0,0,0,400,300,"",#PB_Window_BorderLess | #PB_Window_ScreenCentered)
  
  su = cairo_win32_surface_create(GetDC_(WindowID(0))) 
  cr = cairo_create(su)
  
  SetProp_(WindowID(0),"surface",su)
  SetProp_(WindowID(0),"context",cr)

  splash_background(0)

Repeat
 events = WaitWindowEvent()

 
 Select events
  Case #WM_ERASEBKGND : InvalidateRect_(WindowID(0),@rr,#False)
 
  Case #WM_PAINT 
   BeginPaint_(WindowID(0), @ps)
    splash_background(0)
   EndPaint_(WindowID(0), @ps)
  
  Case #PB_Event_CloseWindow  
   quit = 1
  ; destroy our surface and cairo context
  cairo_surface_destroy(su) 
  cairo_destroy(cr)
 EndSelect 

  
 Until quit = 1

 EndIf  
 
 End 



KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

Zajakallahoukhair ;)
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
hichem
User
User
Posts: 26
Joined: Sun Sep 04, 2005 4:18 pm

Post by hichem »

merci mon vieux. :wink:
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Post by JCV »

Thank you! 8)

[Registered PB User since 2006]
[PureBasic 6.20][SpiderBasic 2.2]
[RP4 x64][Win 11 x64][Ubuntu x64]
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Thanks, :D
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
idle
Always Here
Always Here
Posts: 5836
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Post by idle »

looks very useful thanks
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

So very cool. I like it. Thank you very much. :)
Violet
Enthusiast
Enthusiast
Posts: 106
Joined: Sun Dec 23, 2007 6:30 pm

Post by Violet »

Thanks, even if I am not abled this time (because still running 64 Bit Linux, will change) to try it.
best regards,

Violet
Phantomas
User
User
Posts: 96
Joined: Wed Jul 01, 2009 12:59 pm

Re: cairo lib

Post by Phantomas »

File dead :(, can upload "cairo180.pbi"? Thanks...
Christian
Enthusiast
Enthusiast
Posts: 154
Joined: Mon Dec 08, 2003 7:50 pm
Location: Germany

Re: cairo lib

Post by Christian »

Hi!

I'm looking for this lost include-file. Is anybody out there who's still having it? Would be very helpful ...

Thanks in advance! =)
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Re: cairo lib

Post by Progi1984 »

User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: cairo lib

Post by DoubleDutch »

Here is a copy of the lib:

http://ɯoɔ.com/downloads/cairo.zip
Last edited by DoubleDutch on Tue Mar 09, 2010 11:36 am, edited 1 time in total.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply