![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on Converting and using graphics to .c within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I've heard this is possible. I've converted a .bmp to a .c file, but I didn't know how to use ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() |
I've heard this is possible. I've converted a .bmp to a .c file, but I didn't know how to use it. What tool can convert a .png to a .c file. Then how can I use it in my program?
|
|
|
|
|
|
#2 |
|
Guest
Posts: n/a
|
Erm.
.c isn't an image format |
|
|
|
#4 | |
|
Guest
Posts: n/a
|
Quote:
Sorry, I can't help you with that. |
|
|
|
|
#5 |
![]() ![]() PSP Developer
Join Date: Oct 2005
Real First Name: Alex
Location: ~* Confidential *~
Just Played: N/A
Posts: 839
Trader Feedback: 0
|
.c isn't an image format, it is a source code. Try doing a put pixel in a loop to the screen using the picture source array.
__________________
![]() "Every team needs an idealistic person (whether they are a noob or a pro), my team doesn't have one cus im the idealistic founder."-me Anime/Manga and Fanfiction is my inspiration! Creator of: - PSPSDK makefile creator - Lua Prompt - Animated Sprite Class\Library for Lua - Gmax2PSP - |
|
|
|
|
|
#6 |
![]() |
There's a tool that comes with the toolchain, bin2o I think it is. Try it out. Shine also had a Java program that did it. I included it with my Snakman releases (check out version .3, it has it integrated into the Makefile)
__________________
[url=http://www.barbdwyer.com/footer.php][img]http://www.barbdwyer.com/8Ball.jpg[/img][/url] [FONT=Verdana][SIZE=1] [b]PSP Developer Resource Site:[/b] [url=http://www.psp-programming.com]PSP-Programming.com[/url] [b]Other:[/b] [url=http://wake-boarding.org]Wakeboarding[/url], [url=http://water-skiing.org]Waterskiing[/url], [url=http://wake-surfing.org]Wake Surfing[/url], [url=http://www.guitarhero-4.com]Guitar Hero IV[/url][/SIZE][/FONT] |
|
|
|
|
|
#7 |
![]() ![]() total-Z
|
http://ps2dev.org/psp/Tools/Mach-one_PSP_Converter
That will convert BMP to raw C code. When I did that, I used pg to display the images.
__________________
牧来栠摩琠敨映汩獥PSN: youresam From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth |
|
|
|
|
|
#8 |
![]() ![]() Developer
|
As Yeldarb mentioned, bin2o is the tool you want, it comes with the PSPSDK.
It converts your RAW file to an .o file, which you can add to your makefile which will then be added to your eboot. Check out this link. http://forums.ps2dev.org/viewtopic.p...ighlight=bin2o |
|
|
|
|
|
#9 |
![]() ![]() |
the snakmanv_3 doesn't wanna load for me. But that's pretty much what I need for now.
Edit: got it now. it's very nice, I think I'm gonna figure it out and start using it. Yes, i do know this uses more memory, but it's to protect files an such. Last edited by Zettablade; 05-24-2006 at 08:46 PM.. |
|
|
|
|
|
#11 |
![]() ![]() ...in a dream...
|
Yes, its quite easy to convert .C back to its image... But you have to hex edit the eboot and basically rip the 'image' out of it...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#12 |
![]() |
this was very common for early PSP work (my first RPG engine used this technique). but now I really recommend just using libpng or SDL or something to load your images in.. it's way cleaner (in my opinion at least...)
__________________
[URL=http://www.framerate.info/psp][IMG]http://www.framerate.info/_hosted/imageupload/signature.gif[/IMG][/URL] |
|
|
|
|
|
#14 |
![]() |
You can't keep an alpha channel I don't think, but you can designate a color as transparent. (If you're writing your own blitting funtion that is; I'm not sure about how the different libraries handle transparency)
__________________
[url=http://www.barbdwyer.com/footer.php][img]http://www.barbdwyer.com/8Ball.jpg[/img][/url] [FONT=Verdana][SIZE=1] [b]PSP Developer Resource Site:[/b] [url=http://www.psp-programming.com]PSP-Programming.com[/url] [b]Other:[/b] [url=http://wake-boarding.org]Wakeboarding[/url], [url=http://water-skiing.org]Waterskiing[/url], [url=http://wake-surfing.org]Wake Surfing[/url], [url=http://www.guitarhero-4.com]Guitar Hero IV[/url][/SIZE][/FONT] |
|
|
|
|
|
#16 | |
![]() ![]() |
Quote:
But yeldarb, that is an awsome idea. I think I'll look into it later after i get all my animations working. Also, could you use a spritesheet after converting it to .c? |
|
|
|
|
|
|
#17 |
![]() |
I'm sure you could, you just have to write your own function to do it. Not too difficult.
__________________
[url=http://www.barbdwyer.com/footer.php][img]http://www.barbdwyer.com/8Ball.jpg[/img][/url] [FONT=Verdana][SIZE=1] [b]PSP Developer Resource Site:[/b] [url=http://www.psp-programming.com]PSP-Programming.com[/url] [b]Other:[/b] [url=http://wake-boarding.org]Wakeboarding[/url], [url=http://water-skiing.org]Waterskiing[/url], [url=http://wake-surfing.org]Wake Surfing[/url], [url=http://www.guitarhero-4.com]Guitar Hero IV[/url][/SIZE][/FONT] |
|
|
|
|
|
#18 | |
![]() ![]() total-Z
|
Quote:
File -> Open -> [open bmp] File -> Save As... -> Save as type: PNG
__________________
牧来栠摩琠敨映汩獥PSN: youresam From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth |
|
|
|
|
|
|
#19 | |
![]() ![]() |
Quote:
your funny. I'd never even open paint. Photoshop is far too good. But in the end, even if it was a png, it would still be converted to a raw, and that would make the bg white. But as me an Yeldarb were just talking about, I'de have to make my own blitting function and designate a color to be transparent. very complicated stuffs. Last edited by Zettablade; 05-25-2006 at 07:47 AM.. |
|
|
|
|
|
|
#20 | |
![]() ![]() total-Z
|
Quote:
Just use PNG, it has no color loss, and is highly compressed. AND supports transparentcy and you can easily handle it with libpng. Yeldarb made a great image tutorial that uses libpng: http://www.psp-programming.com/tutorials/c/lesson04.htm
__________________
牧来栠摩琠敨映汩獥PSN: youresam From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth |
|
|
|
|
|
|
#21 |
![]() |
The whole thread is about how to convert an image to RAW and embed it into his program
__________________
[url=http://www.barbdwyer.com/footer.php][img]http://www.barbdwyer.com/8Ball.jpg[/img][/url] [FONT=Verdana][SIZE=1] [b]PSP Developer Resource Site:[/b] [url=http://www.psp-programming.com]PSP-Programming.com[/url] [b]Other:[/b] [url=http://wake-boarding.org]Wakeboarding[/url], [url=http://water-skiing.org]Waterskiing[/url], [url=http://wake-surfing.org]Wake Surfing[/url], [url=http://www.guitarhero-4.com]Guitar Hero IV[/url][/SIZE][/FONT] |
|
|
|
|
|
#22 |
![]() ![]() |
have you read this topic? It's discussing converting images into a c file so you can encrypt the images within the EBOOT. png is awsome, but for an image to be converted into a c file, it must first be converted into a raw!
Edit - Yeldarb beat me to it. Last edited by Zettablade; 05-25-2006 at 08:57 AM.. |
|
|
|
|
|
#23 |
![]() ![]() Muppet Magnet
|
Actually you could still embed PNGs in your EBOOT, there's no need to decode them to raw bitmaps first. And that way, you'd take advantage of the extra file compression too.
The only downside is you have to do a bit of messing with custom read functions in libpng, which can be confusing for a lot of people, especially with a lack of good examples on the web. But it's not all that hard.
__________________
Using firmware v2.00-v3.50? Open up a whole world of homebrew here
The PSP Homebrew Database needs YOU! Your ISP may be illegally wiretapping all your web activity. Stop Phorm Now! Visiting the Edinburgh Festivals? Get practical advice from experts. |
|
|
|
|
|
#24 | |
![]() ![]() total-Z
|
Quote:
__________________
牧来栠摩琠敨映汩獥PSN: youresam From Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth |
|
|
|
|
![]() |
| Tags |
| converting , graphics |
| Thread Tools | |
|
|