Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Generate image from xaml
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Generate image from xaml

 Post Reply Post Reply
Author
Message
mlg View Drop Down
Groupie
Groupie


Joined: 25 January 2011
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote mlg Quote  Post ReplyReply Direct Link To This Post Topic: Generate image from xaml
    Posted: 16 March 2011 at 6:38am
Hi!

There are some control or method for generate image from xaml and i can save the image?


 I have version 15.

Thanks!
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1354
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2011 at 8:56pm
You can use the PrintToDc method of the MarkupLabel controlto draw to a PictureBox or form, and then use the SavePicture method to save that image.

Something like:


Option Explicit

Private Sub Form_Load()
   Const c_XamlFile As String = "C:\Program Files\Codejock Software\ActiveX\Xtreme SuitePro ActiveX v15.0.1\Utils\Markups\ColoredToucan.xaml"
  
   Dim l_Ff As Integer
   Dim l_Xaml As String
  
   l_Xaml = Space$(FileLen(c_XamlFile))
   l_Ff = FreeFile
   Open c_XamlFile For Binary Access Read As #l_Ff
   Get #l_Ff, , l_Xaml
   Close #l_Ff
  
   Me.Picture1.AutoRedraw = True
  
   With Me.MarkupLabel1
      .Caption = l_Xaml
      .PrintToDC Me.Picture1.hDC, 0, 0, Me.Picture1.ScaleWidth \ Screen.TwipsPerPixelX, Me.Picture1.ScaleHeight \ Screen.TwipsPerPixelY
   End With
  
   SavePicture Me.Picture1.Image, "C:\test.bmp"
End Sub

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
mlg View Drop Down
Groupie
Groupie


Joined: 25 January 2011
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote mlg Quote  Post ReplyReply Direct Link To This Post Posted: 24 March 2011 at 7:22am
thank you!!
Back to Top
Andrew666 View Drop Down
Groupie
Groupie


Joined: 15 October 2008
Status: Offline
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andrew666 Quote  Post ReplyReply Direct Link To This Post Posted: 26 March 2011 at 4:21pm
However, please correct me if I'm wrong, but there's no way to capture the part of the image that is not visible (if there is any) - e.g. in the situation where the XAML is clipped in the application window. 
 
--A
Back to Top
mlg View Drop Down
Groupie
Groupie


Joined: 25 January 2011
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote mlg Quote  Post ReplyReply Direct Link To This Post Posted: 09 May 2011 at 3:34am
some idea for capture the part of the image that is not visible?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.