|
 |
« Reply #90 on: January 07, 2011, 05:18:55 PM » |
|
Question... With this new viewer your making, is it possible to see everything as a whole? (every single graphic together)... umm... atm no, but you've given me a new idea for using icons inside of folders (similar to windows explorer's thumnail view in image mode) ^you get the thumbnails, with a large image
right now it'll just be like brawlbox... (when I UD it)
|
|
« Last Edit: January 07, 2011, 08:49:47 PM by Tcll »
|
Logged
|
|
|
|
|
|
 |
« Reply #91 on: January 07, 2011, 06:47:25 PM » |
|
X,Y,TX,TY = 2,2,0,0; fr.seek(offset,0) while length > 0: pixel = fr.read(1).encode('hex') R=G=B=pixel; color,x,y = '#'+R+G+B,TX+X,Y+Y C.create_rectangle ( x, y, (x+1), (y+1), fill=color, width=0) TX+=1 if TX == 8: TY += 1 if TY == 4 and TX == 8: X += 8; TX,TY = 0,0 if X == width+2: Y += 4; X = 2 if TY == 4: TY = 0 TX = 0
length -= 1
erm, i dun understand Tk lol( or python?). There are some things that im having trouble with. This is what i tried to do in c# int X, Y, TX, TY; X = Y = 2; TX = TY = 0;
byte pixel; byte R, G,B;
Graphics g = pictureBox1.CreateGraphics(); int x = 0, y = 0; bw.Seek(0, SeekOrigin.Begin); while (size > 0) { pixel = br.ReadByte(); R = G = B = pixel; color = new SolidBrush(Color.FromArgb(pixel,R,G,B)); x = TX + x; y = TY + y; g.FillRectangle(color, x, y, x + 1, y + 1);
TX += 1; if (TX == 8) { TY += 1; if (TY == 4 && TX == 8) { X += 8; TX = TY = 0; if (X == width + 2) { Y += 4; X = 2; } } if (TY == 4) { TY = 0; TX = 0; } } size -= 1; } g.Dispose();
}
if you understand what i did(fialed to do) wrong, then uh could you explain lol EDIT: btw i got lazy so i used a fixed size and used a fixed gfx. I just made a new file with the gfx data
|
|
« Last Edit: January 07, 2011, 07:06:21 PM by theshyguy »
|
Logged
|
|
|
|
|
|
 |
« Reply #92 on: January 07, 2011, 07:17:25 PM » |
|
here's the code broken down:
def I8(offset,width,height,length): offset = image data offset width,heigth = obviousness length = data length
X,Y,TX,TY = 2,2,0,0; fr.seek(offset,0) X,Y = global XY positioning in the canvas TX,TY = tile XY positioning
while length > 0:
pixel = fr.read(1).encode('hex') read a single byte and return the hex value... (F0)
R=G=B=pixel; color,x,y = '#'+R+G+B,TX+X,TY+Y R,G,B is obvious pixel is the hex color = '#'+R+G+B ('#F0F0F0') x,y = TX+X,TY+Y
C.create_rectangle ( x, y, (x+1), (y+1), fill=color, width=0)
below is the math used for positioning the 1x1 rectangles TX+=1 if TX == 8: TY += 1 if TY == 4 and TX == 8: X += 8; TX,TY = 0,0 if X == width+2: Y += 4; X = 2 if TY == 4: TY = 0 TX = 0
ad finally, subtract from the length (once you're done with the pixel) length -= 1
I8 format's pixels are only 1 byte in length...
|
|
« Last Edit: January 07, 2011, 08:49:36 PM by Tcll »
|
Logged
|
|
|
|
|
|
 |
« Reply #93 on: January 07, 2011, 07:33:11 PM » |
|
thanks gonna retry right now
|
|
|
Logged
|
|
|
|
|
|
 |
« Reply #94 on: January 07, 2011, 07:40:29 PM » |
|
O.o forgot something
fr.seek(offset,0) finds the offset from the start of the file... (absolute position)
|
|
« Last Edit: January 07, 2011, 08:48:54 PM by Tcll »
|
Logged
|
|
|
|
|
|
 |
« Reply #95 on: January 07, 2011, 08:19:51 PM » |
|
interesting programs theshyguy, id like to see some video demos of them though.
|
|
|
Logged
|
I DONT TAKE REQUESTS.
|
|
|
|
|
 |
« Reply #96 on: January 07, 2011, 08:49:45 PM » |
|
^ sorry got nothing to record it with + too lazy to use(or figure out how to use) a hyper cam...
actually yeh ill prob figure out how and try n upload a vid
|
|
|
Logged
|
|
|
|
|
|
 |
« Reply #97 on: January 07, 2011, 08:53:17 PM » |
|
^ sorry got nothing to record it with + too lazy to use(or figure out how to use) a hyper cam...
actually yeh ill prob figure out how and try n upload a vid
camstudio is free, if you want to make a demo. sound is optional and you dont need a webcam from what i understand.
|
|
|
Logged
|
I DONT TAKE REQUESTS.
|
|
|
|
|
|
|
 |
« Reply #100 on: January 07, 2011, 09:03:08 PM » |
|
|
|
|
Logged
|
|
|
|
|
|
|
 |
« Reply #102 on: January 08, 2011, 06:17:41 PM » |
|
damn! so with this, we'll be able to edit the colors of ext gfx? or just see what they are?
|
|
|
Logged
|
|
|
|
|
|
 |
« Reply #103 on: January 08, 2011, 06:30:10 PM » |
|
damn! so with this, we'll be able to edit the colors of ext gfx? or just see what they are?
umm... it's only a viewer right now... I'll UD to a file replacer like brbx later... gonna finish all the formats with the viewer first...
|
|
« Last Edit: January 09, 2011, 10:24:01 AM by Tcll »
|
Logged
|
|
|
|
|
|
 |
« Reply #104 on: January 08, 2011, 06:36:47 PM » |
|
thats still good....this viewer is the building block for something epic to come in the future  Wait...arent you workin on a mdl0 converter? Hows that going?
|
|
|
Logged
|
|
|
|
|
|