-
5 Attachment(s)
[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.
Attachment 146133
Attachment 146135
What you can achieve with Firenze Label. (Sorry, there are lot of more but this post can have only 5 attachements)
Attachment 146137 Attachment 146139
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
-
4 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
-
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!!!
-
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,欢迎使用中文环境的一起测试这个好代码。
-
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:wave:
-
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.
-
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 :wave:
-
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
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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.
-
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
-
1 Attachment(s)
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
Attachment 146211
-
1 Attachment(s)
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:
Attachment 146217
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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 :)
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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
Attachment 146211
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 :)
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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:
Attachment 146217
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.
-
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....
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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 :)
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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...
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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:
http://vbRichClient.com/Downloads/FontAwesome.png
...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
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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 :)
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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
-
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
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
just wanted to know if there is any new development on this usercontrol.. tks
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
not now, but i can do that if people will interested in :)
-
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.
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Caption if you can set the shortcut key is better!
-
1 Attachment(s)
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.
Attachment 149769
-
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.
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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! :check:
-
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
-
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.
-
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.
-
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
-
2 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
Attachment 175213Attachment 175215 Even after installing FontAwesome I am getting squares in place of the FontAwesome Icons. I have tried reinstalling them several times. Any suggestions?
-
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.
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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.
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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 ?
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
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
-
1 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
How to add some features for better control
I use the 3D Active Button Magic control and it has very good features.
If it can be added to the Firenze Label control, it would be great.
For example, you can control multiple captions
in all directions by changing the color and font of each title
Attachment 190660
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
Mojtaba
How to add some features for better control
...
For example, you can control multiple captions
in all directions by changing the color and font of each title
Since the Firence-Label is windowless (using relatively few resources) -
why not solve this problem via:
- multiple Label-Controls
- instead of multiple Captions per Label-Control
IMO such cases should be relatively rare - adding a few more Labels should not be overly complicated.
Olaf
-
2 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
Schmidt
Since the Firence-Label is windowless (using relatively few resources) -
why not solve this problem via:
- multiple Label-Controls
- instead of multiple Captions per Label-Control
IMO such cases should be relatively rare - adding a few more Labels should not be overly complicated.
Olaf
I am making a lunar, solar and Gregorian calendar and I need a lot of stickers
Attachment 190676
Attachment 190677
Isn't this method better with fewer labels?
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
What about writing your own (windowless) "ucLunarCell.ctl",
which incorporates 3 of the FirenceLabel-Controls on its "Control-Rectangle"...?
Olaf
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
Schmidt
What about writing your own (windowless) "ucLunarCell.ctl",
which incorporates 3 of the FirenceLabel-Controls on its "Control-Rectangle"...?
Olaf
Olaf, can you explain more, or you give me a sample?
In my opinion in these cases
It is better to have a label with multiple titles
It also takes less time to set up in terms of sorting and does not require multiple tags
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Is there an easy way to change the color of SVG icons?
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
Mojtaba
Is there an easy way to change the color of SVG icons?
The following Demo shows exactly, how this can be done...
https://www.vbforums.com/showthread....vbRichClient5)
Olaf
-
1 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
Schmidt
Thanks Olaf, the problem is that I call the SVG images outside _FontAwesomeSVGs.wac and I can't change the color of the icons.
I think there is a problem with karo1 control
Can you test it? I have 3 karo1 controls on the form, each of which has an SVG image, and I want to change the color of the icons with a button.
I prepared the project and added all the resources
Attachment 191290
-
1 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
The .ParseContent method of cSVG has a second CSS parameter where you can supply CSS to change the fill colour of the path. e.g. in the karo/firenze label .Draw method:
Code:
SVG.ParseContent m_Picture, "path { fill: yellow; }"
Produces the following:
Attachment 191292
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
jpbro
The .ParseContent method of cSVG has a second CSS parameter where you can supply CSS to change the fill colour of the path. e.g. in the karo/firenze label .Draw method:
Code:
SVG.ParseContent m_Picture, "path { fill: yellow; }"
Produces the following:
Attachment 191292
Thanks, jpbro, what should I do if I want to change the color from inside the form?
And another point is that all icons change color and it is not possible to consider a specific color for each icon?
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
Mojtaba
Thanks, jpbro, what should I do if I want to change the color from inside the form?
And another point is that all icons change color and it is not possible to consider a specific color for each icon?
I don't think the label is being developed by the original author any more, so I can't think of any downsides to extending it with your own code as needed at this point. You could add a FillColor property and then you could set the colour for any specific instance to any colour you need. If the .Draw method, add the CSS for the defined FillColor.
-
1 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
jpbro
I don't think the label is being developed by the original author any more, so I can't think of any downsides to extending it with your own code as needed at this point. You could add a FillColor property and then you could set the colour for any specific instance to any colour you need. If the .Draw method, add the CSS for the defined FillColor.
I added an SVGColor property, but I can't set it to change the color of the icon
Attachment 191335
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
Mojtaba
I added an SVGColor property, but I can't set it to change the color of the icon
Attachment 191335
You're most of the way there - the problem is that you aren't using your SVGColor value in the SVG CSS. You currently have this line in your Draw method:
Code:
CC.SetSourceColor m_SVGColor, m_BackColorOpacity / 100
and this one when you load/parse the SVG data:
Code:
SVG.ParseContent m_Picture, "path { fill: red; }"
You need to get rid of the first line and change the second one to use the SVGColor value (converted to RGB Hex).
-
1 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
Thanks jpbro :wave:
I have Done it
-
Re: [VB6] FIRENZE LABEL - label control with so many functions
Quote:
Originally Posted by
Mojtaba
Thanks jpbro :wave:
I have Done it
I put the code for friends to use, a feature to change the color of the SVG icon
Nice! Thank you for sharing the code :)
-
1 Attachment(s)
Re: [VB6] FIRENZE LABEL - New Update
FIRENZE LABEL - New Update
+ New Property
• SVGColor : Change The Color of The SVG icon
• SVGOpacity : Change Transparency of SVG icon A number between 0.1 and 1
• SVGRotation : Rotation SVG icon A number between 0 and 360
To Change the color of svg symbols, it is better to have black SVG images
Attachment 191350
-
Re: [VB6] FIRENZE LABEL - New Update
Quote:
Originally Posted by
Mojtaba
FIRENZE LABEL - New Update
+ New Property
• SVGColor : Change The Color of The SVG icon
• SVGOpacity : Change Transparency of SVG icon A number between 0.1 and 1
• SVGRotation : Rotation SVG icon A number between 0 and 360
Nice, ... I see you're getting "the hang of it"... :)
Olaf
-
Re: [VB6] FIRENZE LABEL - New Update
Quote:
Originally Posted by
Schmidt
Nice, ... I see you're getting "the hang of it"... :)Olaf
Thanks Olaf, these controls would not have been created without your efforts :)
Your great work (vbRichClient)
-
2 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
Olaf, I want to add Blur mode
I added the BackBlur feature
Please guide me in this regard
This image is related to the LabelPlus control
Gdiplus is used, I want to use Cairo
Attachment 191362
Only the more optimized the code, the better
I saw this article but could not apply it to the control
New Property BackBlur
Attachment 191361
-
1 Attachment(s)
Re: [VB6] FIRENZE LABEL - label control with so many functions
I did this with the help of the widget and the GaussianBlur effect, the only problem is that the control should be captured and called inside itself.
Attachment 191396
Code:
Set Blr = BackBuf.GaussianBlur(8, Offs)
CC.RoundedRect m_BorderWidth - 1, m_BorderWidth - 1, UserControl.ScaleWidth - (m_BorderWidth * 2) + 2, UserControl.ScaleHeight - (m_BorderWidth * 2) + 2, 0, True, cmAll, False
CC.Clip True: CC.RenderSurfaceContent Blr, -Offs, -Offs: CC.ResetClip