Sharing a created device context 
Author Message
 Sharing a created device context

I am working on a usercontrol that has the potential of being sized on the
fly to the dimensions of the parent applications client area.  Since I am
drawing the control, this poses something of a problem for me, especially
since the resizing will occur as a user resizes a form.

When I create a compatible DC and subsequently create a compatible bitmap,
I plan on creating the bitmap  so that all instances of the control can
access it via a friend property.  This way, I can create it large enough so
that the underlying bitmap is adequate sizewise, while sharing it will keep
the overall memory usage acceptable.  I am considering this because
constantly creating and destroying the bitmap would be the slowest part of
a resize.

My question, is this... If I create a compatible bitmap for one instance of
my control, will it be compatible with all instances of the usercontrol?

Optionally, another solution is to resize the bitmap on the fly.  Is there
a way to resize a DC's bitmap without destroying and recreating it?


Visual Basic *5* Tips & Tricks
[ http://www.*-*-*.com/ ~finaidtk]

Fri, 12 Nov 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Sharing a created device context

2. Extracts the bitmap context from device context

3. Printer Device Context Handle for old ActiveX control

4. Graphics - Device Context

5. Graphics -> Device Context

6. BMP without a device context

7. Print Device Context in VB

8. Getting a Device Context in VB for Win CE

9. Bitmap device context problem

10. Device Context Handle - PLEASE HELP

11. Need byte array ==> Device Context routine

12. Device Context: I just want do know!


Powered by phpBB® Forum Software