Re: Simulate Autoredraw

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Use whatever you want. I personally use the bitblt and it's ligntning
quick. I would think that an image has to be rendered during each paint
event from a general format and copied to the picturebox or whatever. In VB6
and before, I think controls had the option of having their background
persistent in memory and didn't have to be redarwn to the picturebox, etc.
each time it was repainted. However, in VB.Net this changed so the image has
to be copied to the picturebox during each paint event.

--
Dennis in Houston


"Doug Marquardt" wrote:

Hi Dennis:

Pardon my ignorance here...
but I really don't see how bitblt in the paint event
could be quicker than assigning the bitmap
to the image -- the point being that once I assign
the image the control takes over all the painting, etc.???

Just curious...

Doug.


"Dennis" <Dennis@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:62E328B6-D10B-406B-AE2A-A233D041A012@xxxxxxxxxxxxxxxx
I think it may be a bit quicker.
--
Dennis in Houston


"Doug Marquardt" wrote:

Hi Dennis:

I was able to figure out to create the graphics from the bitmap,
and was able to draw to it, etc.
Assigning the bitmap to the image property seems to work fine...
what advantages would there be to bitblt in the paint event?

Doug.



"Doug Marquardt" <no_spam@xxxxxxxxx> wrote in message
news:%23IgjOtQ4GHA.3444@xxxxxxxxxxxxxxxxxxxxxxx
Hi Dennis:

That was the first thing I looked at, but I couldn't
figure out how to draw to the bitmap (the only
method I saw was for setting pixels).

So how do you draw to the bitmap?

Doug.

"Dennis" <Dennis@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4CEAC020-1D11-4686-937B-280B6AAF7009@xxxxxxxxxxxxxxxx
Just create a bitmap that's persistent. You can then create a
graphics
object from it and draw on the bitmap. In the paint event, you can
use
bitblt to copy the bitmap to your form, picture box, or whatever. I
have
an
example if you like.
--
Dennis in Houston


"Doug Marquardt" wrote:

Hi All:

I want to simulate VB6 Autoredraw in VB.Net

I figure I would probably have to create a memory dc,
paint to that, and then create a bitmap based on the dc
and copy that image into a bitmap,
and then assign that to the image property of my control?

If so, then can someone push me in the right direction
to get started on this.

If not, then what would you suggest.

Thanks.

Doug.











.



Relevant Pages

  • Re: MEM DC
    ... Create a DC and a memory bitmap and then draw onto that. ... called draw the content of the memroy DC on to the display DC. ... One is to simply make a memroy DC in your Paint Routine, ... And a CBitmap object, which you can initalize using CreateCompatible Bitmap. ...
    (microsoft.public.vc.mfc)
  • Re: Printed size of screen captures from MS Paint and from Paint Shop Pro.
    ... printed image is 6 inches wide. ... the paste the image into MS Paint or Paint Shop Pro, ... To simplify my explanation I'll stick to explaining what happens on most typical Windows machines which run at the standard 96 pixels per logical inch setting. ... if you perform some action that saves or copies that image as a bitmap then the default logical size of the bitmap depends on whether or not that bitmap contains information relating to its intended physical size. ...
    (microsoft.public.vb.general.discussion)
  • Re: Help with SendKeys
    ... MS Paint does not "open itself up to the ... bitmap of the desired colour depth and to write some code to load your ... original pixel colours in such a way that the resultant reduced colour ...
    (comp.lang.basic.visual.misc)
  • Re: Graphic
    ... You just want to load a bitmap and draw it in the paint ...
    (microsoft.public.windowsce.app.development)
  • Re: Persisting Dynamic Bitmaps
    ... The sample draws 1000000 lines on a bitmap (which takes a few seconds to ... draw), and the on paint simply draws that on the screen. ... I want to keep an instance of CBitmap in global ...
    (microsoft.public.vc.mfc)