createDIB() in Win32Lib needs a doctor!

new topic     » topic index » view thread      » older message » newer message

------=_NextPart_000_0010_01BED45C.7E6858C0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

createDIB() doesn't work.  Try this example, and I bet you won't get a =
box with upper 1/2 blue and lower 1/2 red.  You'll probably get a red =
blob with blue lines...but try it out, or if I'm doing this wrong, =
please let me know.

--EXAMPLE
without warning
include win32lib.ew

constant win=3Dcreate(Window,"Test Window",0,50,50,300,200,0),
img=3D{ {1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1},
{2,2,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2} },
pal=3D{{0,0,255},{255,0,0}},
BMP=3DcreateDIB(img,pal)

procedure onPaint_win(integer x,integer y,integer x2,integer y2)
drawBitmap(win,BMP,5,5)
end procedure
onPaint[win]=3Droutine_id("onPaint_win")

WinMain(win)
--END EXAMPLE


Mike Hurley

------=_NextPart_000_0010_01BED45C.7E6858C0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>createDIB() doesn't work.&nbsp; Try =
this=20
example, and I bet you won't get a box with upper 1/2 blue and lower 1/2 =

red.&nbsp; You'll probably get a red blob with blue lines...but try it =
out, or=20
if I'm doing this wrong, please let me know.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>--EXAMPLE</FONT></DIV>
<DIV><FONT size=3D2>without warning</FONT></DIV>
<DIV><FONT size=3D2>include win32lib.ew</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>constant win=3Dcreate(Window,&quot;Test=20
Window&quot;,0,50,50,300,200,0),</FONT></DIV>
<DIV><FONT size=3D2>img=3D{ {1,1,1,1,1,1,1,1,1,1},</FONT></DIV>
<DIV><FONT size=3D2>{1,1,1,1,1,1,1,1,1,1},</FONT></DIV>
<DIV><FONT size=3D2>{1,1,1,1,1,1,1,1,1,1},</FONT></DIV>
<DIV><FONT size=3D2>{1,1,1,1,1,1,1,1,1,1},</FONT></DIV>
<DIV><FONT size=3D2>{1,1,1,1,1,1,1,1,1,1},</FONT></DIV>
<DIV><FONT size=3D2>{1,1,1,1,1,1,1,1,1,1},</FONT></DIV>
<DIV><FONT size=3D2>{2,2,2,2,2,2,2,2,2,2},</FONT></DIV>
<DIV><FONT size=3D2>{2,2,2,2,2,2,2,2,2,2},</FONT></DIV>
<DIV><FONT size=3D2>{2,2,2,2,2,2,2,2,2,2},</FONT></DIV>
<DIV><FONT size=3D2>{2,2,2,2,2,2,2,2,2,2},</FONT></DIV>
<DIV><FONT size=3D2>{2,2,2,2,2,2,2,2,2,2},</FONT></DIV>
<DIV><FONT size=3D2>{2,2,2,2,2,2,2,2,2,2} },</FONT></DIV>
<DIV><FONT size=3D2>pal=3D{{0,0,255},{255,0,0}},</FONT></DIV>
<DIV><FONT size=3D2>BMP=3DcreateDIB(img,pal)</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>procedure onPaint_win(integer x,integer y,integer =
x2,integer=20
y2)</FONT></DIV>
<DIV><FONT size=3D2>drawBitmap(win,BMP,5,5)</FONT></DIV>
<DIV><FONT size=3D2>end procedure</FONT></DIV>
<DIV><FONT =
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>WinMain(win)</FONT></DIV>
<DIV><FONT size=3D2></FONT><FONT color=3D#000000 size=3D2>--END =
EXAMPLE</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>

------=_NextPart_000_0010_01BED45C.7E6858C0--

________________________________________________________
NetZero - We believe in a FREE Internet.  Shouldn't you?
Get your FREE Internet Access and Email at
http://www.netzero.net/download/index.html

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu