Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Rotating an Image

I am using Report Builder 8.0 and have an image that I need to rotate from Horizontal to Vertical. How can I do this?

Comments

  • Hi Lori,

    ReportBuilder does not natively support image rotation. We will consider adding this for a future release.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hello Nico, we are using ReportBuilder to generate labels - a function to rotate images is highly desired! Any news on this?
    Thanks!
  • Hi Sara,

    This feature is still on our list of possible future enhancements. Thanks for the feedback.
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Hello Nico, we are using ReportBuilder to generate labels - a function to rotate images is highly desired! Any news on this?
    Thanks!
  • Hi Sara,

    Still on our list :smile:

    One option would be to draw the image to the TppPaintBox canvas and perform a SetWorldTrasform to rotate the image. Something like the following...
    procedure TForm2.ppPaintBox1Print(Sender: TObject);
    var
    lRect: TRect;
    lBitmap: TBitmap;
    lMatrix: TXForm;
    begin

    SetGraphicsMode(ppPaintBox1.Canvas.Handle, GM_ADVANCED);
    SetMapMode(ppPaintBox1.Canvas.Handle, MM_TEXT);

    //Rotate 90 degrees
    lMatrix.eM11 := 0; //Cos(n)
    lMatrix.em12 := -1; //Sin(n)
    lMatrix.em21 := 1; //-Sin(n)
    lMatrix.em22 := 0; //Cos(n)

    //New Top/Left (relative to the image)
    lMatrix.eDx := 0;
    lMatrix.eDy := ppPaintBox1.spWidth;

    SetWorldTransForm(ppPaintBox1.Canvas.Handle, lMatrix);

    lRect := Rect(0, 0, ppPaintBox1.spWidth, ppPaintBox1.spHeight);

    lBitmap := TBitmap.Create;

    try
    lBitmap.LoadFromFile('c:\temp\test.bmp');
    ppPaintBox1.Canvas.StretchDraw(lRect, lBitmap);

    finally
    lBitmap.Free;
    end;

    end;
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
Sign In or Register to comment.