Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


8-bit graphic formats


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-01-2008, 01:54 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 74
Default 8-bit graphic formats

Hi,
when I try to load an 8-bit graphic format (gif or bmp), I get the attached error message (PC). This happens only, when I want to draw with drawer.New2 (ImageList1.Item (0), B4PObject (5)) on this image. No problems with 24-bit formats.
Attached Images
File Type: jpg error 8-bit.JPG (14.7 KB, 10 views)
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, XP SP3
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: Clip-on Bluetooth, Navman 3000
Reply With Quote
  #2 (permalink)  
Old 02-01-2008, 03:12 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,334
Default

Can you upload this bitmap file?
Reply With Quote
  #3 (permalink)  
Old 02-01-2008, 03:47 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 74
Default

Hi Erel,
here it is. It's 8-bit bmp with 256 colors.
Attached Files
File Type: zip stein_top25_256_bitmap.zip (420.7 KB, 6 views)
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, XP SP3
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: Clip-on Bluetooth, Navman 3000
Reply With Quote
  #4 (permalink)  
Old 02-01-2008, 04:04 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,896
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

It seems there is a GDI+ Graphics limitation - From MSDN

"Note You can only create Graphics objects from non-indexed .bmp files, such as 16-bit, 24-bit, and 32-bit .bmp files. Each pixel of non-indexed .bmp files holds a color, in contrast to pixels of indexed .bmp files, which hold an index to a color table."
Reply With Quote
  #5 (permalink)  
Old 02-01-2008, 04:11 PM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 74
Default

That's exactly what the error message says. And it's the same with a gif file.
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, XP SP3
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: Clip-on Bluetooth, Navman 3000
Reply With Quote
  #6 (permalink)  
Old 02-02-2008, 12:54 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 812
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Hi wolfgang
How do you load your image ?
In my program to display maps I load the image files in an ImageList object, and I had no problem loading your image.
You can look at it in:
Display maps

Best regards
Klaus
Switzerland
Reply With Quote
  #7 (permalink)  
Old 02-02-2008, 01:02 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,334
Default

A fix for this limitation is to create a copy of the image:
Code:
    image1.Visible = false
    image1.Image = "b.bmp"
    image1.Image = image1.Image 'creates a nonindexed copy of the image.
    drawer.New2(image1.Image,B4PObject(5))
Reply With Quote
  #8 (permalink)  
Old 02-03-2008, 09:36 AM
Knows the basics
 
Join Date: Apr 2007
Location: Steinheim, Germany
Posts: 74
Default

Hi,
thank you all. The good news: This happens only on desktop. On PPC is no error.

The problem is not, that I can’t do this.The problem was that I want to save memory on PPC. But I found, that it doesn’t matter if you load the same file as a bmp (24-bit), jpg or a gif. In comparison to the desktop where the gif files are much smaller in RAM. On my device (ASUS 632N WM5) a 6 MB bmp or the same file as an 800 KB gif takes about 4 MB of memory(?!). But there is still a difference: bmp files can be loaded up to a size of ~ 1700 x 1700 pixels and gif files much bigger e.g. 2400 x 1800 pixels. I didn’t test the maximum.

@Klaus
wonderful software. But you don’t draw on your maps. Add an object named draw and this line of code:
Code:
.
.
.
draw.New2 (ImageList1.Item (Map_I), B4PObject (5))
and you will get the same error message. I tested it. Again: wonderfull software.
__________________
Thanks for all
wolfgang
___________________
Desktop: Dual Core 3.0 GHz, XP SP3
Device: IPAQ 3970 WM 2003, Asus 632N WM5, HTC 3650 Cruise
GPS: Clip-on Bluetooth, Navman 3000
Reply With Quote
  #9 (permalink)  
Old 02-03-2008, 02:54 PM
klaus's Avatar
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 812
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Hi wolfgang,
You are right, if I add a drawer connected to the 8bit image I get the same error message.

Klaus
Switzerland
Reply With Quote
  #10 (permalink)  
Old 02-03-2008, 05:13 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,896
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by wolfgang View Post
The problem was that I want to save memory on PPC. But I found, that it doesn’t matter if you load the same file as a bmp (24-bit), jpg or a gif.
I'm afraid you can't save memory just by loading a different format. Jpg and gif are compressed formats for storing pictures in files. However pictures are always expanded to full bitmaps when loaded into memory no matter what the format of the source file.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphic in SQLite Database Picard Questions & Help Needed 1 08-23-2008 12:03 PM
graphic print on desktop ? SpaceCruiser Questions & Help Needed 4 07-06-2008 05:35 PM


All times are GMT. The time now is 01:34 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0