Imlib2::Context (Class)

In: imlib2.c  (CVS)
Parent: Object

Public Class methods

Return the current context.

Example:

  ctx = Imlib2::Context.get

Return the current context.

Example:

  ctx = Imlib2::Context.get

Imlib2::Context constructor.

Currently just a placeholder

Return a new Imlib2::Context.

Example:

  ctx = Imlib2::Context.new

Pop the top context off the context stack.

Example:

  ctx = Imlib2::Context.pop

Public Instance methods

Get the anti_alias flag.

Example:

  if ctx.anti_alias == true
    puts 'anti_alias enabled.'
  end

Set the anti_alias flag.

Example:

  ctx.anti_alias = true

Get the text drawing angle.

Example:

  if ctx.dir == Imlib2::Direction::ANGLE
    puts 'the current font angle is ' << ctx.angle
  end

Set the text drawing angle.

Example:

  ctx.angle = 76.8

Get the anti_alias flag.

Example:

  if ctx.anti_alias == true
    puts 'anti_alias enabled.'
  end

Set the anti_alias flag.

Example:

  ctx.anti_alias = true

Get the current X11 Visual.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  visual = context.get_visual
  visual = context.visual

Get the blend flag.

Example:

  if ctx.blend
    puts 'blend enabled.'
  end

Set the blend flag.

Example:

  ctx.blend = true

Get the cliprect.

Example:

  x, y, w, h = ctx.cliprect

Set the cliprect.

Example:

  ctx.cliprect = [10, 10, 100, 100]
cmap()
cmap=(p1)

Get the current color modifier (Imlib2::ColorModifier).

Example:

  cmod = ctx.cmod

Set the current color modifier (Imlib2::ColorModifier).

Example:

  ctx.cmod = cmod

Get the current color (Imlib2::Color::RgbaColor).

Example:

  color = ctx.color

Set the current color (Imlib2::Color).

Example:

  ctx.color = Imlib2::Color::LIGHTGRAY

Get the current color modifier (Imlib2::ColorModifier).

Example:

  cmod = ctx.cmod

Set the current color modifier (Imlib2::ColorModifier).

Example:

  ctx.cmod = cmod
colormap()
colormap=(p1)

Get the current font direction (Imlib2::Dir or Imlib2::Direction).

Example:

  if ctx.direction != Imlib2::Direction::RIGHT
    puts 'drawing funny text'
  end

Set the current font direction (Imlib2::Dir or Imlib2::Direction).

Example:

  ctx.direction = Imlib2::Direction::LEFT

Get the current font direction (Imlib2::Dir or Imlib2::Direction).

Example:

  if ctx.direction != Imlib2::Direction::RIGHT
    puts 'drawing funny text'
  end

Set the current font direction (Imlib2::Dir or Imlib2::Direction).

Example:

  ctx.direction = Imlib2::Direction::LEFT

Get the current X11 Display.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  display = context.get_display
  display = context.display

Set the current X11 Display.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  context.set_display display
  context.display = display

Get the dither flag.

Example:

  if ctx.dither
    puts 'dither enabled.'
  end

Set the dither flag.

Example:

  ctx.dither = true

Get the dither_mask flag.

Example:

  if ctx.dither_mask == true
    puts 'dither_mask enabled'
  end

Set the dither_mask flag.

Example:

  ctx.dither_mask = true

Get the current X11 Drawable.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  drawable = context.get_drawable
  drawable = context.drawable

Set the current X11 Drawable.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  context.set_drawable drawable
  context.drawable = drawable

Get the current TrueType Font Encoding.

Example:

  if ctx.encoding == Imlib2::Encoding::ISO_8859_1
    puts 'using ISO-8859-1 encoding'
  end

Set the current TrueType Font Encoding.

Example:

  ctx.encoding = Imlib2::Encoding::ISO_8859_5

Get the current font (Imlib2::Font).

Example:

  font = ctx.font

Set the current font (Imlib2::Font).

Example:

  ctx.font = Imlib2::Font.new 'helvetica/12'

Get the text drawing angle.

Example:

  if ctx.dir == Imlib2::Direction::ANGLE
    puts 'the current font angle is ' << ctx.angle
  end

Get the anti_alias flag.

Example:

  if ctx.anti_alias == true
    puts 'anti_alias enabled.'
  end

Get the current X11 Visual.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  visual = context.get_visual
  visual = context.visual

Get the blend flag.

Example:

  if ctx.blend
    puts 'blend enabled.'
  end

Get the cliprect.

Example:

  x, y, w, h = ctx.cliprect
get_cmap()

Get the current color (Imlib2::Color::RgbaColor).

Example:

  color = ctx.color

Get the current color modifier (Imlib2::ColorModifier).

Example:

  cmod = ctx.cmod
get_colormap()

Get the current font direction (Imlib2::Dir or Imlib2::Direction).

Example:

  if ctx.direction != Imlib2::Direction::RIGHT
    puts 'drawing funny text'
  end

Get the current X11 Display.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  display = context.get_display
  display = context.display

Get the dither flag.

Example:

  if ctx.dither
    puts 'dither enabled.'
  end

Get the dither_mask flag.

Example:

  if ctx.dither_mask == true
    puts 'dither_mask enabled'
  end

Get the current X11 Drawable.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  drawable = context.get_drawable
  drawable = context.drawable

Get the current TrueType Font Encoding.

Example:

  if ctx.encoding == Imlib2::Encoding::ISO_8859_1
    puts 'using ISO-8859-1 encoding'
  end

