bitblt on Access form

P

Pritcham

Hi all

I hope someone here can help me. Basically I'm trying to use bitblt on
a picture that's being shown (using the excellent Picturebox class from
Stephen Lebans site) on my Access form.

What I'm trying to achieve is this: I've successfuly loaded the
picturebox with the graphics I want, I've been able to plot on top of
this image but it's working out to be a little too slow due to the
number of plots I'm having to do. In light of that I'm looking at an
alternative - namely combining two/three images into one (like layering
them ontop of each other)

After doing some Googling it appears that using a call to the BitBlt
API function may be what I need but this is where I'm getting stuck.
I've tried numerous calls to the API but all I get is a blank box where
the 'combined' picture should be, so either I'm not calling the API
right or something else is going amiss - any help would really be
appreciated.

Code snippet is below (Where pb2 is the destination, and pb1 is the
already initialised source):

Set pb2 = New clsPictureBox
pb2.ImageControl = Me.img2
pb2.ImageForm = Me

pb2.Clear

BitBlt pb2.hdc&, 0&, 0&, pb.dib_width, pb.dib_height, pb.hdc&, 0, 0,
SRCCOPY

One thing I've come across a number of times is to set the "ScaleMode"
for both source and destination as PIXELS but I can't see this property
anywhere in order to set it

Any help appreciated.
Thanks in advance
Martin
 
P

Pritcham

Whoops! Sorry, I've spoken too soon - all sorted now.

Incase anyone else needs to do something similar then corrected code
snippet is as below:

Set pb2 = New clsPictureBox
pb2.ImageControl = Me.img2
pb2.ImageForm = Me
pb2.LoadImageControl "J:\temp.gif" ' load image to be merged with image
held in pb
pb2.Clear
BitBlt pb2.hdc, 0, 0, pb.dib_width, pb.dib_height, pb.hdc, 0, 0,
MERGECOPY
pb2.UpdateScreen
Me.Refresh

Thanks anyway
Martin
 
Top