Re: One Thing I Noticed - Line Too Long
- From: "Michael C" <nospam@xxxxxxxxxx>
- Date: Tue, 1 Nov 2005 12:56:27 +1100
"Mike Williams" <mike@xxxxxxxxxxxxxxxxx> wrote in message
news:dk5lca$gsn$1@xxxxxxxxxxxxxxxxxxxxxx
> Michael, you are being absolutely stupid now! Are you seriously suggesting
> that creating a VB Autoredraw picture box automatically creates a separate
> and otherwise non existent bitmap in video card memory! If that is what
> you
> are suggesting then you are totally wrong! You're just attempting to
> wriggle
> out of your previous statement that an Autoredraw picture box is
> inefficient
> because you said it uses too much memory because it creates two bitmaps.
> That is *not* true. It does *not* create two bitmaps, and it does *not*
> create an otherwise non existent bitmap in video card memory! I'm sitting
> in
> front of a computer right this minute that has a 32 Mb GeforceI DDR video
> card which does *not* use system memory and I have just run some code that
> creates and draws into Autoredraw picture boxes (512 x 1024 pixels at 16
> bpp). Each picture box uses 1MB of memory, and my code has just created
> well
> over 200 of them! You can't get 200 MB onto a 32mb card! (And don't come
> back with any nonsense about cards that can use various amounts of system
> memory. My Geforce card is *not* one of them!).
Mike, this is *not* what I am saying and I am not trying to wriggle out of
anything. I am not saying any of the above, some of which is so stupid I
cannot believe you even suggested it. All I am saying is that autoredraw
creates an extra bitmap the size of the picturebox. Maybe saying 2 bitmaps
was the wrong way to put it but I didn't expect someone trying so hard to
prove me wrong.
> Why should that be a problem Michael? You would only create an Autoredraw
> picture box of such size if you specifically wanted a memory bitmap of
> that
> size for some specific purpose. And if you did for some reason want a
> bitmap
> of such a size then the amount of memory used by the Autoredraw picture
> box
> bitmap would be exactly the same as a similarly sized memory bitmap that
> you
> might create using the API or using your dot net stuff.
It's just hacky typical of vb. I believe this has changed since previous
versions because when I tested autoredraw years ago I'm sure it allocated
the bitmap as the form was resized.
> No it is *not* Michael. It is *not* a second bitmap, whether you display
> it
> on the screen or not! The screen display memory bitmap is *already* there,
> and is *already* in use. Its creation has nothing whatsoever to do with
> the
> picture box. The screen memory bitmap is created by the operating system
> *before you even load up Visual Basic*! It is there all the time! Its
> current contents (individual pixel colours) change all the time of course
> (just as the contents of any bitmap can be changed at any time), but the
> bitmap itself has been in existence and has been in memory since you
> started
> Windows. The Autoredraw picture box creates only *one* bitmap. How many
> times do I have to say this before you realise that I am telling you the
> truth! As far as bitmap memory is concerned, an Autoredraw picture box
> uses
> exactly the same amount of memory as would be used if you didn't have a
> picture box and you instead created a bitmap in memory using the API (or
> your dot net createbitmap thing or whatever).
I know what you are saying mike, you just misunderstand (big time) what I am
saying. Believe me I understand how this works. With autoredraw turned off
you have what's on the screen, if your screen is 1280x1024x32bpp your video
card will use approx 5mb to display the screen and will always use that 5mb
no matter what you put on the screen. If you display a bitmap on the screen
then that bitmap goes into that 5mb or whatever part of that bitmap is
visible. You could consider this one copy. I know it is the video card
memory and the bitmap will be lost if it is wiped over and all that but
while it is being displayed on the screen the bitmap is still in the video
cards memory and that is one copy. The second copy I was referring to is
what is in the autoredraw buffer. I was NOT saying that autoredraw creates 2
bitmaps, I was saying it creates an *additional* bitmap.
> Look Michael. This is how it is. When you create an Autoredraw picture box
> then the first time you draw into it using a VB method (or alternatively
> the
> first time you access its hDC property to draw into it with the API) VB
> will
> create a memory device context for you and an associated memory bitmap.
> Just
> *one* bitmap. Have you got that Michael? Just *ONE* bitmap! That bitmap is
> selected into the picture box's "Autoredraw device context" (the hDC that
> is
> returned when you ask for it while its Autoredraw property is set to
> True).
> So, the picture box now has two device contexts (and I think that's
> probably
> where you have got confused).
Mike, it's you who is confused.
Michael
.
- Prev by Date: Re: Cheque Writing with VB
- Next by Date: Re: how many files in a folder
- Previous by thread: Re: One Thing I Noticed - Line Too Long
- Next by thread: Re: One thing I noticed
- Index(es):
Relevant Pages
|