Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 08-04-2018, 11:21 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default LICE: Any documentation or tutorials? How to use IBitmaps?

Are there any beginner tutorials or documentation for LICE?

Functions to draw and load images, such as LICE_FillRect and LICE_LoadSVG, seem self-explanatory, but I have no idea what the differences are between the various bitmaps (IBitmap, SysBitmap, WrapperBitmap, etc.), how to initialize and use these bitmaps, and how to get them onto the screen.

SWS's zoom tool appears to use LICE to draw a transparent rectangle on the screen, but the code is surprising complex, with lots of "#ifdef _WIN32" to separate platform-specific code.

Is it possible to use LICE to draw a line or a transparent rectangle on top of REAPER's windows in a simple, cross-platform way?
juliansader is offline   Reply With Quote
Old 08-05-2018, 01:54 AM   #2
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

from askjf.com...

Question: could you briefly explain the purpose of various LICE_*Bitmaps? thanks [permalink]
Asked by olilarkin (144.32.156.x) on December 19 2012, 3:39pm
Reply on December 19 2012, 10:12pm:
LICE_IBitmap: abstract interface for all lice bitmaps
LICE_MemBitmap: bitmap backed by a malloc()'d buffer
LICE_SysBitmap: bitmap backed by a buffer that also has a HDC associated with it (on OSX, this implies a SWELL HDC). For these, getDC() returns non-NULL.
LICE_SubBitmap: a utility wrapper to have a subimage of another LICE_IBitmap. If you wish to clip drawing to a rectangle, you can use this.
LICE_WrapperBitmap: used if you want to wrap some foreign buffer and make it accessible for LICE functions.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 08-05-2018, 06:51 AM   #3
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Thanks, this gives a glimpse into the mysteries of IBitmaps.

As far as I can see, the main use of SysBitmaps' HDC, is that Win32 functions such as BitBlt (which require DCs for the source and target) can copy the bitmap from and onto the screen.

However, I couldn't find a LICE equivalent of BitBlt. LICE_Copy and LICE_Blit only copy between LICE bitmaps. Did I overlook some LICE function?
juliansader is offline   Reply With Quote
Old 08-05-2018, 07:18 AM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by juliansader View Post
Did I overlook some LICE function?
LICE is just a library for dealing with pixels, it doesn't really have many support functions for dealing with the OS windowing system, you will have to use different facilities for that. That is, for example to get a LICE bitmap to draw on screen, you will have to have a window properly created and then use the win32 API BeginPaint, BitBlt, EndPaint functions etc. (On Windows, you may need different code for other operating systems.)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 08-05-2018 at 07:33 AM.
Xenakios is offline   Reply With Quote
Old 08-05-2018, 08:04 AM   #5
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Oops, I did overlook the WDL equivalents: BitBlt is part of SWELL's GDI functions, not LICE.
juliansader is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:39 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.