Displaying 16 results from an estimated 16 matches for "draw_bitmap".
2005 Jan 22
9
Dragging images across the canvas
...@reg = Wx::Region.new(nx,ny,nx+w,ny+h)
dc = Wx::ClientDC.new(self)
# Erase from the existing location
#
wb = Wx::WHITE_BRUSH
dc.set_brush(wb)
dc.set_pen(Wx::WHITE_PEN)
dc.draw_rectangle(ox,oy,ox+w,oy+h)
# Draw at the new location
#
dc.draw_bitmap(@bitmap,nx,ny,false)
dc.free
end
def on_motion(event)
x = event.get_x
y = event.get_y
move_region(x,y) if (@left_dn and (@reg.contains(x,y) == 0))
end
def on_paint
paint{|dc|
dc.clear
dc.draw_bitmap(@bitmap, 0, 0, false)
}
w,h = @bitmap.ge...
2007 Oct 04
1
wxRuby: MemoryDC problems...
I''m trying to put together a quick test of buffered animation with
WxRuby, but I''m encountering a fair amount of trouble... I''m drawing
to a Wx::Bitmap first, then using Wx::DC#draw_bitmap to copy it to a
Wx::Window. But I get the following error:
C:/ruby/lib/ruby/gems/1.8/gems/wxruby-1.9.1-i386-mswin32/lib/wx/classes/bitmap.rb:18:in
`draw'': uninitialized constant Wxruby2::Bitmap::MemoryDC (NameError)
from dc_draw_line.rb:30:in `on_init''
...
What...
2009 Jan 13
5
set the background to a bitmap
Hi,
any ideas whether you can set the background of a dialog to use an
image?
--
Posted via http://www.ruby-forum.com/.
2009 Mar 23
3
How to put a background image on a panel
Well I''ve made a lot of progress on my app, but I''m stuck on figuring
out how to add a bitmap. I have a notebook and a page panel. On this
panel I want to put a backdrop image and scale it to the size of the
panel. How do I do this? I looked at some of the samples related to
bitmaps and I could not see how to apply that to my situation.
Thanks,
T.
2007 Apr 29
0
[980] branches/wxruby2/wxwidgets_282/samples/bigdemo/ShapedWindow.rbw: Use Window#paint instead of PaintDC.new
...(rev 980)
</span><span class="lines">@@ -65,8 +65,7 @@
</span><span class="cx"> end
</span><span class="cx">
</span><span class="cx"> def on_paint
</span><del>- dc = PaintDC.new(self)
- dc.draw_bitmap(@bmp, 0, 0, true)
</del><ins>+ paint { | dc | dc.draw_bitmap(@bmp, 0, 0, true) }
</ins><span class="cx"> end
</span><span class="cx">
</span><span class="cx"> def on_exit
</span></span></pre>...
2007 Apr 29
0
[994] branches/wxruby2/wxwidgets_282/samples/bigdemo/ShapedWindow.rbw: Draw bitmap via paint method rather than directly with a ClientDC
...lt;/span><span class="lines">@@ -46,8 +46,7 @@
</span><span class="cx"> set_window_shape
</span><span class="cx"> end
</span><span class="cx">
</span><del>- dc = ClientDC.new(self)
- dc.draw_bitmap(@bmp, 0, 0, true)
</del><ins>+ paint { | dc | dc.draw_bitmap(@bmp, 0, 0, true) }
</ins><span class="cx"> end
</span><span class="cx">
</span><span class="cx"> def set_window_shape
</span></span></pr...
2007 Dec 01
5
Tearing in my buffered animation test script...
OK, I have a basic blit demo working (thanks to Alex Fenton for his
reply, which I finally saw).
However, there''s a great deal of "tearing" on the screen - flickering
grey lines in the black background. It looks like the blit isn''t
always complete when the screen refreshes.
Can anyone look at this and tell me what I might be doing wrong? Any
help would be most
2007 Dec 30
4
Drawing thread not getting enough time from scheduler?
...surface.draw_line(x, 0, x+100, 100)
end
end
#Update screen.
update_window(window, buffer)
end
end
end
def update_window(window, buffer)
window.paint do |dc|
#Copy the buffer to the viewable window.
dc.draw_bitmap(buffer, 0, 0, false)
end
end
end
app = MyApp.new
app.main_loop
I ran it through ruby-prof... Am I right in thinking these results
mean the drawing thread is getting a fraction of the time that the
main loop is?
Thread ID: 59174940
Total: 0.01
%self total self...
2008 Jan 19
5
No joy from Wx::App.dispatch, Wx::App.yield...
...surface.draw_line(x, 0, x+100, 100)
end
end
#Update screen.
update_window(window, buffer)
@i += 1
@i = 0 if @i > 300
end
def update_window(window, buffer)
window.paint do |dc|
#Copy the buffer to the viewable window.
dc.draw_bitmap(buffer, 0, 0, false)
end
end
end
app = MyApp.new
app.main_loop
2007 Nov 18
4
set background label to transparent??
I just use wxRuby and I have problem
I use background image on my app and when I create label it seem look
background of label is gray, how can I change it into transparent????
--
Posted via http://www.ruby-forum.com/.
2004 Feb 02
0
the sample
...initialize parent, title, bmap
super(parent, -1, title)
@bitmap=bmap
set_client_size_wh(@bitmap.get_width,@bitmap.get_height)
evt_paint {|what| on_paint(what)}
evt_left_down {on_click()}
end
def on_click
close
end
def on_paint what
dc = PaintDC.new(self)
dc.draw_bitmap(@bitmap,0,0,true)
end
end
class MyFrame < Wx::Frame
def initialize(title)
super(nil, -1, title)
b=Button.new(self,-1,''e'')
evt_button(-1) { MyImageFrame.new(self, ''yeah'',Bitmap.new(''verybigimagefile'')).show }
end
end
class...
2004 Jan 08
3
pictorG
...filename,BITMAP_TYPE_ANY) # why should I say BITMAP_TYPE_ANY?
set_client_size_wh(@bitmap.get_width,@bitmap.get_height)
evt_paint {on_paint()}
evt_left_down {on_click()}
end
def on_click
@bitmap.destroy()
self.destroy()
end
def on_paint
dc = PaintDC.new(self)
dc.draw_bitmap(@bitmap,0,0,true)
end
end
class Pictures < ListCtrl # -- show the pictures
def initialize parent
super parent,-1,DEFAULT_POSITION,DEFAULT_SIZE,LC_ICON|LC_AUTOARRANGE
assign_image_list(@imageList=ImageList.new(THM_WIDTH,THM_HEIGHT),IMAGE_LIST_NORMAL)
# evt_list_begin_drag(self.ge...
2007 May 04
0
[1005] trunk/wxruby2/samples/images/images.rb: Remove some debugging output
...an><span class="cx"> def on_paint
</span><del>- puts("onPaint begin")
</del><span class="cx"> paint do | dc |
</span><span class="cx"> dc.clear
</span><span class="cx"> dc.draw_bitmap(@bitmap, 0, 0, false)
</span><span class="cx"> end
</span><del>- puts("onPaint end")
</del><span class="cx"> end
</span><span class="cx"> end
</span><span class="cx">
</span>...
2007 Mar 19
0
[901] branches/wxruby2/wxwidgets_282/samples/printing/printing.rb: Method name change fix in printing sample for API change 2.6 -> 2.8
...lass="cx">
</span><span class="cx"> dc.draw_icon( my_icon, 100, 100)
</span><span class="cx">
</span><del>- if @bitmap.ok
</del><ins>+ if @bitmap.is_ok
</ins><span class="cx"> dc.draw_bitmap( @bitmap, 10, 10 )
</span><span class="cx"> end
</span><span class="cx"> end
</span></span></pre>
</div>
</div>
</body>
</html>
2003 Nov 24
3
wxImageHandler type?
Hiya, I was trying to figure out how to display PNG files using
wxWindows/wxRuby. Google turned up a few things, mainly discussing
the wxImageHandler class and it''s children, etc, but there seems to
be no mention of them in the wxRuby source.
Are they there, and I missed them, or are they just not there?
If there not there, is there a quick and dirty way to get them in?
It seems like
2007 Apr 13
0
[954] branches/wxruby2/wxwidgets_282: Additions to Image API 2.6 -> 2.8, remove comment cruft
...th)":bitmapctor.html constructor.
</del><ins>+the "Bitmap::Bitmap(Image,int depth)":bitmapctor.html constructor.
</ins><span class="cx"> This bitmap can then
</span><span class="cx"> be drawn in a device context, using "DC#draw_bitmap":dc.html#DC_drawbitmap.
</span><span class="cx">
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> corresponds to a transparent pixel (null opacity) while a value of $255$
</span><span class="c...