Cairo__Surface.st
changeset 51 5293f2b851ab
parent 47 061f23d91383
child 57 2c9a342e1f2a
equal deleted inserted replaced
50:239120c68187 51:5293f2b851ab
    27 
    27 
    28     "Created: / 24-12-2014 / 23:43:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    28     "Created: / 24-12-2014 / 23:43:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    29     "Modified: / 28-12-2014 / 22:03:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    29     "Modified: / 28-12-2014 / 22:03:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    30 !
    30 !
    31 
    31 
    32 newImageWithFormatARGB32width:width height:height 
    32 newImageWithFormat:format width:width height:height similarTo: surface
    33     ^ self 
    33     ^ CPrimitives 
    34         newImageWithFormat:CAIRO_FORMAT_ARGB32
    34         cairo_surface_create_similar_image: surface 
    35         width:width
    35         _:format
    36         height:height
    36         _:width
    37 
    37         _:height
    38     "Created: / 24-12-2014 / 23:44:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    38 
    39     "Modified: / 28-12-2014 / 22:04:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    39     "Created: / 27-02-2016 / 16:00:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    40 !
    40 !
    41 
    41 
    42 newPDFWithFile:aStringOrFilename width:w height:h 
    42 newPDFWithFile:aStringOrFilename width:w height:h 
    43     ^ CPrimitives 
    43     ^ CPrimitives 
    44         cairo_pdf_surface_create:aStringOrFilename asFilename asString
    44         cairo_pdf_surface_create:aStringOrFilename asFilename asString
    45         _:w asDouble
    45         _:w asDouble
    46         _:h asDouble
    46         _:h asDouble
    47 
    47 
    48     "Created: / 10-07-2008 / 09:35:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
    48     "Created: / 10-07-2008 / 09:35:34 / Jan Vrany <vranyj1@fel.cvut.cz>"
    49     "Modified: / 28-12-2014 / 22:05:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    49     "Modified: / 28-12-2014 / 22:05:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    50 !
       
    51 
       
    52 newPNGWithFile:aStringOrFilename
       
    53     aStringOrFilename asFilename exists ifFalse:[ 
       
    54         self error: 'No such file'.
       
    55     ].
       
    56     ^ CPrimitives cairo_image_surface_create_from_png:aStringOrFilename asFilename asString
       
    57 
       
    58     "Created: / 28-02-2016 / 07:52:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    50 !
    59 !
    51 
    60 
    52 newWin32WithHDC: hdc
    61 newWin32WithHDC: hdc
    53     ^ CPrimitives cairo_win32_surface_create:hdc
    62     ^ CPrimitives cairo_win32_surface_create:hdc
    54 
    63