Get the current font (Imlib2::Font).

Example:

  font = ctx.font

Get the current gradient (Imlib2::Gradient).

Example:

  grad = ctx.gradient

Get the current image (Imlib2::Image).

Note that this function is not useful at the moment since all image instance methods blindly blow away the image and color context. So you cannot safely mix image context and image instance methods.

Example:

  im = ctx.image

Get the current X11 Mask.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  mask = context.get_mask
  mask = context.mask

Get the current operation (Imlib2::Op or Imlib2::Operation).

Example:

  if ctx.op == Imlib2::Op::COPY
    puts 'copy operation'
  end

Get the progress callback granularity.

This function is not useful at the moment since you cannot specify progress callbacks from within Ruby (this is a TODO item).

Example:

  granularity = ctx.progress_granularity

Get the current TrueType Font Encoding.

Example:

  if ctx.encoding == Imlib2::Encoding::ISO_8859_1
    puts 'using ISO-8859-1 encoding'
  end

Get the current X11 Visual.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  visual = context.get_visual
  visual = context.visual

Get the current X11 Visual.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  visual = context.get_visual
  visual = context.visual

Get the current gradient (Imlib2::Gradient).

Example:

  grad = ctx.gradient

Set the current gradient (Imlib2::Gradient).

Example:

  ctx.gradient = grad

Get the current image (Imlib2::Image).

Note that this function is not useful at the moment since all image instance methods blindly blow away the image and color context. So you cannot safely mix image context and image instance methods.

Example:

  im = ctx.image

Set the current image (Imlib2::Image).

Note that this function is not useful at the moment since all image instance methods blindly blow away the image and color context. So you cannot safely mix image context and image instance methods.

Example:

  ctx.image = image

Get the current X11 Mask.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  mask = context.get_mask
  mask = context.mask

Set the current X11 Mask.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  context.set_mask mask
  context.mask = mask

Get the current operation (Imlib2::Op or Imlib2::Operation).

Example:

  if ctx.op == Imlib2::Op::COPY
    puts 'copy operation'
  end

Set the current operation (Imlib2::Op or Imlib2::Operation).

Example:

  ctx.operation = Imlib2::Op::COPY

Get the current operation (Imlib2::Op or Imlib2::Operation).

Example:

  if ctx.op == Imlib2::Op::COPY
    puts 'copy operation'
  end

Set the current operation (Imlib2::Op or Imlib2::Operation).

Example:

  ctx.operation = Imlib2::Op::COPY

Get the progress callback granularity.

This function is not useful at the moment since you cannot specify progress callbacks from within Ruby (this is a TODO item).

Example:

  granularity = ctx.progress_granularity

Set the progress callback granularity.

This function is not useful at the moment since you cannot specify progress callbacks from within ruby (this is a TODO item).

Example:

  ctx.progress_granularity = 10

Push this context onto the context stack.

Example:

  ctx.push

Set the text drawing angle.

Example:

  ctx.angle = 76.8

Set the anti_alias flag.

Example:

  ctx.anti_alias = true

Set the blend flag.

Example:

  ctx.blend = true

Set the cliprect.

Example:

  ctx.cliprect = [10, 10, 100, 100]
set_cmap(p1)

Set the current color (Imlib2::Color).

Example:

  ctx.color = Imlib2::Color::LIGHTGRAY

Set the current color modifier (Imlib2::ColorModifier).

Example:

  ctx.cmod = cmod
set_colormap(p1)

Set the current font direction (Imlib2::Dir or Imlib2::Direction).

Example:

  ctx.direction = Imlib2::Direction::LEFT

Set the current X11 Display.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  context.set_display display
  context.display = display

Set the dither flag.

Example:

  ctx.dither = true

Set the dither_mask flag.

Example:

  ctx.dither_mask = true

Set the current X11 Drawable.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  context.set_drawable drawable
  context.drawable = drawable

Set the current TrueType Font Encoding.

Example:

  ctx.encoding = Imlib2::Encoding::ISO_8859_5

Set the current font (Imlib2::Font).

Example:

  ctx.font = Imlib2::Font.new 'helvetica/12'

Set the current gradient (Imlib2::Gradient).

Example:

  ctx.gradient = grad

Set the current image (Imlib2::Image).

Note that this function is not useful at the moment since all image instance methods blindly blow away the image and color context. So you cannot safely mix image context and image instance methods.

Example:

  ctx.image = image

Set the current X11 Mask.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  context.set_mask mask
  context.mask = mask

Set the current operation (Imlib2::Op or Imlib2::Operation).

Example:

  ctx.operation = Imlib2::Op::COPY

Set the progress callback granularity.

This function is not useful at the moment since you cannot specify progress callbacks from within ruby (this is a TODO item).

Example:

  ctx.progress_granularity = 10

Set the current TrueType Font Encoding.

Example:

  ctx.encoding = Imlib2::Encoding::ISO_8859_5

Set the current X11 Visual.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  context.set_visual visual
  context.visual = visual

Get the current X11 Visual.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  visual = context.get_visual
  visual = context.visual

Get the current X11 Visual.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  visual = context.get_visual
  visual = context.visual

Set the current X11 Visual.

Note: This method is not available unless Imlib2-Ruby was compiled with X11 support. You can check the constant Imlib2::X11_SUPPORT to see if X11 support is available.

Examples:

  context.set_visual visual
  context.visual = visual

[Validate]