ComputerForum.com ComputerForum.com  
Go Back   Computer Forum > Computer Software > General Software

Reply
 
LinkBack Thread Tools Display Modes
Old 08-08-2004, 12:26 PM   #1 (permalink)
VIP Member
 
Lorand's Avatar
 
Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
Default Here’s a tricky one

Some time ago I wrote a barcode generator program in Delphi. It uses the canvas to draw and then saves that bitmap as a tiff. It works very well in Win98, but in XP acts strangely: the canvas’ background is black instead of white. But not on every system with XP! The program worked well on a computer, but recently the XP was reinstalled on it after a crash. Now even there the background turned black.
What could be the problem?
Lorand is offline   Reply With Quote


Old 08-08-2004, 12:31 PM   #2 (permalink)
Administrator
 
Praetor's Avatar
 
Join Date: Jul 2004
Location: Canada
Age: 25
Posts: 19,954
Default

Quote:
the canvas’ background is black instead of white. But not on every system with XP!
(Icon/Desktop)Transparency settings?

Quote:
The program worked well on a computer, but recently the XP was reinstalled on it after a crash. Now even there the background turned black.
If you'd like I can take a look at the source/compilation
__________________
ASUS P5K Premium WiFi-AP, Q6600@3.7 / ASUS P5ND, E6400@3.8
4GB OCz Platinum XTC 8500 / 4GB CorsairXMS2 6400
5x500GB Seagate 7200.10 / 2x500 Seagate 7200.10
OCz 8800GTX 768MB @ 630/800 / 2x Galaxy 8800GT SLI
Praetor is offline   Reply With Quote
Old 08-08-2004, 12:42 PM   #3 (permalink)
VIP Member
 
Lorand's Avatar
 
Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
Default

Quote:
(Icon/Desktop)Transparency settings?
Already tried every of those (I think), without any luck...
Here's the program: http://www.geocities.com/despartro/codbART.zip
Unfortunately I lost the source files for it (I have only a backup from very early stages), that's why I hope it's something about settings...
Lorand is offline   Reply With Quote
Old 08-08-2004, 12:46 PM   #4 (permalink)
Administrator
 
Praetor's Avatar
 
Join Date: Jul 2004
Location: Canada
Age: 25
Posts: 19,954
Default

Seems to work as expected for me... question: what viewer are u using for images? Some viewers (like irfanview) sometimes default of a specific mask/transparancy color.
Attached Images
 
__________________
ASUS P5K Premium WiFi-AP, Q6600@3.7 / ASUS P5ND, E6400@3.8
4GB OCz Platinum XTC 8500 / 4GB CorsairXMS2 6400
5x500GB Seagate 7200.10 / 2x500 Seagate 7200.10
OCz 8800GTX 768MB @ 630/800 / 2x Galaxy 8800GT SLI
Praetor is offline   Reply With Quote
Old 08-08-2004, 12:56 PM   #5 (permalink)
VIP Member
 
Lorand's Avatar
 
Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
Default

Here's the result on my computer (and it's the same in every program - Photoshop, Photopaint, QuarkXpress):
Lorand is offline   Reply With Quote


Old 08-08-2004, 01:08 PM   #6 (permalink)
Administrator
 
Praetor's Avatar
 
Join Date: Jul 2004
Location: Canada
Age: 25
Posts: 19,954
Default

Any objects/controls/references you used or did you use all-internal commands/calls?
__________________
ASUS P5K Premium WiFi-AP, Q6600@3.7 / ASUS P5ND, E6400@3.8
4GB OCz Platinum XTC 8500 / 4GB CorsairXMS2 6400
5x500GB Seagate 7200.10 / 2x500 Seagate 7200.10
OCz 8800GTX 768MB @ 630/800 / 2x Galaxy 8800GT SLI
Praetor is offline   Reply With Quote
Old 08-08-2004, 01:11 PM   #7 (permalink)
VIP Member
 
