|
|
#1 (permalink) |
|
VIP Member
![]() Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
|
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? |
|
|
|
|
|
#2 (permalink) | ||
|
Administrator
![]() Join Date: Jul 2004
Location: Canada
Age: 25
Posts: 19,954
|
Quote:
Quote:
__________________
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 |
||
|
|
|
|
|
#3 (permalink) | |
|
VIP Member
![]() Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
|
Quote:
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...
|
|
|
|
|
|
|
#4 (permalink) |
|
Administrator
![]() Join Date: Jul 2004
Location: Canada
Age: 25
Posts: 19,954
|
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.
__________________
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 |
|
|
|
|
|
#6 (permalink) |
|
Administrator
![]() Join Date: Jul 2004
Location: Canada
Age: 25
Posts: 19,954
|
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 |
|
|
|
|
|
#7 (permalink) |
|
VIP Member
![]() Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
|
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 |
|
|
|
|
|
#8 (permalink) | ||
|
Administrator
![]() Join Date: Jul 2004
Location: Canada
Age: 25
Posts: 19,954
|
Quote:
![]() Quote:
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 |
||
|
|
|
|
|
#9 (permalink) |
|
VIP Member
![]() Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
|
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. |
|
|
|
|
|
#10 (permalink) |
|
VIP Member
![]() Join Date: Dec 2003
Location: Bucharest
Age: 42
Posts: 3,042
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|