mchagberg
asked on
Print Canvas and Screen Canvas
I'm working on a project where I send text to a canvas and do all the wrapping of the text manually. But the difference between the Printer?s canvas and the screen canvas make it very difficult to do anti aliasing. Does any one have any suggestions. Or algorithms to calculate the difference in text appearance on a printer canvas compared to a screen canvas. I know this questions has a lot of holes if you have any questions please ask.
My goal is to give the user a print preview that is accurate.
Thanks
Mike
My goal is to give the user a print preview that is accurate.
Thanks
Mike
Did you try to play with the property PrintScale. Maybe setting it to PrintToFit could Help. I haven't try, but I think it will make a difference.
listening...
ASKER
I'm sorry Comptebidon81 I don't know how to make printTofit apply to printing in the way I'm doing it. I'm drawing every item on the print canvas one at a time.
text images to whole thing. I put the text on in the order it is in a listbox. And Images go on in the preview window. When I add images I brake the string up into smaller strings to wrap around the image.
It's quite a process. But I run the same procedure twice. Once when the user previews and once when they print.
Not to mention all the times they add and image or new item to the list.
my problem is that I want the preview to look the same as the print but because of difference in the screen canvas and Printer canvas it is not very accurate
text images to whole thing. I put the text on in the order it is in a listbox. And Images go on in the preview window. When I add images I brake the string up into smaller strings to wrap around the image.
It's quite a process. But I run the same procedure twice. Once when the user previews and once when they print.
Not to mention all the times they add and image or new item to the list.
my problem is that I want the preview to look the same as the print but because of difference in the screen canvas and Printer canvas it is not very accurate
Just a thought, perhaps you could run your procedure once (for Preview) then save it to disk as an Image, and finally, print the image?
DragonSlayer.
DragonSlayer.
Look at: GetDeviceCaps() or one of my previouse Q:
ww.experts-exchange.com/js p/qManageQ uestion.js p?ta=delph i&qid=1030 9960
ziolko.
ww.experts-exchange.com/js
ziolko.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Listening...
Listening...
ASKER
DragonSlayer.
my boss doesn't want a rastered image.
lacob
I'm going to give it a shot give me a couple of days
my boss doesn't want a rastered image.
lacob
I'm going to give it a shot give me a couple of days
ASKER
lacob
I still havent had a chance to work on this any more
but I'll give you the points any way if you can help me with some thing else.
I need the API call to inverse text and turn it upside down.
thanks
Mike
I still havent had a chance to work on this any more
but I'll give you the points any way if you can help me with some thing else.
I need the API call to inverse text and turn it upside down.
thanks
Mike
Mike
if you can inverse color of text (if I understood)
use Canvas.Pen.mode:=pmNotXor and your active pen and brush color will be xored with color where you want draw
if you want rorate text before drawing (applied only on TT or vector fonts) use
FontH:HFONT;
LogFont:TLogFont;
FFont:TFont;
FFont:=TFont.Create;
LogFont.lfHeight:=...
LogFont.lfEscapement:=Angl e*10 //angle in degrees
//using in WinNT orherwise
//can be zero
LogFont.lfOrientation:=Ang le*10 //angle in degrees
FFont.Assing(Canvas.Font);
FontH:=CreateFontIndirect( LogFont);
Canvas.FontHandle:=FontH;
Canvas.TextOut or some drawing operations
Canvas.Font.Assing(FFont);
DeleteObject(FontH);
FFont.Free;
or you can draw text in Bitmap and rotate bitmap
but you can find (now I dont know) any algorithm to rotate position of BitmapPixels to another Bitmap
if you can inverse color of text (if I understood)
use Canvas.Pen.mode:=pmNotXor and your active pen and brush color will be xored with color where you want draw
if you want rorate text before drawing (applied only on TT or vector fonts) use
FontH:HFONT;
LogFont:TLogFont;
FFont:TFont;
FFont:=TFont.Create;
LogFont.lfHeight:=...
LogFont.lfEscapement:=Angl
//using in WinNT orherwise
//can be zero
LogFont.lfOrientation:=Ang
FFont.Assing(Canvas.Font);
FontH:=CreateFontIndirect(
Canvas.FontHandle:=FontH;
Canvas.TextOut or some drawing operations
Canvas.Font.Assing(FFont);
DeleteObject(FontH);
FFont.Free;
or you can draw text in Bitmap and rotate bitmap
but you can find (now I dont know) any algorithm to rotate position of BitmapPixels to another Bitmap
ASKER
Thanks