<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
Class: Fox::FXBitmap
— FXRuby API Documentation
</title>
<link rel="stylesheet" href="../css/style.css" type="text/css" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script type="text/javascript">
pathId = "Fox::FXBitmap";
relpath = '../';
</script>
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
</head>
<body>
<div class="nav_wrap">
<iframe id="nav" src="../class_list.html?1"></iframe>
<div id="resizer"></div>
</div>
<div id="main" tabindex="-1">
<div id="header">
<div id="menu">
<a href="../_index.html">Index (F)</a> »
<span class='title'><span class='object_link'><a href="../Fox.html" title="Fox (module)">Fox</a></span></span>
»
<span class="title">FXBitmap</span>
</div>
<div id="search">
<a class="full_list_link" id="class_list_link"
href="../class_list.html">
<svg width="24" height="24">
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
</svg>
</a>
</div>
<div class="clear"></div>
</div>
<div id="content"><h1>Class: Fox::FXBitmap
</h1>
<div class="box_info">
<dl>
<dt>Inherits:</dt>
<dd>
<span class="inheritName"><span class='object_link'><a href="FXDrawable.html" title="Fox::FXDrawable (class)">FXDrawable</a></span></span>
<ul class="fullTree">
<li>Object</li>
<li class="next"><span class='object_link'><a href="FXObject.html" title="Fox::FXObject (class)">FXObject</a></span></li>
<li class="next"><span class='object_link'><a href="FXId.html" title="Fox::FXId (class)">FXId</a></span></li>
<li class="next"><span class='object_link'><a href="FXDrawable.html" title="Fox::FXDrawable (class)">FXDrawable</a></span></li>
<li class="next">Fox::FXBitmap</li>
</ul>
<a href="#" class="inheritanceTree">show all</a>
</dd>
</dl>
<dl>
<dt>Defined in:</dt>
<dd>rdoc-sources/FXBitmap.rb</dd>
</dl>
</div>
<h2>Overview</h2><div class="docstring">
<div class="discussion">
<p>A bitmap is a rectangular array of pixels. It supports two representations of these pixels: a client-side pixel buffer, and a server-side pixmap which is stored in an organization directly compatible with the screen, for fast drawing onto the device. The server-side representation is not directly accessible from the current process at it lives in the process of the X server or GDI (on Microsoft Windows). The client-side pixel array is of size height x (width+7)/8 bytes; in other words, 8 pixels packed into a single byte, starting with bit zero on the left.</p>
<h3 id="label-Image+rendering+hints">Image rendering hints</h3>
<dl class="rdoc-list note-list"><dt><code>BITMAP_KEEP</code>
<dd>
<p>Keep pixel data in client</p>
</dd><dt><code>BITMAP_OWNED</code>
<dd>
<p>Pixel data is owned by image</p>
</dd><dt><code>BITMAP_SHMI</code>
<dd>
<p>Using shared memory image</p>
</dd><dt><code>BITMAP_SHMP</code>
<dd>
<p>Using shared memory pixmap</p>
</dd></dl>
</div>
</div>
<div class="tags">
</div>
<h2>Instance Attribute Summary</h2>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="FXDrawable.html" title="Fox::FXDrawable (class)">FXDrawable</a></span></h3>
<p class="inherited"><span class='object_link'><a href="FXDrawable.html#height-instance_method" title="Fox::FXDrawable#height (method)">#height</a></span>, <span class='object_link'><a href="FXDrawable.html#visual-instance_method" title="Fox::FXDrawable#visual (method)">#visual</a></span>, <span class='object_link'><a href="FXDrawable.html#width-instance_method" title="Fox::FXDrawable#width (method)">#width</a></span></p>
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="FXId.html" title="Fox::FXId (class)">FXId</a></span></h3>
<p class="inherited"><span class='object_link'><a href="FXId.html#app-instance_method" title="Fox::FXId#app (method)">#app</a></span>, <span class='object_link'><a href="FXId.html#userData-instance_method" title="Fox::FXId#userData (method)">#userData</a></span>, <span class='object_link'><a href="FXId.html#xid-instance_method" title="Fox::FXId#xid (method)">#xid</a></span></p>
<h2>
Instance Method Summary
<small><a href="#" class="summary_toggle">collapse</a></small>
</h2>
<ul class="summary">
<li class="public ">
<span class="summary_signature">
<a href="#crop-instance_method" title="#crop (instance method)">#<strong>crop</strong>(x, y, w, h, color = false) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Crop bitmap to given rectangle; this calls <span class='object_link'><a href="#resize-instance_method" title="Fox::FXBitmap#resize (method)">#resize</a></span> to adjust the client and server side representations.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#data-instance_method" title="#data (instance method)">#<strong>data</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'></div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#fill-instance_method" title="#fill (instance method)">#<strong>fill</strong>(color) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Fill bitmap with uniform value.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#getData-instance_method" title="#getData (instance method)">#<strong>getData</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Return the pixel data.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#getPixel-instance_method" title="#getPixel (instance method)">#<strong>getPixel</strong>(x, y) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Get pixel state (either <code>true</code> or <code>false</code>) at (<em>x</em>, <em>y</em>).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(app, pixels = nil, opts = 0, width = 1, height = 1) ⇒ FXBitmap </a>
</span>
<span class="note title constructor">constructor</span>
<span class="summary_desc"><div class='inline'>
<p>Return an initialized FXBitmap instance.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#loadPixels-instance_method" title="#loadPixels (instance method)">#<strong>loadPixels</strong>(stream) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Load pixel data from a stream.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#mirror-instance_method" title="#mirror (instance method)">#<strong>mirror</strong>(horizontal, vertical) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Mirror the bitmap horizontally and/or vertically.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#options-instance_method" title="#options (instance method)">#<strong>options</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Return the option flags.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#options=-instance_method" title="#options= (instance method)">#<strong>options=</strong>(opts) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Set the options.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#release-instance_method" title="#release (instance method)">#<strong>release</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Release the client-side pixels buffer and free it if it was owned.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#render-instance_method" title="#render (instance method)">#<strong>render</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Render the server-side representation of the bitmap from the client-side pixels.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#resize-instance_method" title="#resize (instance method)">#<strong>resize</strong>(w, h) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Resize both client-side and server-side representations (if any) to the given width and height.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#restore-instance_method" title="#restore (instance method)">#<strong>restore</strong> ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Retrieve pixels from the server-side bitmap.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#rotate-instance_method" title="#rotate (instance method)">#<strong>rotate</strong>(degrees) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Rotate bitmap by <em>degrees</em> degrees (counter-clockwise).</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#savePixels-instance_method" title="#savePixels (instance method)">#<strong>savePixels</strong>(stream) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Save pixel data only.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#scale-instance_method" title="#scale (instance method)">#<strong>scale</strong>(w, h) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Rescale pixels image to the specified width and height; this calls <span class='object_link'><a href="#resize-instance_method" title="Fox::FXBitmap#resize (method)">#resize</a></span> to adjust the client and server side representations.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#setData-instance_method" title="#setData (instance method)">#<strong>setData</strong>(pix, opts, w, h) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Populate the bitmap with new pixel data of a new size; it will assume ownership of the pixel data if the <code>BITMAP_OWNED</code> option is passed in the <em>opts</em>.</p>
</div></span>
</li>
<li class="public ">
<span class="summary_signature">
<a href="#setPixel-instance_method" title="#setPixel (instance method)">#<strong>setPixel</strong>(x, y, color) ⇒ Object </a>
</span>
<span class="summary_desc"><div class='inline'>
<p>Change pixel at (<em>x</em>, <em>y</em>), where <em>color</em> is either <code>true</code> or <code>false</code>.</p>
</div></span>
</li>
</ul>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="FXId.html" title="Fox::FXId (class)">FXId</a></span></h3>
<p class="inherited"><span class='object_link'><a href="FXId.html#create-instance_method" title="Fox::FXId#create (method)">#create</a></span>, <span class='object_link'><a href="FXId.html#created%3F-instance_method" title="Fox::FXId#created? (method)">#created?</a></span>, <span class='object_link'><a href="FXId.html#destroy-instance_method" title="Fox::FXId#destroy (method)">#destroy</a></span>, <span class='object_link'><a href="FXId.html#detach-instance_method" title="Fox::FXId#detach (method)">#detach</a></span>, <span class='object_link'><a href="FXId.html#runOnUiThread-instance_method" title="Fox::FXId#runOnUiThread (method)">#runOnUiThread</a></span></p>
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="FXObject.html" title="Fox::FXObject (class)">FXObject</a></span></h3>
<p class="inherited"><span class='object_link'><a href="FXObject.html#bind-instance_method" title="Fox::FXObject#bind (method)">#bind</a></span>, <span class='object_link'><a href="FXObject.html#handle-instance_method" title="Fox::FXObject#handle (method)">#handle</a></span>, <span class='object_link'><a href="FXObject.html#load-instance_method" title="Fox::FXObject#load (method)">#load</a></span>, <span class='object_link'><a href="FXObject.html#save-instance_method" title="Fox::FXObject#save (method)">#save</a></span>, <span class='object_link'><a href="FXObject.html#subclasses-class_method" title="Fox::FXObject.subclasses (method)">subclasses</a></span></p>
<div id="constructor_details" class="method_details_list">
<h2>Constructor Details</h2>
<div class="method_details first">
<h3 class="signature first" id="initialize-instance_method">
#<strong>initialize</strong>(app, pixels = nil, opts = 0, width = 1, height = 1) ⇒ <tt><span class='object_link'><a href="" title="Fox::FXBitmap (class)">FXBitmap</a></span></tt>
</h3><div class="docstring">
<div class="discussion">
<p>Return an initialized FXBitmap instance. If a client-side pixel buffer (the <em>pixels</em> argument) has been specified, the bitmap does not own that pixel buffer unless the <code>BITMAP_OWNED</code> flag is set. If the <code>BITMAP_OWNED</code> flag <em>is</em> set, but a <code>nil</code> value for <em>pixels</em> is passed in, a pixel buffer will be automatically created and will be owned by the bitmap. The flags <code>BITMAP_SHMI</code> and <code>BITMAP_SHMP</code> may be specified for large bitmaps to instruct <span class='object_link'><a href="#render-instance_method" title="Fox::FXBitmap#render (method)">#render</a></span> to use shared memory to communicate with the server.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
33
34</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 33</span>
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_app'>app</span><span class='comma'>,</span> <span class='id identifier rubyid_pixels'>pixels</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='op'>=</span><span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_width'>width</span><span class='op'>=</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span><span class='op'>=</span><span class='int'>1</span><span class='rparen'>)</span> <span class='comment'># :yields: theBitmap
</span><span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
<div id="instance_method_details" class="method_details_list">
<h2>Instance Method Details</h2>
<div class="method_details first">
<h3 class="signature first" id="crop-instance_method">
#<strong>crop</strong>(x, y, w, h, color = false) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Crop bitmap to given rectangle; this calls <span class='object_link'><a href="#resize-instance_method" title="Fox::FXBitmap#resize (method)">#resize</a></span> to adjust the client and server side representations. The new bitmap may be smaller or larger than the old one; blank areas are filled with <em>color</em>. There must be at least one pixel of overlap between the old and the new bitmap.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
110</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 110</span>
<span class='kw'>def</span> <span class='id identifier rubyid_crop'>crop</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_w'>w</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='op'>=</span><span class='kw'>false</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="data-instance_method">
#<strong>data</strong> ⇒ <tt>Object</tt>
</h3><table class="source_code">
<tr>
<td>
<pre class="lines">
21</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 21</span>
<span class='kw'>alias</span> <span class='id identifier rubyid_data'>data</span> <span class='id identifier rubyid_getData'>getData</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="fill-instance_method">
#<strong>fill</strong>(color) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Fill bitmap with uniform value</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
113</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 113</span>
<span class='kw'>def</span> <span class='id identifier rubyid_fill'>fill</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="getData-instance_method">
#<strong>getData</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Return the pixel data.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
53</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 53</span>
<span class='kw'>def</span> <span class='id identifier rubyid_getData'>getData</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="getPixel-instance_method">
#<strong>getPixel</strong>(x, y) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Get pixel state (either <code>true</code> or <code>false</code>) at (<em>x</em>, <em>y</em>)</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
87</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 87</span>
<span class='kw'>def</span> <span class='id identifier rubyid_getPixel'>getPixel</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='rparen'>)</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="loadPixels-instance_method">
#<strong>loadPixels</strong>(stream) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Load pixel data from a stream</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
84</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 84</span>
<span class='kw'>def</span> <span class='id identifier rubyid_loadPixels'>loadPixels</span><span class='lparen'>(</span><span class='id identifier rubyid_stream'>stream</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="mirror-instance_method">
#<strong>mirror</strong>(horizontal, vertical) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Mirror the bitmap horizontally and/or vertically</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
99</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 99</span>
<span class='kw'>def</span> <span class='id identifier rubyid_mirror'>mirror</span><span class='lparen'>(</span><span class='id identifier rubyid_horizontal'>horizontal</span><span class='comma'>,</span> <span class='id identifier rubyid_vertical'>vertical</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="options-instance_method">
#<strong>options</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Return the option flags.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
56</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 56</span>
<span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="options=-instance_method">
#<strong>options=</strong>(opts) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Set the options.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
59</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 59</span>
<span class='kw'>def</span> <span class='id identifier rubyid_options='>options=</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="release-instance_method">
#<strong>release</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Release the client-side pixels buffer and free it if it was owned. If it is not owned, the image just forgets about the buffer.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
71</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 71</span>
<span class='kw'>def</span> <span class='id identifier rubyid_release'>release</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="render-instance_method">
#<strong>render</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Render the server-side representation of the bitmap from the client-side pixels.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
65</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 65</span>
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="resize-instance_method">
#<strong>resize</strong>(w, h) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Resize both client-side and server-side representations (if any) to the given width and height. The new representations typically contain garbage after this operation and need to be re-filled.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
78</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 78</span>
<span class='kw'>def</span> <span class='id identifier rubyid_resize'>resize</span><span class='lparen'>(</span><span class='id identifier rubyid_w'>w</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="restore-instance_method">
#<strong>restore</strong> ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Retrieve pixels from the server-side bitmap.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
62</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 62</span>
<span class='kw'>def</span> <span class='id identifier rubyid_restore'>restore</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="rotate-instance_method">
#<strong>rotate</strong>(degrees) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Rotate bitmap by <em>degrees</em> degrees (counter-clockwise)</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
102</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 102</span>
<span class='kw'>def</span> <span class='id identifier rubyid_rotate'>rotate</span><span class='lparen'>(</span><span class='id identifier rubyid_degrees'>degrees</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="savePixels-instance_method">
#<strong>savePixels</strong>(stream) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Save pixel data only</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
81</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 81</span>
<span class='kw'>def</span> <span class='id identifier rubyid_savePixels'>savePixels</span><span class='lparen'>(</span><span class='id identifier rubyid_stream'>stream</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="scale-instance_method">
#<strong>scale</strong>(w, h) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Rescale pixels image to the specified width and height; this calls <span class='object_link'><a href="#resize-instance_method" title="Fox::FXBitmap#resize (method)">#resize</a></span> to adjust the client and server side representations.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
96</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 96</span>
<span class='kw'>def</span> <span class='id identifier rubyid_scale'>scale</span><span class='lparen'>(</span><span class='id identifier rubyid_w'>w</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="setData-instance_method">
#<strong>setData</strong>(pix, opts, w, h) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Populate the bitmap with new pixel data of a new size; it will assume ownership of the pixel data if the <code>BITMAP_OWNED</code> option is passed in the <em>opts</em>. The size of the server- side representation of the image, if it exists, is adjusted but the contents are not updated; to update the server-side representation, call <span class='object_link'><a href="#render-instance_method" title="Fox::FXBitmap#render (method)">#render</a></span>.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
42</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 42</span>
<span class='kw'>def</span> <span class='id identifier rubyid_setData'>setData</span><span class='lparen'>(</span><span class='id identifier rubyid_pix'>pix</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span><span class='op'>=</span><span class='int'>0</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
<div class="method_details ">
<h3 class="signature " id="setPixel-instance_method">
#<strong>setPixel</strong>(x, y, color) ⇒ <tt>Object</tt>
</h3><div class="docstring">
<div class="discussion">
<p>Change pixel at (<em>x</em>, <em>y</em>), where <em>color</em> is either <code>true</code> or <code>false</code>.</p>
</div>
</div>
<div class="tags">
</div><table class="source_code">
<tr>
<td>
<pre class="lines">
90</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'rdoc-sources/FXBitmap.rb', line 90</span>
<span class='kw'>def</span> <span class='id identifier rubyid_setPixel'>setPixel</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span> <span class='semicolon'>;</span> <span class='kw'>end</span></pre>
</td>
</tr>
</table>
</div>
</div>
</div>
<div id="footer">
Generated on Mon Jan 2 11:47:28 2023 by
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.9.28 (ruby-3.1.2).
</div>
</div>
</body>
</html>