🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.programmer.graphics
4 messages
4 total messages Started by Jeffrey Dale Will Fri, 15 Sep 1995 20:15
Object Windows Bitmap question
#2
Author: Jeffrey Dale Will
Date: Fri, 15 Sep 1995 20:15
28 lines
1297 bytes
Hi,

I am working on a project and for the first time doing some
windows programming with Borland 4.5.

What I need to do is display a digitized signal from a frame
grabber card which is a 512X512 array bytes, each byte representing
a b/w intensity from 0-256.

I need to make a window which will display this array.  I know
how to do the dos type graphics where there are segments which are
directly memory mapped, but I have no clue in Windows.  I was looking
for a Windows API or ObjectWindows function/class that would let
me specify a 512x512 chunk of memory bytes and then would display
the b/w image in a Window.

Anybody have any ideas for me?  I would really appreciate some help,
especially if someone has some code that they have used to do something
like this.  Thanks,


jeff

-- 
Jeffrey Will
Grad, Electrical Engineering
University of Illinois at Urbana-Champaign
office:(217)333-2483  home:(217) 344-4293 
Re: Object Windows Bitmap question
#3
Author: Aaron Evans
Date: Sun, 17 Sep 1995 19:00
12 lines
915 bytes
Welcome to the world of windows.  It should be easy, but it can become
complicated and confusing.  There's a bitmapscroll sample app provided
with owl (i think its called bmpscrll.cpp), but there's a better one
somewhere on borland's bbs that also includes clipboard functions.

Probably the hardest part is getting used to the idea of device contexts.
After a little research, remember: only one bitmap can be associated
with one dc at any given time.  I would be happy to answer specific 
questions.

Aaron Evans
situs@sirius.com
Re: Object Windows Bitmap question
#4
Author: J Scott Peter
Date: Thu, 21 Sep 1995 06:55
38 lines
2556 bytes
Aaron Evans (situs@sirius.com) says:
> Welcome to the world of windows.
> ...
> I would be happy to answer specific questions.

How generous of you!  I'm not the person you addressed that offer to, but
hopefully you'll extend it to me too.

I am also just getting my feet wet in Windows via OWL.  I am able to read a
.bmp file into a TDib, and display it with TDC::SetDIBitsToDevice.  But now I
want to create and modify a TDib.  It seems the only way to do that is to
create a TDibDC pointing to the TDib.  For some reason, that didn't work
for me... it caused my screen to go black as soon as I initialised the
TDibDC.  The docs say that TDibDC uses a driver called dib.drv.  I don't
have any such file in the \windows\system dir.

It seems like TDibDC is not a good way to go.  Does `using' dib.drv (assuming
I could find the file) cause disk accesses?  Why would my screen go blank,
when TDibDC is supposed to be something that just accesses a memory object?
Isn't there a more `native' way to draw into a DIB?

Would I be better off using a TMemoryDC to draw into instead?

One more question (if you don't mind).  I'm confused by the relationship of
DCs to bitmaps and video memory.  I can create a TClientDC from a TWindow,
to draw into the window.  And I think I can create a TMemoryDC or TDibDC to
draw into memory.  But I'm confused by the TDC::SetDIBits and TDC::GetDIBits calls.
These calls take TBitmap and TDib arguments, and transfer bits between those
two.  But these calls don't seem to do anything to the device associated with
the DC.  Why must you transfer bits between TBitmaps and TDibs using a DC
associated with some `third' object?  Why can't you create a DC into either
the TBitmap or TDib to do the transfer?

Hoping for diminution of confusion...
-- 
J Scott Peter XXXIII   //  Wrong thinking is punishable.
scotty@netcom.com     //  Right thinking will be as quickly rewarded.
Los Angeles          //  You will find it an effective combination.
Re: Object Windows Bitmap question
#5
Author: Aaron Evans
Date: Sun, 24 Sep 1995 03:59
1 lines
439 bytes
Testing.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads