Reading material needed - learning VB Express 2008, knowing VB6

C

C

It is difficult for me to follow a lot of discussions on graphics in
VB.net. I have managed to program a little in VB Express 2008 and draw
some lines, and make them persist, but I hardly understand half of the
advice given to me. This indicates that I am missing a lot of
fundamental stuff, which I would like to read up.

Can you suggest reading material on the Internet from which I could
learn the basics?

I have read bobpowell pages, much of msdn, and several miscellaneous
pages about graphics but I have the same problem. They seem to assume
that the reader knows a lof of things which I don't. The result is
that most of what I read does not persist in my mind.
 
A

Armin Zingler

C said:
It is difficult for me to follow a lot of discussions on graphics in
VB.net. I have managed to program a little in VB Express 2008 and draw
some lines, and make them persist, but I hardly understand half of the
advice given to me. This indicates that I am missing a lot of
fundamental stuff, which I would like to read up.

Can you suggest reading material on the Internet from which I could
learn the basics?

I have read bobpowell pages, much of msdn, and several miscellaneous
pages about graphics but I have the same problem. They seem to assume
that the reader knows a lof of things which I don't. The result is
that most of what I read does not persist in my mind.

Use the methods of the Graphics object to draw on.

Which problems or questions do you have? (as you see, I also don't have
a recommendation other than
http://msdn.microsoft.com/en-us/library/a36fascx.aspx
which is, in this case, well structured for learning, too.)
 
C

C

Use 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 have
a recommendation other thanhttp://msdn.microsoft.com/en-us/library/a36fascx.aspx
which is, in this case, well structured for learning, too.)

I feel I don't understand the basics. I have now printed out about 30
pages from the msdn site you have suggested, and will read it.
 
A

Armin Zingler

C said:
That part is simple, so also is creating a graphics object or using an
existing one.


I feel I don't understand the basics.

That's why I've asked which problems you have (with the basics), because
I'd like to help.
 
C

C

That's why I've asked which problems you have (with the basics), because
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?

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

Armin Zingler

C said:
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.
 
C

C

C schrieb:








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.



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.

Thanks. This makes it a bit clearer. The commands are not very
intuitive or are counter-intuitive making it difficult for a beginner.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top