[clean-list] Low-level graphics under Windows

Jerzy Karczmarczuk karczma@info.unicaen.fr
Thu, 11 Jan 2001 09:21:48 +0000


Martin Wierich includes a lot of information about it 
(bitmaps, etc.). THANK YOU VERY MUCH.
...

> The bitmapContents field contains the bitmaps whole pixel information. 
> It is stored in Microsofts (?) device independent format which you have 
> to look up.
...

Sure, I spent some hours with the MSDN library doc, I see the difference
between DIBs and BITMAPs, etc.


> It is your choice if you want to work directly with this bitmapContents 
> or with some data structure that you derived from this information 
> (e.g. a two dimensional array).

Not only my choice, but of many applications which deal directly with
palettes and bit arrays, knowing that Windows GDI kernel is obliged to
separate all this information. I didn't want to repeat the work
already done. Converting all this into Clean {#  } is another story,
here, obviously I am on my own if the, IO modules do not do that. I
needed
just the access to raw bitmap data. I *think I see* now how to get it. 


> So you also need to know how to store pixels in a bitmap. At first 
> you somehow have to generate a {#Char} bitmapContents. 
> (This is your problem.)

If you say so. I think that the possibility of storing a Picture on
a bitmap is of general interest, so I might share this problem with some
other people. OK!


> If you dive into the C implementations (as proposed by John) you can 
> find out what these "win..." functions do: winCreateScreedHDC 
> creates a device context, winCreateBitmap applies this transformation 
> and delivers the handle.
> winDestroyScreenHDC deallocates the device context again  ...

I had a look on _12 "C" section even before posting my query, I just
found a few bits missing, for example the bitmap handle had no usable
functions to operate upon. But with the aid of the great Microsoft 
Friend I'll try to patch that. BTW. why the HDC is deallocated?

> ... or did I leave any question open?
> 
> groetjes,
>   Martin Wierich
>   (send us your fancy mapping warping morphing graphics stuff)


Hm. The point is that the number of questions I could pose is
potentially infinite. But I won't do it unless I am again hopelessly
stuck, and it will take a while. I will obviously share all my
gracious output, when it becomes non-trivial. Believe me, I am 
abhorred by this low-level GDI etc. bazaar, I enjoy functional
programming...


Thank you very much again.

===

A different, but related question.
When juggling with different windows (and applications) on the screen,
I noticed that the regeneration of a Clean graphical window is quite
slow after a partial or total hiding and restoring. You don't use 
back-up storage at all, and everything is reconstructed if the system 
takes notice of the manipulation?




*********************************


Ah, last minute question, just for the record, I have no saved test
to show for the moment: I tried to overload (+) (*) etc for functions
(good for parametric modelling; if you know how to rotate a vector,
and if you can lift the arithmetic to functional domain, you have
the revolution surfaces in one line of code, at a high level of
abstraction). It seems that this bombs under Windows. I'll provide
the tests, but perhaps this is a known issue.

Wszystkiego dobrego.

Jerzy Karczmarczuk