WPCubed Product Support

PaintWatermark + rotated text + Print

The following works fine in the editor, but the rotation is lost when printing; is there something that needs to be tweaked to get it to work?

void __fastcall CLDDocument::OnEditorPaintWatermark(...) {
  TFont* newFont(new TFont());
  newFont->Assign(toCanvas->Font);
  TLogFont newLogFont;
  GetObject(newFont->Handle, sizeof(newLogFont), &newLogFont);
  newLogFont.lfEscapement = 900;
  newLogFont.lfOrientation = 900;
  newFont->Handle = CreateFontIndirect(&newLogFont);
  toCanvas->Font->Assign(newFont);
  delete newFont;
  toCanvas->TextOut(5, 5, "Hello");
}

patrik.nyborg(a)genicore.se

#1 ♥ 0
3.1k Views 2 users read 1 min
support

Hi,

output on the "Canvas" of the TWPRichText will also print if the printer supoports this.

Here I see a protential resource leak though since the new font is never deleted.

Julian

#2 ♥ 0

@wpsupport:
output on the "Canvas" of the TWPRichText will also print if the printer supoports this.

Hmmm yes, created a small testapplication which only outputs a rotated text directly to the printer canvas with the same result, so this has nothing to with wptools...

Sorry for the inconvenience!

Regards
patrik.nyborg(a)genicore.se

#3 ♥ 0
This category is archived. No new posts are possible.