-
Mar 26th, 2017, 03:35 AM
#1
Thread Starter
New Member
[VB6] FIRENZE LABEL - label control with so many functions
FIRENZE LABEL
version 1.1.1
last actualization: 26.3.2017
Created by Martin Vartiak, powered by Cairo Graphics and vbRichClient-Framework.
LICENSE: http://creativecommons.org/licenses/...1.0/fi/deed.en
1. Shortly about the project Firenze Label
All starts simply as always. I was looking for a simple anti-aliasing solution for VB6 because I was never satisfied with original one. Found some examples on the web, but as a graphic designer I was still very disappointed with results. After further search I found very interesting .dll library for graphic use of Cairo Graphics. At the first sight all was so complicated for me. I started to play with that library and decide to make very simple ActiveX component just for me. As I started to add more and more functions it becomes very user friendly component. And now i want to share it with you.
2. What makes Firenze Label so special?
Imagine me or you as a graphic designer and now remeber to basic VB6 Label component. Practically you can do nothing special with it, there are missing even some basic functions as a Vertical Alignment. I will try to describe most of the functions of the Firenze Label and you can imagine the endless possibilities of it use. With these properties and functions you can possibly achieve most of the modern design functions.
Custom Properties:
BackColor - ordinary back color
BackColorOpacity - back color with opacity (0-100)
Border - draws a border around the component
BorderColorOpacity - opacity of border (0-100)
BorderCorner - you can apply a mask for corners (i.e. you can mask only top corners for a tab strip)
BorderPosition - position of border
BorderRadius - border radius
BorderSmoothEdge - property for a better and smoother border in some cases
Border Width - border width
Caption - main text
CaptionAlignmentH - horizontal alignment of caption (left/center/right)
CaptionAlignmentV - vertical alignment of caption (top/middle/bottom)
CaptionPadding - padding for a caption
Cursor - you can choose between arrow and hand cursor (as on the website)
Font - don’t affraid to use all of the modern fonts with proper antialiasing
FontAwesome - if you lazy downloading custom icons, you can use hex codes of FontAwesome and get so many scalable icons so fast
ForeColor - simple ForeColor property
ForeColorOpacity - opacity for ForeColor (0-100)
Gradient - turn on if you like gradient background
GradientAngle - determines in which angle should gradient be drawn (0-360)
GradientColor1 - gradient color 1
GradientColor1Opacity - opacity for gradient color 1
GradientColor2 - gradient color 2
GradientColor2Opacity - opacity for gradient color 2
ParentControl - child control shares all functionality of the parent control
Picture - you like modern .png or .svg pictures? (path to the picture)
PictureAlignmentH - horizontal aligment of picture
PictureAlignmentV - vertical alignment of picture
PictureOpacity - picture opacity (0-100)
PicturePadding - picture padding
PictureSVGScale - after you load .svg picture, you can scale it up or down
WordWrap - wordwrap, because why not
Custom events:
MouseEnter
MouseLeave
Practically you can use opacity on everything. You can use Firenze Label just to show .png or .svg picture if you want. Possibilities are endless.
3. Next developement
I have sooo many ideas for the next developement. Possibly I can “hire” someone for a optimalization of code and make it even more fast and pixel perfect.
Main goals to achieve:
- add all planned functions
- custom website
- custom installation file
- complete documentation
- more examples and sample codes
4. Showcase
Showtime
Working examples you can download.
What you can achieve with Firenze Label. (Sorry, there are lot of more but this post can have only 5 attachements)
5. Download
IMPORTANT NOTICE:
you have to add project reference vbRichClient5
icons from the examples are not pictures but windows font FontAwesome, you need to download and install it first (download from http://fontawesome.io/).
PROJECT IS IN DEVELOPEMENT.
Ask freely if you don't understand to something. I realize I didn't make it well documented for now, but I don't want to spam here a lot of text and explanations. For more questions or explanations send me PM or write here. Enjoy!
Matt
Last edited by Shaggy Hiker; Jan 3rd, 2019 at 11:15 AM.
Reason: Consistency.
-
Mar 26th, 2017, 03:38 AM
#2
Thread Starter
New Member
-
Mar 26th, 2017, 05:53 AM
#3
Re: [VB6] FIRENZE LABEL - label control with so many functions
-
Mar 26th, 2017, 06:19 PM
#4
Addicted Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
It's beautiful! I did not expect VB6 can do so beautiful, support you do better!!!
-
Mar 26th, 2017, 06:24 PM
#5
Addicted Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
My system language is Chinese, there are some pictures why the display is not correct?
Attachment 146185
我的QQ:28978005,欢迎使用中文环境的一起测试这个好代码。
Last edited by ChenLin; Mar 26th, 2017 at 06:40 PM.
-
Mar 27th, 2017, 08:35 AM
#6
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
As I mentioned it before in the IMPORTANT NOTICE at the end of the post, but I didn't explain it very well.
1. WHAT IS FONT AWESOME?
FontAwesome is windows and web font (mostly used on websites, must have for graphic designers) which contains 675 icons as a scalable vector.
2. INSTALLATION
You need to download it from http://fontawesome.io/ at first then install it (just copy file "FontAwesome.otf" to "C:\Windows\Fonts".
Afterwards you will see all the icons used in examples correctly.
3. USING YOUR OWN FONT AWESOME ICONS
If you want to use own icon from FontAwesome, then check http://fontawesome.io/cheatsheet/. Every icon have own code, for example fa-home []. To use it in the Firenze Label control you have to choose font FontAwesome (we assume you already installed it) and in FontAwesome property you need to write last two characters from icon code at first and then fourth and third from the end. For example from code [] write just 15f0.
4. FONT AWESOME IS FAST AND SIMPLE
Using Font Awesome is fast and simple. Anyways, you can always use own custom icons as a picture. Good website for free modern customizable icons is https://icons8.com/.
Matt
-
Mar 27th, 2017, 01:34 PM
#7
Hyperactive Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Loving this control. Just started playing with it.
Would it be possible to Auto size a large image to fit control.
Not a problem if not as i would resize an image before displaying.
Been Looking for a long time a semi transparent label/image control.
Excellent work.
-
Mar 27th, 2017, 02:50 PM
#8
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Thanks for your positive respond.
Autoresizing large image should be possible, give me some time and I can implement it.
After all it's good function, but take care of size of images.
When you scale down 1 MB .jpg file it will still have have 1 MB.
Matt
-
Mar 27th, 2017, 02:58 PM
#9
Hyperactive Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Hi Matt
I have some fanart pictures that are 1920 x 1080 in different folders
I am looking to create a display to show an image in a control.
Over this i will add a movie poster image and to the middle bottom add another control
with the plot summary. 50 % opacity. trying to make a good looking Movie info screen
If you add the Autosize feature, will you use GDI to scale image or someother method.
tks. great work
-
Mar 27th, 2017, 03:13 PM
#10
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by k_zeon
Hi Matt
I have some fanart pictures that are 1920 x 1080 in different folders
I am looking to create a display to show an image in a control.
Over this i will add a movie poster image and to the middle bottom add another control
with the plot summary. 50 % opacity. trying to make a good looking Movie info screen
If you add the Autosize feature, will you use GDI to scale image or someother method.
tks. great work
Cairo (graphics library which we use) have scale function already implemented. I'm just need to rewrite some code and test it properly.
-
Mar 27th, 2017, 03:28 PM
#11
Hyperactive Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
many thanks, look forward to it.
One other question. Sometimes i need to hold a picture in an image/picture control, then assign it
ie Pic1.Picture = Pic2.Picture
Will it be possible to do something like this as well with your control.
Maybe thinking of a resource file to load images etc from.
Another idea to make it look cool, is to add a shadow to make an image stand off the screen.
tks
Last edited by k_zeon; Mar 27th, 2017 at 03:31 PM.
-
Mar 27th, 2017, 07:20 PM
#12
Addicted Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
I added in the code automatically registered font content, we hope to be useful.
Code:
'注册字体
Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const HWND_BROADCAST = &HFFFF&
Private Const WM_FONTCHANGE = &H1D
Private Sub Form_Load()
'方法一:
' Dim R As String
' R = Dir("C:\WINDOWS\Fonts\FontAwesome.otf") '在C盘WINDOWS文件夹fonts中查找微软雅黑
' If R <> "" Then
' MsgBox "...填入)确认文件存在"
' Else
' MsgBox "...填入)确认文件不存在"
' End If
'方法二:
Dim i, m
For i = 0 To Screen.FontCount - 1
If "FontAwesome" = Screen.Fonts(i) Then m = 1
Next
If m = 1 Then
'MsgBox "含有此字体"
Else
'安装字体引用
Debug.Print AddFontResource(App.Path & "\FontAwesome.otf")
Call SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) '广播系统字体变化这一消息,如果不要其它程序看见你的字体可以不使用这行
End If
karo2.Picture = App.Path & "\img\eliteadmin_logo.jpg"
karo3.Picture = App.Path & "\img\eliteadmin_head.jpg"
End Sub
FirenzeLabel.zip
-
Mar 28th, 2017, 08:08 AM
#13
Re: [VB6] FIRENZE LABEL - label control with so many functions
First off - fantastic work, thanks for sharing!
One other issue that I think might be solved by a "Stretch" or "Fill" option is that images will work better on a high DPI display. Have a look at this screenshot to see what I get at 150% DPI:
-
Mar 28th, 2017, 03:07 PM
#14
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by k_zeon
many thanks, look forward to it.
One other question. Sometimes i need to hold a picture in an image/picture control, then assign it
ie Pic1.Picture = Pic2.Picture
Will it be possible to do something like this as well with your control.
Maybe thinking of a resource file to load images etc from.
Another idea to make it look cool, is to add a shadow to make an image stand off the screen.
tks
"Pic1.Picture = Pic2.Picture" is now possible, but images are loaded from the hard drive instead of the cache.
I'm not planning to do some caching now. I think cooperation with the LaVolpe ImageList should be possible.
And shadows of course are planned for the near future
-
Mar 28th, 2017, 03:09 PM
#15
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by ChenLin
I added in the code automatically registered font content, we hope to be useful.
Code:
'注册字体
Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const HWND_BROADCAST = &HFFFF&
Private Const WM_FONTCHANGE = &H1D
Private Sub Form_Load()
'方法一:
' Dim R As String
' R = Dir("C:\WINDOWS\Fonts\FontAwesome.otf") '在C盘WINDOWS文件夹fonts中查找微软雅黑
' If R <> "" Then
' MsgBox "...填入)确认文件存在"
' Else
' MsgBox "...填入)确认文件不存在"
' End If
'方法二:
Dim i, m
For i = 0 To Screen.FontCount - 1
If "FontAwesome" = Screen.Fonts(i) Then m = 1
Next
If m = 1 Then
'MsgBox "含有此字体"
Else
'安装字体引用
Debug.Print AddFontResource(App.Path & "\FontAwesome.otf")
Call SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) '广播系统字体变化这一消息,如果不要其它程序看见你的字体可以不使用这行
End If
karo2.Picture = App.Path & "\img\eliteadmin_logo.jpg"
karo3.Picture = App.Path & "\img\eliteadmin_head.jpg"
End Sub
FirenzeLabel.zip
Thanx for the piece of code, but your code solves the problem only in the examples. I need to fix it globally. I think proper installation by a installation file should fix the problem
-
Mar 28th, 2017, 03:16 PM
#16
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by jpbro
First off - fantastic work, thanks for sharing!
One other issue that I think might be solved by a "Stretch" or "Fill" option is that images will work better on a high DPI display. Have a look at this screenshot to see what I get at 150% DPI:
Thank for the support and for the poiting out the problem. I will look at this and find a solution to fix it. Scaling will be available soon.
-
Mar 29th, 2017, 12:19 PM
#17
Re: [VB6] FIRENZE LABEL - label control with so many functions
Very cool , thanks for sharing!
I think it would be nice to have a "UserControl-Free" version too. I mean a "Pure" CairoWidget to add to other standard Widgets: https://github.com/vbRichClient/vbWidgets.
Just a suggestion....
-
Mar 29th, 2017, 03:17 PM
#18
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by reexre
Very cool , thanks for sharing!
I think it would be nice to have a "UserControl-Free" version too. I mean a "Pure" CairoWidget to add to other standard Widgets: https://github.com/vbRichClient/vbWidgets.
Just a suggestion....
ActiveX control is very easy to use even for the beginners. Just place it on the form and change properties how you like it. No actual coding for you.
I think Olaf Schmidt should say his opinion first
-
Mar 30th, 2017, 05:38 AM
#19
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by reexre
Very cool , thanks for sharing!
I think it would be nice to have a "UserControl-Free" version too. I mean a "Pure" CairoWidget to add to other standard Widgets: https://github.com/vbRichClient/vbWidgets.
Just a suggestion....
Personally, I don't agree. It's great that porkynet has wrapped-up all this into an ActiveX for beginners but anybody that is using vbWidgets should have no problem doing any of this stuff for themselves. So why have one more widget to maintain when it is just a derivation of other existing widgets. My two cents...
If you don't know where you're going, any road will take you there...
My VB6 love-children: Vee-Hive and Vee-Launcher
-
Apr 1st, 2017, 03:50 PM
#20
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by porkynet
ActiveX control is very easy to use even for the beginners. Just place it on the form and change properties how you like it. No actual coding for you.
I think Olaf Schmidt should say his opinion first
I'm with Colin on this...
I appreciate the efforts you have put into this (making it usable behind a normal VB-UserControl, simply changing properties in the Property-Grid),
but the vbWidgets-Project does already contain appropriate Widgets, which one can use to reproduce your Demo-Screens just as well
(DPI-aware Zooming/Scaling being supported out of the box then, when using vbWidgets-based Forms).
Your Screens are really nice to look at - thanks for encouraging others with these design-ideas,
to try out the Cairo-Drawing in vbRichClient5.
Good Job, keep it up...
As for FontAwesome (with regards to the problem of "shipping the resource")...
I could put a Demo into the CodeBank, which shows how to use it from a (compressed)
RichClient-Resource-Archive (a *.wac-file instead of a Font-File, having a size of only 126kB)
then rendering these Symbols as SVGs over their "friendly name"-Key (instead of an
"AscW-Value" which points into a Font-Resource).
This FontAwesome-SVG-Demo would show a (free scalable) Output like the following:
...with support to set different ForeColors and BackColors for the SVG-Symbols...
The circular ColorChooser at the Bottom of the ScreenShot is implemented as
an RC5- 'cwClass' (a Widget) - the Form being a normal VB-Form which shows how
to incorporate such Widgets together with "normal Controls" in the VB-Form-Designer.
Olaf
-
Apr 2nd, 2017, 08:29 AM
#21
Hyperactive Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
The circular ColorChooser at the Bottom of the ScreenShot is implemented as
an RC5- 'cwClass' (a Widget) - the Form being a normal VB-Form which shows how
to incorporate such Widgets together with "normal Controls" in the VB-Form-Designer.
I like it, Olaf. This demo in codebank would be nice
-
Apr 8th, 2017, 12:58 PM
#22
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by Carlos Rocha
I like it, Olaf. This demo in codebank would be nice
Just uploaded it into the Codebank here:
http://www.vbforums.com/showthread.p...vbRichClient5)
Olaf
-
Apr 16th, 2017, 05:21 AM
#23
Hyperactive Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Hi Matt. Just looking to see how you are getting on with adding new features to your usercontrol.
ie the scaleimage etc.
looking forward to it.
thanks
-
May 10th, 2017, 02:19 PM
#24
Hyperactive Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
just wanted to know if there is any new development on this usercontrol.. tks
-
May 11th, 2017, 01:33 AM
#25
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
not now, but i can do that if people will interested in
-
May 11th, 2017, 01:43 AM
#26
Hyperactive Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
yes, i am interested. was waiting for the extra features that you were going to do.
-
Jun 22nd, 2017, 08:19 PM
#27
Addicted Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Caption if you can set the shortcut key is better!
-
Jul 20th, 2017, 12:22 PM
#28
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Hi, Matt!
I've compiled your example code to show for my friends, but I don't know why the app always crash right after form unload.
FontAwesome is installed, vbRichClient5 too... Everything works fine until the form unload.
-
Jul 20th, 2017, 06:24 PM
#29
Re: [VB6] FIRENZE LABEL - label control with so many functions
Try calling new_C.CleanupRichClientDll in the Form_Unload event and see if that helps.
-
Jul 21st, 2017, 06:00 AM
#30
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by jpbro
Try calling new_C.CleanupRichClientDll in the Form_Unload event and see if that helps.
Thanks jpbro!
You solved the problem!
-
Aug 11th, 2018, 10:50 AM
#31
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Buenas, estoy usando el control FirenzeLabel.
Sin embargo, cuando pongo el control dentro de un PictureBox, los eventos MouseEnter y MouseLeave de Firenze no funcionan. ¿Alguien sabe porque? o ¿Como puedo resolverlo?
Gracias
TRANSLATE:
Hi, I'm using the FirenzeLabel
However, when I put the control inside a PictureBox, Firenze's MouseEnter and MouseLeave events do not work. Does anyone know why? or How can I solve it?
Thank you
-
Oct 10th, 2018, 09:10 AM
#32
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
hello i have problem implementing fontawesome icons
it doesnt show even though i followed the steps
also have a problem putting this control inside a Frame control, it suddenly copy the backcolor of its child control which is firenze label
sorry for my poor english.
-
Jan 3rd, 2019, 03:43 AM
#33
Thread Starter
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Firenze Label probably behave like a parent. There will be issue with PictureBox and Frame, which are parents too.
-
Nov 20th, 2019, 10:10 PM
#34
Re: [VB6] FIRENZE LABEL - label control with so many functions
Hi Porkynet, Amazing work!!!! Really isefull control. I love how you wrapped it into a uc, it makes it really easy to use!. And a extra +10 for your designs! They look amazing. You must be a web developer cause they look a lot like modern web applications.
Just a coment: Im having problems with Font Awesome in the examples on Windows 7. Font installed in otf (Font Awesome 5 Free Solid) , I can see the icons on CHARMAP, but they dont appear in Firenze example except the ones I add myself (I need to change all the labels with icons)... weird.
My suggestion: Why we need to inverse the byte order of the unicode char codes? Will not be easier if you take the same number as in the https://fontawesome.com/cheatsheet?from=io ? That way it will be just a matter of copy & paste
-
Mar 9th, 2020, 07:25 AM
#35
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Even after installing FontAwesome I am getting squares in place of the FontAwesome Icons. I have tried reinstalling them several times. Any suggestions?
-
Mar 9th, 2020, 09:33 AM
#36
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
For anybody else trying to use this script. It does not work with Font Awesome 5. Make sure to use the Font Awesome 4 otf.
-
Mar 9th, 2020, 02:22 PM
#37
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by tcfurniture
For anybody else trying to use this script. It does not work with Font Awesome 5. Make sure to use the Font Awesome 4 otf.
Have you tried with the True Type versions ? I got a similar problem with my control and only get it working with the True Type version, no t the OTF.
-
Mar 9th, 2020, 02:34 PM
#38
New Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by shagratt
Have you tried with the True Type versions ? I got a similar problem with my control and only get it working with the True Type version, no t the OTF.
I didn't know they had a True Type version. Where did you get it? I did't see any here . https://fontawesome.com/download
-
Mar 5th, 2024, 07:46 AM
#39
Addicted Member
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by porkynet
FIRENZE LABEL
version 1.1.1
last actualization: 26.3.2017
Matt
There is a problem with the new versions of RC6, the color of the text does not change and all the texts are black
Is there a way to rebuild with RC6 ?
-
Mar 5th, 2024, 08:21 AM
#40
Re: [VB6] FIRENZE LABEL - label control with so many functions
Originally Posted by Mojtaba
There is a problem with the new versions of RC6, the color of the text does not change and all the texts are black
Is there a way to rebuild with RC6 ?
At the end of the Draw-Routine (in the "karo" Control) - enforce the FillColor-Setting for Text again:
Code:
...
'At the end fill all the stored text
CC.SetSourceColor m_ForeColor
CC.Fill
End Sub
HTH
Olaf
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|