BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Printed Bitmap with Text on it. Text is very fuzzy!!!

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Shapour
Guest





PostPosted: Tue Feb 13, 2007 7:26 pm    Post subject: Printed Bitmap with Text on it. Text is very fuzzy!!! Reply with quote



Hello all,

I create one Bitmap and put one image on it.
On this Bitmap I have also some Information as text.

This Text is very Fuzzy.

Does anybody know, how can I print a bitmap with text with higher
resolution?

maybe know TeamB or Gambit a solution.

thanks

-------------------------------------------------------------------------------------------------
// Code sample
Graphics::TBitmap *bmpReport;
bmpReport = new Graphics::TBitmap;
bmpReport->Canvas->Font->Name = "Tahoma";//true type
bmpReport->Canvas->Font->Size = 8; // Size does not matter it is always
fuzzy.
....
int h = anotherBitmap->Height;
int w = anotherBitmap->Width;

BitBlt(bmpReport->Canvas->Handle,1,1,w,h+1,anotherBitmap->Canvas->Handle,0,0,SRCCOPY);

//Put Information on Bitmap

sprintf(Buffer,"Max: %s Min: %s",chMax,chMin);
bmpReport->Canvas->TextOut(X,Y,Buffer);
....

and some more information.

------------------------------------------------------------------------------------------------
If I print now my Bitmap, the written Text has very poor quality.

The resolution of text in bitmap is not satisfactorily.

The text border is very fuzzy and looks a bad copy.






Tanks in advance




I use Builder 6.0
Back to top
Hans Galema
Guest





PostPosted: Tue Feb 13, 2007 9:32 pm    Post subject: Re: Printed Bitmap with Text on it. Text is very fuzzy!!! Reply with quote



Shapour wrote:

Quote:
int h = anotherBitmap->Height;

If I print now my Bitmap,

How do you print it?

Please provide the contents for anotherBitmap in a file
and post that to borland.public.attachments.
Post also the resulting bitmap.

In this way people can experiment with/for you.

Hans.
Back to top
Michel Leunen
Guest





PostPosted: Wed Feb 14, 2007 2:19 am    Post subject: Re: Printed Bitmap with Text on it. Text is very fuzzy!!! Reply with quote



Shapour wrote:

Quote:
Does anybody know, how can I print a bitmap with text with higher
resolution?

I suggest that you do a search on Google for 'printing bitmap'. JD
provided here a really good code sample explaining how to print a bitmap.

Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, BCC5.5.1 Web site:
http://www.leunen.com/
----------------------------------------
Back to top
Shapour
Guest





PostPosted: Wed Feb 14, 2007 4:02 pm    Post subject: Re: Printed Bitmap with Text on it. Text is very fuzzy!!! Reply with quote

Michel Leunen schrieb:
Quote:
Shapour wrote:

Does anybody know, how can I print a bitmap with text with higher
resolution?

I suggest that you do a search on Google for 'printing bitmap'. JD
provided here a really good code sample explaining how to print a bitmap.

Michel
Hello Michel and Hans,


thanks for your replay.
I print the Bitmaps using Quickreport.
But if I print it also with another programm e.g. Color Draw, the result
is the same.
I think I have to search for a way to create the bitmap with a higher
resolution.

thanks in advance for youtr help
Back to top
JD
Guest





PostPosted: Thu Feb 15, 2007 5:11 am    Post subject: Re: Printed Bitmap with Text on it. Text is very fuzzy!!! Reply with quote

Shapour <user26061340 (AT) yahoo (DOT) de> wrote:
Quote:

I create one Bitmap and put one image on it.
On this Bitmap I have also some Information as text.

This Text is very Fuzzy.

Your sample doesn't show that you set it's PixelFormat.

Quote:
bmpReport->Canvas->Font->Name = "Tahoma";//true type
bmpReport->Canvas->Font->Size = 8; // Size does not matter it is always
fuzzy.

What does it look like when you display it on screen?

I've managed to print some extreemly small text ... so small
you almost need glasses to read it but it's still clear.

Quote:
If I print now my Bitmap, the written Text has very poor
quality.

The problem may be with your font selection and I'd also
expect that you're not taking into account the difference
in DPI between the screen and the printer.

I also see that you're using QR (yuck) so I have no clue if it
stretches or does a straight blt but if it's stretched, that
could also be the problem.

~ JD
Back to top
Shapour
Guest





PostPosted: Thu Feb 15, 2007 9:10 am    Post subject: Re: Printed Bitmap with Text on it. Text is very fuzzy!!! Reply with quote

JD schrieb:
Quote:
Shapour <user26061340 (AT) yahoo (DOT) de> wrote:
I create one Bitmap and put one image on it.
On this Bitmap I have also some Information as text.

This Text is very Fuzzy.

Your sample doesn't show that you set it's PixelFormat.

bmpReport->Canvas->Font->Name = "Tahoma";//true type
bmpReport->Canvas->Font->Size = 8; // Size does not matter it is always
fuzzy.

What does it look like when you display it on screen?

I've managed to print some extreemly small text ... so small
you almost need glasses to read it but it's still clear.

If I print now my Bitmap, the written Text has very poor
quality.

The problem may be with your font selection and I'd also
expect that you're not taking into account the difference
in DPI between the screen and the printer.

I also see that you're using QR (yuck) so I have no clue if it
stretches or does a straight blt but if it's stretched, that
could also be the problem.

~ JD

Hello JD,


thank you for your replay,

Sorry I forgot to post the lines according to Pixelformat.

I create the Bitmaps like following:

-----------------------------------------
bmpReport = new Graphics::TBitmap;
bmpTemp = new Graphics::TBitmap;
bmpReport->PixelFormat = pf24bit;
bmpTemp->PixelFormat = pf24bit;

bmpReport->HandleType = bmDIB;
bmpTemp->HandleType = bmDIB;
------------------------------------------

The Images on Quickreport has the same size as created Bitmap.

strech is set to false.

I test it also with another fonts. (Arial, san serif...) but the result
was always the same.

I will check the DPI on printer.

thanks

Shapour
Back to top
JD
Guest





PostPosted: Thu Feb 15, 2007 10:43 pm    Post subject: Re: Printed Bitmap with Text on it. Text is very fuzzy!!! Reply with quote

Shapour <user26061340 (AT) yahoo (DOT) de> wrote:
Quote:


Please trim your posts.

Quote:
The Images on Quickreport has the same size as created Bitmap.
strech is set to false.

That's the problem. You can't just do a pixel per pixel copy
because the printer DPI will *always* be higher than that of
the screen.

If you want it to look the same on the paper as it does on-
screen, you need to use the win32 GetDeviceCaps to get the
number of pixels per inch for the screen's X and Y. When you
have that, do some math to get the width and height of the
bitmap in inches.

Then get the printer's pixels per inch for it's X and Y and
calculate a TRect into the printer that represents the same
size in inches as the bitmap.

Finally, since the destination Rect will be larger than the
source, you need to stretch it.

If you still experiance problems, then I would suggest that
you not set the bitmap's HandleType to bmDIB because I've
never used it because I've always manually converted it and
that has always worked.

~ JD
Back to top
MR
Guest





PostPosted: Sun Feb 18, 2007 3:15 pm    Post subject: Re: Printed Bitmap with Text on it. Text is very fuzzy!!! Reply with quote

Hello JD,

thank you for your detailed explanation!

I think also, that this is the problem. because the printer has a higher
resolution as screen.
so I try to follow your suggestion.

thanks
Shapou
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.