Board index » delphi » non-vcl display bitmap

non-vcl display bitmap

I want to write a very small (WIN API only, no VCL) app. I know how to do
that, but I want to have it display a bitmap. How do I do that using only
WIN API? (It will probably be a 256-color bmp.)

Jon
http://home1.gte.net/jqjacobs/index.htm

 

Re:non-vcl display bitmap


Quote
"Jon Jacobs" <jqjac...@gte.net> wrote in message

news:87991f$20v10@bornews.borland.com...

Quote
> I want to write a very small (WIN API only, no VCL) app. I know how to do
> that, but I want to have it display a bitmap. How do I do that using only
> WIN API? (It will probably be a 256-color bmp.)

I have a C and a  C++ example from EPIX (www.epixinc.com) that may do this.
The command-line programs are a combination of calls to EPIX routines and
Windows API calls, so I'm not absolutely sure they do what you're looking
for.

Send me an E-mail if you want to take a look at them.

--
efg

Earl F. Glynn     E-Mail:  EarlGl...@att.net
Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab

Re:non-vcl display bitmap


On Wed, 2 Feb 2000 06:08:12 -0600, "Jon Jacobs" <jqjac...@gte.net>
wrote:

Quote
>I want to write a very small (WIN API only, no VCL) app. I know how to do
>that, but I want to have it display a bitmap. How do I do that using only
>WIN API? (It will probably be a 256-color bmp.)

It's actually fairly involved, and the details depend on whether the
bitmap is coming from a resource, a file, etc. My recommendation would
be to get a copy of the latest edition of Charles Petzold's
_Programming Windows_, as it will give you everything you need to
know.

The basic idea is that you need to get a handle to the bitmap, and a
handle to the associated palette, if any, create a memory device
context for the bitmap, realize the palette, if any, select the bitmap
into the memory device context, and then use one of the blt functions
(e.g., BitBlt) to copy the bitmap to the desired destination. As you
might imagine, because of the complexity of the route from bitmap
handle to rendered bitmap, there are many alternative paths that you
can take, and which path is "best" will depend on the circumstances.

-Steve

Re:non-vcl display bitmap


Whew! Thank you for the info. At least this will outline what I have to
study. This is, of course, a prime example of why Delphi+VCL is so great.

Jon

Quote
Steve Schafer (TeamB) wrote in message ...
>On Wed, 2 Feb 2000 06:08:12 -0600, "Jon Jacobs" <jqjac...@gte.net>
>wrote:

>>I want to write a very small (WIN API only, no VCL) app. I know how to do
>>that, but I want to have it display a bitmap. How do I do that using only
>>WIN API? (It will probably be a 256-color bmp.)

>It's actually fairly involved, and the details depend on whether the
>bitmap is coming from a resource, a file, etc. My recommendation would
>be to get a copy of the latest edition of Charles Petzold's
>_Programming Windows_, as it will give you everything you need to
>know.

>The basic idea is that you need to get a handle to the bitmap, and a
>handle to the associated palette, if any, create a memory device
>context for the bitmap, realize the palette, if any, select the bitmap
>into the memory device context, and then use one of the blt functions
>(e.g., BitBlt) to copy the bitmap to the desired destination. As you
>might imagine, because of the complexity of the route from bitmap
>handle to rendered bitmap, there are many alternative paths that you
>can take, and which path is "best" will depend on the circumstances.

>-Steve

Other Threads