Here’s a tricky one

Lorand

<b>VIP Member</b>
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?
 
the canvas’ background is black instead of white. But not on every system with XP!
(Icon/Desktop)Transparency settings?

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 :)
 
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.
 

Attachments

  • sample.jpg
    sample.jpg
    4.3 KB · Views: 176
Here's the result on my computer (and it's the same in every program - Photoshop, Photopaint, QuarkXpress):
 
Any objects/controls/references you used or did you use all-internal commands/calls? :confused:
 
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
 
even the eps file created with this program is unreadable (unrecognized format).
Can you post that file? :)

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")?
 
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_BLACKISZERO;
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.
 
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? :confused:
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.
 
Try and see if you can get it to work on a W2K system.... I'd really like to know if its just the system core that it's conflicting with.,...
 
Ok, I'll try it. But it's hard to find a computer with W2k (at the office we have Win98 and all my friends have XP). It could take some time to find one. I'll be back with the results...
 
If its absolutely desparate I could reghost back to 2K but I'm too lazy for that .... also too lazy to goto campus :P If i'm on campus and remember I'll give it a whirl.
 
I tried the program on two computers with win2000 and it worked fine. But I don't know if it works on every w2k (there are XPs also on which the program runs perfectly)...
 
I noticed something really weird...
The program runs fine on XPs that have multiple users, the black background appears only on XPs that have a single default user.
Could it be a simple coincidence?
 
Does it run ok on all the logins with multiple users? My machine only has a single user and it worked ok
 
Back
Top