Hi,

yes, I've looked through scribble.wx.lua, but since I didn't get it to
work, I just ignored it and tried something else.

here's the actual source I'm working with, and not just a generic example:

----------------------------------------
instanceAbout.lua
----------------------------------------

-- define instanceAbout
instanceAbout = wx.wxFrame(
        instanceSource,
        wx.wxID_ANY,
        "About Robin Studio",
        wx.wxDefaultPosition,
        wx.wxSize(300, 400),
        wx.wxCAPTION + wx.wxSTAY_ON_TOP + wx.wxFRAME_NO_TASKBAR
)

-- centre instanceAbout
instanceAbout:Centre(wx.wxBOTH)

-- define aboutBackground
local aboutBackground =
wx.wxBitmap("interface/about/aboutBackground.bmp", wx.wxBITMAP_TYPE_BMP,
300, 400)

-- define aboutPanel
local aboutPanel = wx.wxPanel(instanceAbout, wx.wxID_ANY,
wx.wxDefaultPosition, wx.wxSize(300, 400))

-- define OnPaint
function OnPaint(event)
        local dc = wx.wxPaintDC(aboutPanel)

        if aboutBackground and aboutBackground:Ok() then
                if redrawRequired then
                        DrawBitmap(aboutBackground)
                        redrawRequired = false
                end

                dc:DrawBitmap(aboutBackground, 0, 0, false)
        end

        dc:Delete()
end

----------------------------------------

Hakki Dogusan wrote:
> Hi,
> 
> Kenneth Forsbäck yazmış:
>> Hi,
>>
>> I've been all over the net, but have found no decent documentation on
>> this matter, and I simply don't get it to work.
>>
>> I'm only trying to draw a bitmap onto a frame, simple as that.
>>
>> local bitmapFoo = wx.wxBitmap("foo.bmp", wx.wxBITMAP_TYPE_BMP, 300, 400)
>> local dc = wx.wxClientDC(instanceFoo)
>> dc:DrawBitmap(bitmapFoo, 0, 0, false)
>> dc:Delete()
>>
>> What's wrong here...O_O...I don't get it
>>
> 
> 
> Did you investigate scribble.wx.lua sample?
> 
> ie.
> 
> function OnPaint(event)
>      -- ALWAYS create wxPaintDC in wxEVT_PAINT handler, even if unused
>      local dc = wx.wxPaintDC(panel)
> 
>      if bitmap and bitmap:Ok() then
>          if redrawRequired then
>              DrawBitmap(bitmap)
>              redrawRequired = false
>          end
> 
>          dc:DrawBitmap(bitmap, 0, 0, false)
>      end
> 
>      dc:Delete() -- ALWAYS Delete() any wxDCs created when done
> end
> 
> 
> --
> Regards,
> Hakki Dogusan
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> wxlua-users mailing list
> wxlua-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wxlua-users

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to