Re: Reading material needed - learning VB Express 2008, knowing VB6
- From: Armin Zingler <az.nospam@xxxxxxxxxx>
- Date: Sat, 26 Sep 2009 21:56:33 +0200
C schrieb:
On 26 syys, 19:35, Armin Zingler <az.nos...@xxxxxxxxxx> wrote:
C schrieb:
That's why I've asked which problems you have (with the basics), becauseUse the methods of the Graphics object to draw on.That part is simple, so also is creating a graphics object or using an
existing one.
Which problems or questions do you have? (as you see, I also don't haveI feel I don't understand the basics.
a recommendation other thanhttp://msdn.microsoft.com/en-us/library/a36fascx.aspx
which is, in this case, well structured for learning, too.)
I'd like to help.
Thanks for your willingness and intention. I don't have many specific
questions yet. I feel I don't understand very much; I am not on solid
ground even though I am able to do a little bit of programming which
works. But I can ask a couple of questions now.
What is MyBase in Private Sub Form1_Paint(ByVal sender as Object, ...)
Handles MyBase.Paint?
MyBase is a VB keyword. It refers to the base class of the class that
contains the keyowrd. For example, inside class Form1, it refers to
class System.Windows.Forms.Form because it's the base class of Form1.
In this case it's the same as "...Handles Me.Paint" because the Paint
event is inherited.
What does
Dim g as Graphics = Graphics.FromImage(frmImage)
actually do? Does it create a new graphics object g or does it simply
make the image(bitmap) of g the frmImage?
Is there a better way? I think the terminology is not intuitive. I
suspect CreateGraphics should always create something new, but that
does not seem to be the case, and nothing I have read so far explains
the fundamentals of what FromImage and CreateGraphics does.
Me.CreateGraphics can't be creating a new image for the Form. I have
now also read half of what I printed out in the evening.
A Graphics object is a painter who paints on a target canvas. By
calling the Graphics object's Draw* methods, you instruct the painter to
paint on the canvas.
- Graphics.FromImage creates a painter that paints on an image. The
image is the canvas.
- Me.CreateGraphics inside a Form creates a painter that paints on the
Form. The Form is the canvas.
--
Armin
.
- Follow-Ups:
- References:
- Reading material needed - learning VB Express 2008, knowing VB6
- From: C
- Re: Reading material needed - learning VB Express 2008, knowing VB6
- From: Armin Zingler
- Re: Reading material needed - learning VB Express 2008, knowing VB6
- From: C
- Re: Reading material needed - learning VB Express 2008, knowing VB6
- From: Armin Zingler
- Re: Reading material needed - learning VB Express 2008, knowing VB6
- From: C
- Reading material needed - learning VB Express 2008, knowing VB6
- Prev by Date: Re: Blank string to number
- Next by Date: Re: Conversion vb6 to VB 2008 Express
- Previous by thread: Re: Reading material needed - learning VB Express 2008, knowing VB6
- Next by thread: Re: Reading material needed - learning VB Express 2008, knowing VB6
- Index(es):
Relevant Pages
|