Page 1 of 2
How to display a bitmap ?

Posted:
Jul 9, 2007 @ 11:59am
by MetsDuManche
Hello,
I'm new in this forum, and new in Edge Lib development. So my question may appear a newbee's one, I'm sorry
I need this library to create a rich interface for our mobile software, that may work on the largest scope of phones. I was considering a Java ME development, but it doesn't seem to be able to let me do what I want.
I do believe Edge will be the best choice. I could install the SDK, and start trying to program, using the samples. It works with the emulator and with my phone too (HTC P3600). That's great.
But It's long to understand well how it works. Could you give me a help so that I may display a picture somewhere on the screen ? How can I display a picture 1) from a file on disk and 2) from a file in project resources ? I'm using Visual Studio 2005.
Thanks a lot for your help.

Posted:
Jul 9, 2007 @ 1:51pm
by edge

Posted:
Jul 9, 2007 @ 2:13pm
by MetsDuManche

Posted:
Jul 9, 2007 @ 2:17pm
by edge

Posted:
Jul 9, 2007 @ 2:25pm
by MetsDuManche

Posted:
Jul 9, 2007 @ 2:35pm
by edge

Posted:
Jul 9, 2007 @ 2:44pm
by MetsDuManche

Posted:
Jul 9, 2007 @ 3:13pm
by MetsDuManche

Posted:
Jul 9, 2007 @ 3:57pm
by MetsDuManche

Posted:
Jul 10, 2007 @ 9:35am
by edge
Hi,
Good to know it worked. For the emulator this may be more complicated as you need to copy the file. Perhaps you can try creating a .CAB setup file of your application including the bitmap picture. Examples and programs needed to create .CAB files are present in the EDGELIB SDK samples.
For transparency set the colorkey. When blitting specify EFX_COLORKEY as a flag. To colorize the font add EFX_COLORIZE as a flag and add an additional parameter with the color you like to use. Because EDGELIB uses rasterized fonts, it's not possible to draw it in different sizes.

Posted:
Jul 10, 2007 @ 12:49pm
by MetsDuManche
Thanks again for your answer.
Transparency works using this flag, it's perfect. I could change the color of the font too.
I had to check the PNT value received by the onStylusDown event, because it is not true if display mode is landscape (x = y, and y = ScreenHeight-x ...).
Is it possible to get a bold effect with the font (for instance by changing the border color like the font color) ?
Where can I find documentation about this ? I don't find what I need in online HTML reference, nor in tutorials or samples.
I also need to know how I can get a picture from resources instead of a file, so that my images may be included in exe file ? This is very important for my application.
Thanks for your support.

Posted:
Jul 11, 2007 @ 9:59am
by edge

Posted:
Jul 11, 2007 @ 1:46pm
by MetsDuManche
Thank you for the answer. I will try this code, and load different fonts manually to get larger ones.
The device giving wrong stylus touch position is a HTC P3600. When I am in portrait mode, and start the programme, everything is ok. When I start the programme while the device is in landscape mode, display is ok, but stylus reports wrong coordonates (x = y and y = height-x).
I hope it is the same for all devices, otherwise, let me know if you resolved this "problem".
We will soon register for the SDK, because it seems to allow us doing what we need.
Best regards

Posted:
Jul 11, 2007 @ 8:50pm
by edge
Hi,
Would you like to make a small test on this device? Call GetSystemRotation from ClassEDisplay and check the return value.
If the device is in portrait mode, it should return ROT_NONE (value 0), and when it is in landscape mode it should return ROT_90DEG (value 1). We suspect there is a problem with this function. Can you tell me which library you're using (2002, 2003 or 2005)?

Posted:
Jul 12, 2007 @ 4:57pm
by MetsDuManche
I made this test :
In portrait mode (standard), I get a rotation of 0.
In landscape mode, I get a rotation of 3.
May this help ?
I'm using Windows Mobile 2005.
Regarding hte loading of images from resources, I couldn't get it working, but I used instead your pack functions that are perfect! I got my pictures in a single resources file, and extract them while starting the application. It's exactly what I needed.