Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - Getting parts from another image [VB] | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Darth Coby

Vire
Dacht je nou echt dat het over was?
Dacht je nou echt dat ik gebroken was? Nee toch?
Nou kijk eens goed op uit je ogen gast.
zonder clic heb je geen kloten tjap... bitch
Level: 55

Posts: 420/1371
EXP: 1240774
For next: 73415

Since: 03-15-04
From: Belgium

Since last post: 2 days
Last activity: 9 hours
Posted on 04-01-04 02:03 AM Link | Quote
I want to make this level editor kind of thing, but, how would I load a certain part from a GFX file that's inserted into the program, and then output it in the real form, and next to that I'd show the next image using the next byte, then after a certain amount of bytes it'll go down one line and start over. That until the level is mapped out.
Gavin

Fuzzy
Rhinoceruses don't play games. They fucking charge your ass.
Level: 43

Posts: 8/799
EXP: 551711
For next: 13335

Since: 03-15-04
From: IL, USA

Since last post: 13 hours
Last activity: 13 hours
Posted on 04-01-04 05:49 AM Link | Quote
http://gavin.panicus.org/programming.php

scroll down "Visual Basic Sources/Resources" and at the bottom you'll see "BitBlt Sample". a long while ago when i was first trying to figure out how to make an editor, TFG showed me this nice little example using the BitBlt API.

If i understood what you said correctly, this should be what you're looking for?
Darth Coby

Vire
Dacht je nou echt dat het over was?
Dacht je nou echt dat ik gebroken was? Nee toch?
Nou kijk eens goed op uit je ogen gast.
zonder clic heb je geen kloten tjap... bitch
Level: 55

Posts: 424/1371
EXP: 1240774
For next: 73415

Since: 03-15-04
From: Belgium

Since last post: 2 days
Last activity: 9 hours
Posted on 04-01-04 03:19 PM Link | Quote
Yes, that's about what I meant, I'm sure I can build further from that. Thanks!
Tuvai
Permanently banned for account hacking.
Level: 24

Posts: 143/211
EXP: 74894
For next: 3231

Since: 03-15-04

Since last post: 566 days
Last activity: 339 days
Posted on 04-02-04 12:39 AM Link | Quote
Nifty, didn't know you could do that kind of stuff with a simple picturebox.
Gavin

Fuzzy
Rhinoceruses don't play games. They fucking charge your ass.
Level: 43

Posts: 9/799
EXP: 551711
For next: 13335

Since: 03-15-04
From: IL, USA

Since last post: 13 hours
Last activity: 13 hours
Posted on 04-02-04 02:15 AM Link | Quote
Originally posted by Tuvai
Nifty, didn't know you could do that kind of stuff with a simple picturebox.


yep yep.


and coby:


For y = 0 To 16
For x = 0 To 16

BitBlt picMap.hdc, x * 16, y * 16, 16, 16, picWhatever.hdc, 0, 0, vbSrcCopy
Next x
Next y


that was more like what you actally asked for. i just had on hand the mouse example, since i know that's also probably what you need, and you could've probably figured this out anyway. but you'd want to put in, of course as you were saying, some sort code to load from an array and display whichever graphic the data pointed to

but how you do that really all depends on how you're setting up your program. but if you have any more questions...by all means
Darth Coby

Vire
Dacht je nou echt dat het over was?
Dacht je nou echt dat ik gebroken was? Nee toch?
Nou kijk eens goed op uit je ogen gast.
zonder clic heb je geen kloten tjap... bitch
Level: 55

Posts: 430/1371
EXP: 1240774
For next: 73415

Since: 03-15-04
From: Belgium

Since last post: 2 days
Last activity: 9 hours
Posted on 04-02-04 04:41 PM Link | Quote
Well, I'm going to port my PHP script to VB. (I made a VB scrip that shows the F-Zero levels) I'm going to turn it into a level editor because my script can only VIEW. In VB I'd be able to edit.
And since I could use about the same coordinate algorithm as the one I made for my PHP script this should be pretty easy now. Only problem is. I don't know how to turn a string into a byte array. :s
Gavin

Fuzzy
Rhinoceruses don't play games. They fucking charge your ass.
Level: 43

Posts: 15/799
EXP: 551711
For next: 13335

Since: 03-15-04
From: IL, USA

Since last post: 13 hours
Last activity: 13 hours
Posted on 04-03-04 02:45 AM Link | Quote
well sir, there may be you're problem

i don't think you want it to be as a string at any point in your program. you should load it right from the start into a byte array. let me demonstrate:


Private Tiledata() as Byte
------------------------------------------------------

Open FileName For Binary As #1
ReDim Tiledata(LOF(1) - 1)
Get #1, , Tiledata
Close #1


that should nicely, neatly, and quickly load the entire file into an array of bytes. the array is redimensioned to be the length of the file that is opened. so there yah go, hope that helps too
Darth Coby

Vire
Dacht je nou echt dat het over was?
Dacht je nou echt dat ik gebroken was? Nee toch?
Nou kijk eens goed op uit je ogen gast.
zonder clic heb je geen kloten tjap... bitch
Level: 55

Posts: 434/1371
EXP: 1240774
For next: 73415

Since: 03-15-04
From: Belgium

Since last post: 2 days
Last activity: 9 hours
Posted on 04-04-04 06:24 AM Link | Quote
Alright thanks, but now I have some more questions, I used your method and it would only print the first byte of the array all over the place. Then I ported MY code and it doesn't work at all. :\ My code DID work in PHP.

Errorneous VB code:
For Offset = Tiledata(0) To Tiledata(200)
For X = 0 To 32
For Y = 0 To 16
srcX = Val(Left(Tiledata(Offset), 1)) * 257 - 257
srcY = Val(Left(Tiledata(Offset), 2)) * 257 - 257

BitBlt picLvl.hDC, X * 257, Y * 257, 257, 257, Picture1.hDC, srcX, srcY, vbSrcCopy
'picLvl.Refresh
Next Y
Next X
Next Offset

My VB code:
For Offset = Tiledata(0) To Tiledata(2)
If prgRan = 32 Then
prgVertbyte = prgVertbyte + 1
ran = 0
End If

Y = prgVertbyte * 257 - 257
srcX = Val(Left(Tiledata(Offset), 1)) * 257
srcY = Val(Left(Tiledata(Offset), 2)) * 257
prgRan = prgRan + 1
BitBlt picLvl.hDC, prgRan * 257 - 257, Y, 257, 257, Picture1.hDC, srcX, srcY, vbSrcCopy
Next Offset

My PHP Code:
while ($next = current($pieces)) {
if($run==32){
$vertbyte == $vertbyte++;
$run = 0;
}
$Y = $vertbyte*$s-$s;
$srcX = hexdec(substr($next, 1, 2)) * $s;
$srcY = hexdec(substr($next, 0, 1)) * $s;
$run == $run++;
imagecopy($backgroundimage, $image_id, $run*$s-$s, $Y, $srcX, $srcY, $s, $s);
next($pieces);

Also, whenever I drew the image and I move something else over it the picture dissappears. Is there a way to make it permanent?

EDIT: Also, I don't want to load the whole ROM in memory, just the level. ($200 bytes)


(edited by Coby on 04-03-04 08:25 PM)
(edited by Coby on 04-03-04 08:51 PM)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - Getting parts from another image [VB] | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.015 seconds.