Print Page | Close Window

European Union Energy Label

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17917
Printed Date: 23 November 2024 at 10:19pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: European Union Energy Label
Posted By: Albert1
Subject: European Union Energy Label
Date Posted: 18 February 2011 at 10:47am
any ideas to get the "energy label graph"? Or should I use MarkUpLabel?
 


-------------
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)




Replies:
Posted By: jpbro
Date Posted: 18 February 2011 at 10:56am
I would recommend the MarkupLabel - it can handle the Grid (Table), images, colours (using Border objects), Shapes, Fonts, etc...

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

Language: Visual Basic 6.0 SP6



Posted By: Albert1
Date Posted: 18 February 2011 at 11:41am

I think so. Even if I wish only to get the "simple" graph, better with 3d effect ;)

btw are you abel to use the PrintToDc to transfer the image in a PictureBox?
No example and no help (-:
 
I did a search on the forum and found some of your posts but without coming to a solution.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)



Posted By: jpbro
Date Posted: 18 February 2011 at 11:44am
Let me experiment with PrintToDc and get back to you shortly.

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

Language: Visual Basic 6.0 SP6



Posted By: Albert1
Date Posted: 18 February 2011 at 12:58pm
I got it work:
 

Dim s As String
s = "<StackPanel>"
s = s & "<TextBlock TextWrapping=""Wrap"" FontSize=""30"" Background=""Red"" FontWeight=""Bold"">"
s = s & "Baseline<Run FontSize=""20"" BaselineAlignment=""Top"">2</Run>"
s = s & "<InlineUIContainer BaselineAlignment=""Bottom""><Border Width=""20"" Height=""20"" Background=""Gold""/>"
s = s & "</InlineUIContainer><InlineUIContainer BaselineAlignment=""Center""><Border Width=""20"" Height=""20"" Background=""Green""/>"
s = s & "</InlineUIContainer><InlineUIContainer BaselineAlignment=""Top""> <Border Width=""20"" Height=""20"" Background=""White""/></InlineUIContainer>"
s = s & "<Run>Sample Text</Run>"
s = s & "</TextBlock>"
s = s & "</StackPanel>"
Picture1.AutoRedraw = True
With MarkupLabel1
    .Caption = s
    .PrintToDC Picture1.hDC, 0, 0, .Width, .Height
End With
 
strange: markuplabel and picturebox render pretty different  Confused
 
Tomorrow I will  create the label and post here the code.
 
TY jpbro
 
 
 
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)



Posted By: jpbro
Date Posted: 18 February 2011 at 1:42pm
If you are drawing to a PictureBox hDc it appears you have to refresh the PictureBox to get the image to appear, so:

Me.Picture1.AutoRedraw = True
Me.MarkupLabel1.PrintToDc Me.Picture1.Hdc, 0, 0, Me.Picture1.ScaleWidth, Me.Picture1.ScaleHeight
Me.Picture1.AutoRedraw = False
Me.Picture1.Refresh


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

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 18 February 2011 at 1:45pm
Sorry, just saw your message...try .Width / Screen.TwipsPerPixelX, .Height / Screen.TwipsPerPixelY (unless you are already using pixels for your ScaleMode). It seems to render properly for me. If it still doesn't look the same, can you post a screenshot?

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

Language: Visual Basic 6.0 SP6



Posted By: Albert1
Date Posted: 20 February 2011 at 3:03pm
Originally posted by jpbro jpbro wrote:

It seems to render properly for me. If it still doesn't look the same, can you post a screenshot?
 
above is markup label
below is the picturebox.
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 13.4.1 / 16.3.0

Platform: Windows Vista (32bit) - SP 2

Language: Visual Basic 6.0 (SP6)



Posted By: Oleg
Date Posted: 21 February 2011 at 1:16am
Yes, MarkupLabel has own Font property that will be used as default.

To be sure you have same font you can specify it on top of Markup object:

s = "<StackPanel TextElement.FontFamily='Tahoma'>"


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net