realbasic-nug
[Top] [All Lists]

Re: Printing Rotated Text ... More Win32 Issues

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Printing Rotated Text ... More Win32 Issues
From: Aaron Bratcher <aaronbratcher at ontargetreports dot com>
Date: Sun, 31 Jul 2005 08:51:07 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <050620051437 dot 2016 dot 427B8113000ABB31000007E022007481840B049D0199D30E0E05 at co mcast.net> <a0620070cbea1361b50ef at [10 dot 10 dot 13 dot 4]> <58CF7195-6C7D-4CAB-9D7E-B527CE07DB43 at ontargetreports dot com>
Here is my test code:


  dim obj as StringShape
  dim p, p2 as Picture
  dim size, textSize, depth as Integer
  dim g as Graphics
  dim doTransparent, doubleBuffer as boolean


  g = OpenPrinterDialog
  if g = nil then
    return
  end

  textSize = 12
  depth = 24
  doTransparent = true
  doubleBuffer = false

  obj = new StringShape
  obj.TextFont = "Helvetica"
  obj.TextSize = textSize
  obj.Rotation = 0.7853981633974483 // 45°
  obj.text = "This is a sample string"

  g.TextFont = "Helvetica"
  g.TextSize = textSize

  size = g.StringWidth(obj.text)
  p = NewPicture(size*4,size*4,depth)
  p2 = NewPicture(size*4,size*4,depth)
  if doTransparent then
    p.transparent = 1
  end

  obj.TextSize = obj.TextSize*4
  p.Graphics.DrawObject obj,size*2,size*2
  obj.TextSize = obj.TextSize/4

  if doubleBuffer then
    p2.graphics.DrawPicture p,0,0
    if doTransparent then
      p2.Transparent = 1
    end
    g.DrawPicture p2,200,200,size,size,0,0,p2.Width,p2.Height
  else
    g.DrawPicture p,200,200,size,size,0,0,p.Width,p.Height
  end
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>