Lorand's Avatar
 
Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
Default

Oops, I forgot to mention that there’s more. On some XPs even the eps file created with this program is unreadable (unrecognized format). This is really weird, because the eps file’s preambule is ready made (the program just adds the character string that compose the barcode), only the preview bitmap is attached to it. And even if the preview’s background is black, the bitmap size is the same...
By now I saw 3 different ways the program function in XP:
1. TIF and EPS ok
2. TIF bad, EPS ok
3. TIF and EPS bad
Lorand is offline   Reply With Quote
Old 08-08-2004, 01:14 PM   #8 (permalink)
Administrator
 
Praetor's Avatar
 
Join Date: Jul 2004
Location: Canada
Age: 25
Posts: 19,954
Default

Quote:
even the eps file created with this program is unreadable (unrecognized format).
Can you post that file?

Quote:
By now I saw 3 different ways the program function in XP:
1. Same problem with W2K?
2. Which is the "problemsome" one? I'm guessing #3

(BTW could it be "Demo" vs "Full")?
__________________
ASUS P5K Premium WiFi-AP, Q6600@3.7 / ASUS P5ND, E6400@3.8
4GB OCz Platinum XTC 8500 / 4GB CorsairXMS2 6400
5x500GB Seagate 7200.10 / 2x500 Seagate 7200.10
OCz 8800GTX 768MB @ 630/800 / 2x Galaxy 8800GT SLI
Praetor is offline   Reply With Quote
Old 08-08-2004, 01:28 PM   #9 (permalink)
VIP Member
 
Lorand's Avatar
 
Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
Default

Here's what I could find in the old source files:

Bitmap:=tbitmap.Create;
bitmap.height:=1432;
bitmap.width:=2832;
bitmap.Monochrome:=true;
Tiffsave.AttachedBitmap:= bitmap;
bitmap.canvas.font.name:='Barcodefont';
bitmap.canvas.Font.size:=180;
bitmap.canvas.textout(125,26,'qrst '+code);
bitmap.canvas.Font.size:=550;
bitmap.canvas.textout(167,400,'<');
bitmap.canvas.textout(393,400,chr(97+ean[2]));
bitmap.canvas.textout(558,400,chr(65+ean[3]));
.....
bitmap.canvas.textout(2440,400,'>');
Tiffsave.Params.dpix:=2400;
Tiffsave.Params.dpiy:=2400;
Tiffsave.Params.Width:=2832;
Tiffsave.Params.Height:=1432;
Tiffsave.Params.SamplesPerPixel:=1;
Tiffsave.Params.BitsPerSample:=1;
Tiffsave.Params.TIFF_PhotometInterpret:=ioTIFF_BLA CKISZERO;
Tiffsave.Params.TIFF_Compression:=ioTIFF_LZW;
Tiffsave.SaveToFile(fn);
Tiffsave.Bitmap.Free;

Never tried on a win2000. The demo and full version works exactly the same way...
Unfortunately I can't post a messed-up eps, the XP was reinstalled on that computer too, and now only the tiff is bad when running this program on it.
Lorand is offline   Reply With Quote
Old 08-08-2004, 08:11 PM   #10 (permalink)
VIP Member
 
Lorand's Avatar
 
Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
Default

Meantime I discovered the 4th kind of bad output of the program: an eps file that could be imported, printed, but has a corrupted preview (attached).
This program runs perfectly on more than a dozen of computers with Win98 and never had such problems... It could be something about a different internal function of XP. But how come that on some XP-systems it works?
As you can see, in the messed-up bitmap the characters' bounding boxes have white background, so I think the problem arises from the bitmap creation.
Lorand is offline   Reply With Quote
Reply

Bookmarks

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

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

All times are GMT +1. The time now is 01:27 AM.


Powered by: vBulletin Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright © 2002-2008 Computer Forum and Web Design Forum