VGAScreen Image Drawing Solved!

Jul 21, 2011 at 8:00 AM
Edited Jul 22, 2011 at 11:51 AM

Hi i've found a way to convert a .bmp file to code needed to draw using Cosmos.Hardware (tested on MS4) http://yapps.tk/COSMOS/BMP_Code.rar (this is my site) it's a console app made in microsoft visual c# 2010 express edition. hope it's understandable for you guys! (it takes about 5 minuates at maxumin) it convert at maxamin) it converts to 320x200x8 resulotion only! (warning a 320x200 sixed image is 7mb in a txt file so be warned! it also take a while to compile)

transparent comes out as white!

Jul 21, 2011 at 3:05 PM
quick note, the real link ends in .rar (web browsers dont know what to do with .exe i guess) so change the .exe to .rar and your good. im testing this now.

On Thu, Jul 21, 2011 at 4:00 AM, gamesman123 <notifications@codeplex.com> wrote:

From: gamesman123

Hi i've found a way to convert a .bmp file to code needed to draw in Cosmos.Hardware (tested on MS4) http://yapps.tk/COSMOS/BMP_Code.exe (this is my site :) ) it's a console app made in microsoft visual c# 2011 express edition. hope its understandable for you guys! (it takes about 5 minutes to convert at maxumin) it converts to 320x200x8 resulotion only! (warning a 320x200 sixed image is 7mbs in a txt file SO THATS ALOT OF CODE!)

it works by seting a VGAScreen.SetPaletteEntry(99999, <its rgb of the curent pixel>); and then seting the pixel to "999999" colour

transperent comes out as white!

Thx Hope it help HAPY CODING!

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Jul 21, 2011 at 3:10 PM
Most of the time it's the webserver software that's blocking it (or trying to execute it, when wrongly configured)..

On Thu, Jul 21, 2011 at 5:06 PM, iProcessor <notifications@codeplex.com> wrote:

From: iProcessor

quick note, the real link ends in .rar (web browsers dont know what to do with .exe i guess) so change the .exe to .rar and your good. im testing this now.


On Thu, Jul 21, 2011 at 4:00 AM, gamesman123 <notifications@codeplex.com> wrote:

From: gamesman123

Hi i've found a way to convert a .bmp file to code needed to draw in Cosmos.Hardware (tested on MS4) http://yapps.tk/COSMOS/BMP_Code.exe (this is my site :) ) it's a console app made in microsoft visual c# 2011 express edition. hope its understandable for you guys! (it takes about 5 minutes to convert at maxumin) it converts to 320x200x8 resulotion only! (warning a 320x200 sixed image is 7mbs in a txt file SO THATS ALOT OF CODE!)

it works by seting a VGAScreen.SetPaletteEntry(99999, <its rgb of the curent pixel>); and then seting the pixel to "999999" colour

transperent comes out as white!

Thx Hope it help HAPY CODING!

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jul 21, 2011 at 3:14 PM
probably is. I just tested this. it works well. It could be a bit more user friendly. and forcing the C:/ drive is not good. suppose a user has an F:/ drive? anyway this did work. maybe you could give the source? considering you gave the exe which is allowing everyone to use this anyway.

On Thu, Jul 21, 2011 at 11:10 AM, mterwoord <notifications@codeplex.com> wrote:

From: mterwoord

Most of the time it's the webserver software that's blocking it (or trying to execute it, when wrongly configured)..

On Thu, Jul 21, 2011 at 5:06 PM, iProcessor <notifications@codeplex.com> wrote:

From: iProcessor

quick note, the real link ends in .rar (web browsers dont know what to do with .exe i guess) so change the .exe to .rar and your good. im testing this now.


On Thu, Jul 21, 2011 at 4:00 AM, gamesman123 <notifications@codeplex.com> wrote:

From: gamesman123

Hi i've found a way to convert a .bmp file to code needed to draw in Cosmos.Hardware (tested on MS4) http://yapps.tk/COSMOS/BMP_Code.exe (this is my site :) ) it's a console app made in microsoft visual c# 2011 express edition. hope its understandable for you guys! (it takes about 5 minutes to convert at maxumin) it converts to 320x200x8 resulotion only! (warning a 320x200 sixed image is 7mbs in a txt file SO THATS ALOT OF CODE!)

it works by seting a VGAScreen.SetPaletteEntry(99999, <its rgb of the curent pixel>); and then seting the pixel to "999999" colour

transperent comes out as white!

Thx Hope it help HAPY CODING!

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Jul 21, 2011 at 7:25 PM

it looks like the above post by gamesman123 its partially copied from another website. this might not be his project so be careful advertising it.


Jul 22, 2011 at 11:41 AM
iprocessor wrote:

it looks like the above post by gamesman123 its partially copied from another website. this might not be his project so be careful advertising it.



This is 100% my project! the link is updated here it is again http://yapps.tk/COSMOS/BMP_Code.rar

Jul 22, 2011 at 1:53 PM
Could you release the source?

Sent from my iPod

On Jul 22, 2011, at 7:41 AM, "gamesman123" <notifications@codeplex.com> wrote:

From: gamesman123

iprocessor wrote:

it looks like the above post by gamesman123 its partially copied from another website. this might not be his project so be careful advertising it.



This is 100% my project! the link is updated here it is again http://yapps.tk/COSMOS/BMP_Code.rar

Jul 23, 2011 at 3:14 AM

You really need to fix your program , it is good but instead of outputing a whole bunch of setpixel calls you should make a byte array of all the pixels and colors then use a for loop to set them all

Jul 23, 2011 at 7:14 AM
Grunt wrote:

You really need to fix your program , it is good but instead of outputing a whole bunch of setpixel calls you should make a byte array of all the pixels and colors then use a for loop to set them all


Ok i am working on this still i will properly do that.

I have also made a codeplex project on this http://cosmosconverter.codeplex.com/ but there is not further update yet

Developer
Jul 23, 2011 at 9:08 PM

As a note, you'd probably be better off setting it up in a way that you can load directly from a byte[] rather than pre-processing it, if you did set it up to do this, then I'd gladly make it the first image format that Orvid.Graphics fully supports, I wouldn't think it would be to hard (been meaning to implement an image driver anyways :P, also been meaning to add animation support, but that will have to wait until I get back to where I normally am, and have my usual dev-machine, because I forgot to commit some of my code, which is the basis for the shape-based drawing mechanism. (Also allows for heavy caching :P)

Also, as a note for speed in your current mechanism, you call bmp.GetPixel(x,y) 3 times per pixel, I'd suggest creating a color variable outside of both loops, and assigning to it once per pixel, then pulling the RGB values from there. The reason the variable is created outside of the loops is to avoid GC thrashing, because if it was in the x loc loop (which is already in the y loc loop), it would have to alloc, and dispose of the variable 64k times per image.  The reason I mention bmp.GetPixel, is because it uses native interop to achieve it's function, and that can be slow (It's the major cause of the slowness in my TTF to OPFF converter).

I would also suggest writing to disk as you convert it, rather than keeping it in memory, as you then have to iterate through the array you keep it in in your 2nd conversion method (your string appending from your first try was only slightly worse :P).

Jul 24, 2011 at 5:42 AM

I have tempory removed the source code but ill put it back up soon. i am playing around with arrays and other ideas. when i put the source code up maybe some of you guys can give me some code samples to try but im very hapy with my Release 2 so far. pls add a discusion on my project to continue this converstation.