StretchDraw and canvas background...

TeeChart for ActiveX, COM and ASP
Post Reply
BdMan
Newbie
Newbie
Posts: 7
Joined: Wed Sep 01, 2004 4:00 am

StretchDraw and canvas background...

Post by BdMan » Mon Mar 12, 2007 2:10 pm

Hi!
I'm writing here for another problem.... I would like to draw a wmf file on the background of the tchart.

I've used this code:

Private Sub TChart1_OnAfterDraw()
With TChart1.Canvas
Dim stPic As StdPicture
Set stPic = LoadPicture("C:\door.wmf")

.StretchDraw 0, 0, 100, 100, stPic
End With
End Sub


But it hangs with error "run-time -2147418113 (8000ffff) Picture not valid" on .StretchDraw

I'm quite sure that the picture is valid, becouse If i run the editor, I could use it in "Panel / background / Backimage", and even if I use it on code:
With TChart1.Panel
.BackImageInside = False
.BackImageLoad ("C:\door.wmf")
End With

I've tried with .canvas becouse with .panel, in editor I can set left and top (even only until 100), but I haven't found the same settings in code properties!
My real problem is that I want align the image in the top-right corner... and the align methods (.BackImageMode) doesn't allow this (ehm.. do you know that .BackImageMode = 3 align the picture in top-left position? event it is not specified in the help and enum??)

Please could you give me a solution? (or how to make work the wmf in .stretchdraw or how to set top/left in BackImageLoad)
thanks a lot!!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 12, 2007 2:43 pm

Hi BdMan,

Have you tried using a .emf metafile instead of .wmf?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

BdMan
Newbie
Newbie
Posts: 7
Joined: Wed Sep 01, 2004 4:00 am

...ops..

Post by BdMan » Mon Mar 12, 2007 3:32 pm

Thanks a lot, it seems to work! (with .emf)

Post Reply