Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / VB6 question

Author
Message
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 30th May 2004 23:00
I've searched, and searched, and searched.
I can't find info on it anywhere...
Anybody know how to make a very simple paint
(even simpler than MSPaint) program in VB?

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th May 2004 23:14
look up vb6 and GDI


* DBP_NETLIB_v1.2 - NOW WITH VARIABLE WATCHER! * Click Logo
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 30th May 2004 23:20 Edited at: 31st May 2004 00:05
I had a feeling you'd be first to reply.
Ok, found what I was looking for. It had been under my nose for 5
years and I hadn't noticed it.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st May 2004 00:11 Edited at: 31st May 2004 00:12
(This is a very simple example)

Add a picturebox to your form.

Ad the following code:



Run and wiggle your mouse over the box.


[edit]

Better drawing:



Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 31st May 2004 00:30
Thanks, David. It's the same thing I'd come across. All this time, I thought the picture box was only for showing pictures.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st May 2004 00:40
Lol, it does so much more

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 31st May 2004 02:34 Edited at: 31st May 2004 03:10
Can it scale an image to fit the box's size? I messed with a whole bunch of properties, and saw no difference.

And another thing, I'd forgotten to ask: Even after Randomize timer, Rnd ALWAYS returns 0! Why? What am I supposed to do?

Gir
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Crazy Taco
Posted: 31st May 2004 04:11
rnd can only return a value between 0 and 1 so if you have some kind of check on it it might be stopping it. Probly not what is goin on but this happened to me once so syou might want to check it out

I'm makin' a cake...
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 31st May 2004 04:29
from vb6 help

Quote: "Dim MyValue
MyValue = Int((6 * Rnd) + 1) ' Generate random value between 1 and 6."



* DBP_NETLIB_v1.2 - NOW WITH VARIABLE WATCHER! * Click Logo
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 31st May 2004 05:18
So that how it works here!
I've been mixing up too many languages. Getting confused.
Rand in C has no paramiters, Rnd in DB has the maximum as a paramiter,
in Euphoria rand is the same as DB's rnd() and in VB it's between 0 and 1. My head hurts enough with the flu, I don't need random numbers confusing me any more.

Thanks for the help guys. I'm not thinking very clearly today. (Having a fever, head about to explode, 5...4...3...)

Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 31st May 2004 05:32 Edited at: 31st May 2004 05:34
Quote: "with the flu"

You have it too huh?

Quote: " (Having a fever, head about to explode, 5...4...3...)"

Take some painkillers

Projects in progress: Lerioonia, Crescent
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 31st May 2004 06:16
pain killer---->



* DBP_NETLIB_v1.2 - NOW WITH VARIABLE WATCHER! * Click Logo
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 31st May 2004 21:20 Edited at: 31st May 2004 21:38
I feel like getting a MAC and hitting it on my head. Repeatedly.

I took about 7 pills yesterday. Painkillers, Vitamin C. Also, pills that I don't know they're for, but their names sounded pretty medical and stuff...

I'll recycle this thread and see if I can get some other questions answered:
Can somebody explain object memblocks to me? I have read the help files, and I didn't really understand anything. Some of you might remember that codebase entry of mine (the only one I've ever made ) that gets a heightmap and shapes a matrix accordingly.
Well, I'm trying to adapt it to Meshes instead of matrices, to see if
I get any faster framerates.

David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st May 2004 21:25 Edited at: 31st May 2004 21:27
Quote: "Can somebody explain object memblocks to me? "


Hmmmmmmmmmmmmmmmmmmmmmmmmm.

Memblocks cover such a wide variety of uses that it's impossible to teach everything at once. Have a look at TGC's tutorial, that's pretty good.

http://files.thegamecreators.com/developer/dbpro/DBPro_Tutorial_9_2D_MemBlock_Star_fields.zip

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 31st May 2004 21:39
No no no no... Not memblocks in general. Just Mesh memblocks.

zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 31st May 2004 22:50
Actually, the help files do a pretty good job of explaining the formats used...

MAKE MEMBLOCK FROM MESH
This command will make a memblock from a mesh. The specified values must be integer values and the source resource must exist or the command will fail. The mesh memblock is layed out in the following
format. The first DWORD is the FVF Format, which controls which components each vertex of your mesh will contain. The default FVF Format is 338. The second DWORD is the FVF Size, which is the size in bytes of a single vertex element. This size is respective of the FVF Format you specified, which has a default of 36. The third DWORD is the number of Vertices in your mesh. The remainder of the memblock contains mesh data. The mesh data is a sequential list of vertices, containing the component data arranged as specified by the FVF Format. The default FVF Format would specify the following arrangement of data within the vertex element, which is duplicated for every vertex specified in the memblock. Each grouping of
three vertices makes a polygon. Given the default FVF Format of 338, the first three FLOAT values (12 bytes) of the vertex element would be the XYZ coordinates in model space. The second three FLOAT
values (12 bytes) of the vertex element would be the normals coordinates in model space. The next DWORD is a diffuse colour component that specifies the colour of the vertex. The last two FLOATS are UV texture coordinates for the vertex. This adds up to 36 bytes which is the size of a single vertex. Multiply 36 by the number of vertices in the mesh and you get the overall size of the mesh data.

History did not begin with PONG. -- Greg Costikyan

Game Beavers
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 31st May 2004 23:49
You need to understand how memblocks are used before embarking on manipulating them

That's why I suggested the TGC tutorial.

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 1st Jun 2004 00:04
I've used memblocks before. Though, only for manipulating images (faster blur, image blending, etc.) and never for Meshes.

what does it mean, if the FVF format is 338?
What is FVF?
Other than that, I understand everything till the mesh data starts.

So, let's say I wanted to make a 10x10 "matrix".
it'd start like: 338, 36, 100 (?)
I think the 100 is wrong, as I aparently need triangles, not squares.
Then what's next?

Login to post a reply

Server time is: 2024-11-25 10:42:34
Your offset time is: 2024-11-25 10:42:34