Re: Windows DIB?

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

------=_NextPart_000_0016_01C000A4.D9B18420
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Actually memBM =3D c_func(iCreateCompatibleBitmap,{hdc, 197, 275}) isnt =
even needed.
  Original Message:


  To display a DIB (device independant bitmap) in Windows (95,98,2K,NT)
  If I use the below Code (My_Code) what if any compatibility issue =
might I run into?

      From Microsoft SDK

      HDC memDC =3D CreateCompatibleDC ( hDC );
      HBITMAP memBM =3D CreateCompatibleBitmap ( hDC );
      SelectObject ( memDC, memBM );
    =20
       This Works in my program on my Machine.

  My_Code:

  constant SRCCOPY =3D #CC0020

  atom memDC, memBM, hBitmap, Bitmap_file, selBmp, ShowBmp
  Bitmap_file =3D allocate_string("eumans.bmp")

        memDC =3D c_func(iCreateCompatibleDC, { hdc })
        memBM =3D c_func(iCreateCompatibleBitmap,{hdc, 197, 275})
        hBitmap =3D c_func(iLoadImage,=20
                         {NULL, Bitmap_file, IMAGE_BITMAP, 197, 275, =
LR_LOADFROMFILE})

        selBmp =3D c_func(iSelectObject,{memDC, hBitmap})
        ShowBmp =3D c_func(iBitBlt, {hdc,=20
                                                 415,  -- x placement
                                                 220,  -- y placement
                                                 197,  -- already know =
width
                                                 275,  -- already know =
height
                                                memDC,
                                                 0,=20
                                                 0,
                                                SRCCOPY} )


  Thanks in advance
  euman at bellsouth.net


------=_NextPart_000_0016_01C000A4.D9B18420
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Actually memBM =3D=20
c_func(iCreateCompatibleBitmap,{hdc, 197, 275}) isnt even =
needed.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV><FONT face=3DArial size=3D2>Original Message:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT><BR>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>To display a DIB (device independant =
bitmap) in=20
  Windows (95,98,2K,NT)</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>If I use the below Code (My_Code) =
what if any=20
  compatibility issue might I run into?</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;From =
Microsoft=20
  SDK</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D1>&nbsp;&nbsp;&nbsp; HDC memDC =3D =
CreateCompatibleDC=20
  ( hDC );<BR>&nbsp;&nbsp;&nbsp; HBITMAP memBM =3D =
CreateCompatibleBitmap ( hDC=20
  );<BR>&nbsp;&nbsp;&nbsp; SelectObject ( memDC, memBM =
);<BR></FONT><FONT=20
  face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; <U>This =
Works in my=20
  program on my Machine.</U></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>My_Code:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>constant SRCCOPY =3D =
#CC0020<BR></FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>atom memDC, memBM, hBitmap, =
Bitmap_file, selBmp,=20
  ShowBmp</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Bitmap_file =3D=20
  allocate_string("eumans.bmp")</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;memDC&nbsp;=3D=20
  c_func(iCreateCompatibleDC, { hdc })<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
memBM =3D=20
  c_func(iCreateCompatibleBitmap,{hdc, 197,=20
  275})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hBitmap =3D c_func(iLoadImage, =

  =
  {NULL, Bitmap_file, IMAGE_BITMAP, 197, 275, =
LR_LOADFROMFILE})</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selBmp =
=3D=20
  c_func(iSelectObject,{memDC, =
hBitmap})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  ShowBmp =3D c_func(iBitBlt, {hdc,=20
  =
  &nbsp;415,&nbsp; -- x=20
  =
  &nbsp;220,&nbsp; -- y=20
  =
  &nbsp; 197,&nbsp; -- already know=20
  =
  &nbsp; 275,&nbsp; -- already know=20
  =
  =
  &nbsp;0,=20
  =
  =
  &nbsp;SRCCOPY} )</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Thanks in advance</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2><A=20
  =
  <DIV><FONT face=3DArial =

------=_NextPart_000_0016_01C000A4.D9B18420--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu