GLCD BMP converter invert

Post your requests and ideas on the future development of mikroPascal.
Author
Message
LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

GLCD BMP converter invert

#1 Post by LGR » 03 Apr 2005 03:32

I noticed something peculiar using the BMP converter tool - the images are inverted when converted. It would be good if it simply didn't do this (is there a reason why it does this?), but it would be better if there was a button to invert whatever is on the display in the converter tool.

My daughter works with graphics, and is able to easily convert photographs and other clip art into 1-bit monochrome BMP files using Corel. Some of the results were surprisingly good, except they had to be inverted so that the result would come out right. :?

One other thing that would be nice is to be able to adjust the aspect ratio of the preview pane (the faux LCD panel) to match the aspect ratio of the target GLCD. They can vary significantly. :x In Corel (and I assume other graphics programs), the aspect ratio can be adjusted, if need be.
If you know what you're doing, you're not learning anything.

MattH
Posts: 173
Joined: 09 Jan 2005 03:55
Location: Allentown,PA

#2 Post by MattH » 03 Apr 2005 13:49

but it would be better if there was a button to invert whatever is on the display in the converter tool.
There is a invert button right under 'done'... :o
Don't code after midnight...

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#3 Post by anton » 03 Apr 2005 14:03

Here is a small screen-shot

Image


Anton :)

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#4 Post by LGR » 03 Apr 2005 15:40

Doh! :oops:

Now that I have a bigger monitor, maybe I need new glasses. :x
If you know what you're doing, you're not learning anything.

MattH
Posts: 173
Joined: 09 Jan 2005 03:55
Location: Allentown,PA

#5 Post by MattH » 03 Apr 2005 16:34

Tell me about it.... :lol:
Don't code after midnight...

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#6 Post by LGR » 03 Apr 2005 19:01

BTW - this is an example of what a graphic artist can do in about 5 minutes with with a real photograph and Corel photopaint:

Code: Select all

// ------------------------------------------------------
// GLCD Picture name: foo.bmp
// ------------------------------------------------------

const foo_bmp : array[1024] of byte = (
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 240,240,248,252,252,254,254,254,254,255,255,255,255,255,255,255,
 254,254,254,254,252,252,248,224,192,128,128,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,248,248,248,
   0,  0,  0,  0,  0,224,224,224, 64,224,224,192,  0,  0,216,216,
 216,  0,192,240,240,240,192,  0,224,224,224,  0,  0,224,224, 96,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 64,124,127,
 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,127,
 127,127,127,255,255,255,255,255,255,255,255,255,254,252,248,240,
 224,128,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,255,255,255,
   0,  0,  0,  0,  0,255,255,255,128,255,255,255,  0,  0,255,255,
 255,  0,  0,255,255,255,128,  0,  0, 31,255,254,192,255,255,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,192,192,128,  0,  0,  0,  0,  0,  0,
   0,129,247,195,  3,  1,  1,  1,  1,  1,  1,  0,128,  0,  0,  0,
   0,  0,  0,  0, 17, 29,255,255,255,255,255,255,255,255,255,255,
 255,255,254,252,252,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,
   0,  0,  0,  0,  0,  7,  7,  7,  0,  1,  1,  0,  0,  0,  1,  1,
   1,  0,  0,  0,  1,  1,  1,  0,  0,  6,  7,  7,  7,  3,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  1, 15,255,255,  0,  0,128,192,248,252,
 255,125,253,253,124, 56,248,248,240,224,192,  1,  0,  0,  0, 44,
  28,156, 60, 30, 31, 62, 39, 55, 31,127, 63, 63, 63,159,255,255,
 255,255,255,255, 63,126,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0, 48,252,252,252, 48,  0,254,254,254, 16,
 248,248,240,  0,  0,224,248,248,152,248,240,224,  0,  0,  0,  0,
   0,  0,248,248,248, 16,248,248,240,  0,  0,224,248,248, 24,248,
 240,224,  0, 14, 30, 14,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  7,255,248,  0,  0,  0,  0,  0,
   1,  1,  0,  0,  0,192,135,135,195,129,  1,  0,  0,  8, 24,216,
  80, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,192,224,251,255,255,
 255,255,255,255, 62, 30,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0, 63,127,127, 96,  0,127,127,127,  0,
 127,127,127,  0,  0, 31, 63,127, 97,125,125, 29,  0,  0,  0,  0,
   0,  0,255,255,255, 32,127,127, 63,  0,  0, 63,127,127, 96,127,
  63, 31,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,192,120, 95, 95,255,254,252,254,255,
 254,254,252,248,252,255,255,255,255,223,223,205, 79, 15, 14, 15,
  30, 30,126,124,252,252,252,248,248,248,252,255,255,255,255,255,
 255,255,255,127,  6,  6,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 128,128,128,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  1,  1,  1,  0,128,128,128,  0,128,128,128,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  3,  3,  0,128,192,  0, 24,127,255, 63,255,
 255,255,255,255,255,255,255,255,255,252,252,248,248,248,248,248,
 216,220,252,254,255,255,255,255,255,255,255,255,255,255,255,255,
 255,127,127, 35,  0,  0,252, 64,120, 64,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 12,255,
 255,253, 13,  0,248,254,254,  6,254,252,248,  0,  0,  0,248,254,
 254,  6,254,252,248,  0,  3,  7,  3,  0,255,255,255,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,240,112,  0, 31,101,  0, 28,240,223,156,127,
 115,195, 63,127,159,159, 63,127,127,255,255,255,255,255,255,255,
 255,255,255,255,255,255,127,127,255,255, 63, 63, 31, 15,  3,  3,
   0,  0,  0,  0,  0,  2,  1,  0,129, 24,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 31,
  31, 31,  0,  0, 15, 31, 31, 24, 31, 15,  7,  0,  0,  0, 15, 31,
  31, 24, 31, 15,  7,  0,  0,  0,  0,  0, 29, 29, 29,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0
);
This is in Pascal format, but can easily be converted to Basic or C.
If you know what you're doing, you're not learning anything.

MattH
Posts: 173
Joined: 09 Jan 2005 03:55
Location: Allentown,PA

#7 Post by MattH » 03 Apr 2005 19:09

Is that a picture of you? :o
Don't code after midnight...

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#8 Post by LGR » 03 Apr 2005 19:54

You obviously don't remember the '80s. "Real photograph" as in downloaded from the internet (I didn't think you would recognize my cat).
If you know what you're doing, you're not learning anything.

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#9 Post by anton » 03 Apr 2005 20:15

Well... :D

Here's the code to see LGR's code on a Nokia 3310 LCD.

I only have a Nokia LCD so i had to modify the code

Image

Code: Select all

const foo_bmp : array[504] of byte = (
    0,  0,  0,  0,  0,  0,  0,192,192,128,  0,  0,  0,  0,  0,  0,
   0,129,247,195,  3,  1,  1,  1,  1,  1,  1,  0,128,  0,  0,  0,
   0,  0,  0,  0, 17, 29,255,255,255,255,255,255,255,255,255,255,
 255,255,254,252,252,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,
   0,  0,  0,  0, { 0,  7,  7,  7,  0,  1,  1,  0,  0,  0,  1,  1,
   1,  0,  0,  0,  1,  1,  1,  0,  0,  6,  7,  7,  7,  3,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, }
  0,  0,  0,  0,  0,  0,  1, 15,255,255,  0,  0,128,192,248,252,
 255,125,253,253,124, 56,248,248,240,224,192,  1,  0,  0,  0, 44,
  28,156, 60, 30, 31, 62, 39, 55, 31,127, 63, 63, 63,159,255,255,
 255,255,255,255, 63,126,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0, 48,252,252,252, 48,  0,254,254,254, 16,
 248,248,240,  0, { 0,224,248,248,152,248,240,224,  0,  0,  0,  0,
   0,  0,248,248,248, 16,248,248,240,  0,  0,224,248,248, 24,248,
 240,224,  0, 14, 30, 14,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, }
   0,  0,  0,  0,  0,  0,  0,  0,  7,255,248,  0,  0,  0,  0,  0,
   1,  1,  0,  0,  0,192,135,135,195,129,  1,  0,  0,  8, 24,216,
  80, 16,  0,  0,  0,  0,  0,  0,  0,  0,  0,192,224,251,255,255,
 255,255,255,255, 62, 30,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0, 63,127,127, 96,  0,127,127,127,  0,
 127,127,127,  0,{  0, 31, 63,127, 97,125,125, 29,  0,  0,  0,  0,
   0,  0,255,255,255, 32,127,127, 63,  0,  0, 63,127,127, 96,127,
  63, 31,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, }
   0,  0,  0,  0,  0,  0,  0,192,120, 95, 95,255,254,252,254,255,
 254,254,252,248,252,255,255,255,255,223,223,205, 79, 15, 14, 15,
  30, 30,126,124,252,252,252,248,248,248,252,255, 255,255,255,255,
 255,255,255,127,  6,  6,  2,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
 128,128,128,  0,  {0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
   0,  0,  1,  1,  1,  0,128,128,128,  0,128,128,128,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, }
  0,  0,  0,  0,  0,  3,  3,  0,128,192,  0, 24,127,255, 63,255,
 255,255,255,255,255,255,255,255,255,252,252,248,248,248,248,248,
 216,220,252,254,255,255,255,255,255,255,255,255, 255,255,255,255,
 255,127,127, 35,  0,  0,252, 64,120, 64,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 12,255,
 255,253, 13,  0,{248,254,254,  6,254,252,248,  0,  0,  0,248,254,
 254,  6,254,252,248,  0,  3,  7,  3,  0,255,255,255,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  }
   0,  0,  0,  0,  0,240,112,  0, 31,101,  0, 28,240,223,156,127,
 115,195, 63,127,159,159, 63,127,127,255,255,255,255,255,255,255,
 255,255,255,255,255,255,127,127,255,255, 63, 63, 31, 15,  3,  3,
   0,  0,  0,  0,  0,  2,  1,  0,129, 24,  0,  0,  0,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 31,
  31, 31,  0,  0{, 15, 31, 31, 24, 31, 15,  7,  0,  0,  0, 15, 31,
  31, 24, 31, 15,  7,  0,  0,  0,  0,  0, 29, 29, 29,  0,  0,  0,
   0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0  }
Last edited by anton on 03 Apr 2005 20:22, edited 1 time in total.
Another proud user of LV 24-33A Development System and mikroPascal PRO for dsPIC :)
PortA not working? Add CMCON := 7; PortD not working? Add ADCON1 := 6;
To paste code on the forum, please use the [b] Code [/b] button !! ;)

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#10 Post by LGR » 03 Apr 2005 20:20

--- Nevermind. ---
Last edited by LGR on 03 Apr 2005 20:27, edited 1 time in total.
If you know what you're doing, you're not learning anything.

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#11 Post by anton » 03 Apr 2005 20:35

Hi LGR
That's not me! Think '80s, Hannibal, Murdock, Face, and ______.
B.A ?

Anton :)

MattH
Posts: 173
Joined: 09 Jan 2005 03:55
Location: Allentown,PA

#12 Post by MattH » 03 Apr 2005 20:54

Of course.. Anton got it..
B.A. and "The A-Team"... :oops:
Don't code after midnight...

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#13 Post by LGR » 04 Apr 2005 01:56

Back on the subject of mikroPascal Wish List, my daughter and I fiddled a little more, and concluded that you can do the same thing with the GIMP. The significance of this is that GIMP is GNU (free) and can run scripts. This would make it relatively easy to link the GLCD image editor to GIMP, and have scripts to do image convertions, large fonts, etc. And, yes, GIMP is available for windows (as well as unix and mac). :idea:

With this, you can do anything that is physically possible. :D
If you know what you're doing, you're not learning anything.

anton
Posts: 807
Joined: 23 Sep 2004 09:16
Location: South-Africa
Contact:

#14 Post by anton » 04 Apr 2005 11:48

A simple program like windows Paint also works

:) :)

Anton :!:

LGR
Posts: 3204
Joined: 23 Sep 2004 20:07

#15 Post by LGR » 04 Apr 2005 15:43

anton wrote:A simple program like windows Paint also works
1. The capabilities needed to do what I was talking about include:
a. importing images, such as jpg
b. changing the aspect ratio to match the GLCD
c. scaling to a specified number of pixels
d. converting the color or greyscale image to 1-bit
e adding to the canvass so that the result ends up being 128x64, or whatever you're working with
f. adding fonts in any size and format that you wish.

I'm sure paint can't do all of that.

2. With the ability to write scripts, you can integrate and automate.
If you know what you're doing, you're not learning anything.

Post Reply

Return to “mikroPascal Wish List”