|
Post by crazynate on Nov 25, 2009 1:54:23 GMT -5
Currently I'm looking into how a .png file is made so I can get my paint program to edit them. Unfortunately .png are really complex so I have only figured out what a few bytes are, and in the process i got a major headache. I feel like head is going to explode, PLEASE HELP!!!
|
|
|
Post by Darkjester on Nov 25, 2009 12:11:09 GMT -5
Even i cant find information on the png headers
|
|
|
Post by crazynate on Nov 25, 2009 13:35:15 GMT -5
Ok, based on what I've recently read, there are three image classes: raster, vector, and metafile. And judging from my research .bmp's are considered a raster image. My geuss is that a .png is a vector or a metafile image. But since I'm basing this assumption off a manual for a graphics converter for windows 3, the information might no longer be valid since formats have probably changed. Is there any other file formats that i should add to my paint program? Right now it can load and edit .bmp's and .spr's(a file type that I made)
|
|
|
Post by DJLinux on Nov 26, 2009 6:08:26 GMT -5
you must use a png library the png format is to complex.
Joshy
|
|
|
Post by Darkjester on Nov 26, 2009 12:32:03 GMT -5
I second Djlinux's advice. Id kinda like to see your paint program when its finished are you going to release an include for reading .sprs? and are you going to release teh source? -darkjester
|
|
|
Post by crazynate on Nov 26, 2009 12:54:13 GMT -5
I'll probably upload it when I get a chance, I currently have relatives visiting for Thanksgiving and I still want to make a help menu. Since I posted the code for the previous version of the paint program, i have added a toolbar, advanced color options,alpha, and I've started on making a help menu. As for displaying .spr's I think it would be best to load them as a small tilemap. But since I'm making it open source, someone should be able to make a plugin to load them easier. And do you think I could use the Corona library from the basic4gl source to figure out how to load .png's?
Happy Holidays, CrazyNate
|
|
|
Post by Darkjester on Nov 26, 2009 13:40:54 GMT -5
Im honestly not sure i have never read the corona source, i would recomend some other format though, maybe a .raw, and maybe 32 bit .tga -darkjester
|
|
|
Post by DJLinux on Nov 26, 2009 17:56:37 GMT -5
You can load png's with Basic4GL and saving with ToolBox Plugin.
|
|
|
Post by crazynate on Nov 27, 2009 11:52:42 GMT -5
It can now save 32 bit .tga's. Apparently .spr 's are very similar to tga's, spr's are only a little more simple. But I do plan on changing the layout of .spr's and adding some more variables further into development.
|
|
|
Post by Darkjester on Nov 29, 2009 23:53:52 GMT -5
It can now save 32 bit .tga's. Apparently .spr 's are very similar to tga's, spr's are only a little more simple. But I do plan on changing the layout of .spr's and adding some more variables further into development. I really am liking where this is going, how did you do your tga header?
|
|
|
Post by DJLinux on Nov 30, 2009 3:24:22 GMT -5
function SaveTGA(FileName$) dim hFile,c,p1,p hFile=OpenFileWrite(FileName$) if hFile=0 then return False:end if ' write tga header type 2 (8 bytes) WriteByte(hFile,0) ' 1 no extra bytes WriteByte(hFile,0) ' 2 no color map type WriteByte(hFile,2) ' 3 type 2 WriteWord(hFile,0) ' 5 no color mqp origin WriteWord(hFile,0) ' 7 no color map entries WriteByte(hFile,0) ' 8 no color map bits ' write image descriptor WriteWord(hFile,0) ' 10 no x origin WriteWord(hFile,0) ' 12 no y origin WriteWord(hFile,w) ' 14 width WriteWord(hFile,h) ' 16 height WriteByte(hFile,32) ' 17 bits per pixel WriteByte(hFile, 8) ' 18 flag bit 3 allways 1 ' write bitmap p1=(w*h) / 20 for c=0 to w*h-1 if (c % p1)=0 then WindowTitle(p + "% done") p=p+5 end if WriteInt(hFile,Pixels(c)) next CloseFile(hFile) WindowTitle("100% done") return True end function
|
|
|
Post by crazynate on Dec 1, 2009 21:00:10 GMT -5
|
|