Question for API expert 
Author Message
 Question for API expert

I've written a VB program that analyzes grayscale bitmaps.

So far, I've been using the bitmap at full scale so I can use
the POINT method to retrieve the grey value of the pixel by clicking
on it.

What I would like to do is, using stretchblt, stretch or shrink the
bitmap so it fits in a fixed sized picture box.  If I do not have the
image at full scale on the screen I cannot use POINT to get the grey
value of the pixels.  

I'm not at all familiar with GDI functions (and havn't been able
to find a good book either !) - could someone tell me how to get the
colour value of each pixel from the bitmap itself (in memory), as
opposed to the screen dependent POINT method.

All responses are, of course, appreciated greatly, as I am a novice
programmer.

Jeff Lee



Mon, 26 Jan 1998 03:00:00 GMT  
 Question for API expert
Jeff Lee,


Quote:
> - snip -
>What I would like to do is, using stretchblt, stretch or shrink the
>bitmap so it fits in a fixed sized picture box.  If I do not have the
>image at full scale on the screen I cannot use POINT to get the grey
>value of the pixels.  
> - snip -

Have you tried using the Image control? (10th control down left of
toolbox).

It is like a picture box, but allows the streching of bitmaps.  (Set the
Stretch property to True)


SORRY - Can't recieve any replies : Mail server's down :o(

Quote:
>------------------------------------------------------------------<

      It is better to keep your mouth shut and appear a fool,
            - than to open it and remove all doubt!


Tue, 27 Jan 1998 03:00:00 GMT  
 Question for API expert

Quote:

>What I would like to do is, using stretchblt, stretch or shrink the
>bitmap so it fits in a fixed sized picture box.  If I do not have the
>image at full scale on the screen I cannot use POINT to get the grey
>value of the pixels.  

GetPixel would be my suggestion.

John
-----------------------------------------------
VisualWare, Inc.
Custom Visual Basic, C++, and Windows Programming
1675 East Main St, Suite 218
Kent OH 44240
(216) 297-4444

-----------------------------------------------



Tue, 27 Jan 1998 03:00:00 GMT  
 Question for API expert

Quote:
>I've written a VB program that analyzes grayscale bitmaps.
>So far, I've been using the bitmap at full scale so I can use
>the POINT method to retrieve the grey value of the pixel by clicking
>on it.
>What I would like to do is, using stretchblt, stretch or shrink the
>bitmap so it fits in a fixed sized picture box.  If I do not have the
>image at full scale on the screen I cannot use POINT to get the grey
>value of the pixels.  
>I'm not at all familiar with GDI functions (and havn't been able
>to find a good book either !) - could someone tell me how to get the
>colour value of each pixel from the bitmap itself (in memory), as
>opposed to the screen dependent POINT method.

If you have autoredraw set to true, GetPixel() will read an invisible or
off-screen bitmap. Here's the dec:

Declare Function GetPixel& Lib "GDI" (ByVal hDC%, ByVal X%, ByVal Y%)

You pass the hDC of the picture box (use the .hDC property), and the X
and Y coordinates *IN* *PIXELS* and it returns a long value for the color.

I've never tried to create memory DC's, but a picture box with autoredraw
set to true seems close enough.

As for the book, check out Appleman's Visual Basic Programmer's Guide to
the Windows API.
--
_________________________________________________________
Robert Woodcock | Note: Your standard disclaimers apply. |

................| it can be quite a curse) - Plucky Duck |



Tue, 27 Jan 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Question for VB and WIN API Experts

2. MDI - a question for VB WIN API experts

3. API Experts - Can you help me?

4. EXPERT VB : ListView API

5. Expert API call help needed ( FindFirstChangeNotification )

6. API Experts: please help me...

7. ***API EXPERTS ONLY***

8. API experts wanted

9. Desperate for API expert

10. Calling All Win32 API Experts -- Data TreeView Control

11. Text API Expert please

12. API Experts - Help!

 

 
Powered by phpBB® Forum Software