It is currently April 27th, 2024, 6:14 am

Cut a meter into a shape (feature suggestion)

Report bugs with the Rainmeter application and suggest features.
User avatar
kami
Posts: 39
Joined: July 3rd, 2010, 10:47 am
Location: Canosa di Puglia, Italy

Cut a meter into a shape (feature suggestion)

Post by kami »

I suggest to introduce a feature which gives the possibility to set an image as a mask in order to display only the area of the meter intersecting the mask-image defined within the same meter's section. There could be a lot of applications and in my opinion it could make more beautiful many other rainmeter skins!

Another interesting feature could be the curved text. We could introduce an instruction in the section which manipulates the value of the radius of curvature for the string and another boolean value to avoid that the string makes an entire cycle overlapping the text at the begin of the string.

Here an example for a music player:

Image
User avatar
bobgrosh
Posts: 134
Joined: May 1st, 2011, 10:33 pm

Re: Cut a meter into a shape (feature suggestion)

Post by bobgrosh »

If I understand this, For the CD shown, you would use an image that has a white (or any color) image of a CD that has transparent corners and a transparent center as a mask. Then you would put the mask over top of a square picture containing the album artwork to create the example you showed. The transparent area would basically force any or all images below the mask to become transparent and show the desktop or other applications below it if the skin is positioned topmost.

OK, If that is sort of how you think it works, then I am all for it.

I wrote several skins that I use for my TV production. I wanted to display a static card image containing graphics, show title, logos and other information. The graphic is in HD, and I wanted to display one or two low definition videos in small openings on the card. The small videos were from vlc, live cameras or video conferencing software. I would launch the video(s) and position them on the screen so that they would be visible behind holes in the card. Since I have dozens of the cards I use for the different news, sports and weather broadcasts, and the cards are often shown without any small videos, I wrote the skin to trim the card into smaller pieces and fit them around the videos to mask out the various unwanted elements of the camera or video conferencing software. Buttons on the skin let me select various sizes and number of holes in the card where the video would show through. Also, I used the various tags from the VLC video files to control which cutout arrangement was used so that a VLC playlist could automate the whole process.

What I was trying to achieve was to simulate the look of the cable network news broadcast, just watch cnn or fox news when they interview one or two people via cell phone remotes.

One problem I see. With Windows versions prior to Vista, I don't think it is possible when layering images to force areas of images below them to be transparent. Now, with windows 7, I believe it might be possible to do things like that, (rounded corners and such) I'm just not sure if Rainmeter can take advantage of some of the newer features of Windows Vista and 7. Keep in mind that the images being masked might be animated using the Rainmeter method of simulating animated gifs, or may be scrolled. It would also be nice if the mask itself could be animated using the same method.




The code to cut up the card graphic and position pieces around the small openngs whs a pain to write and also had a small processor impact. Your sugestion would make this process much simpler. All I would need is a mask for each shape I want to cut out
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: Cut a meter into a shape (feature suggestion)

Post by dragonmage »

I don't know for sure that GDI+ can do masks, but I do know that as far back as XP (maybe 98/ME) Stardock's apps (and others) used a method where a mask was a greyscale .bmp. Pure white on the mask translated to 100% transparent on the displayed image with greys translating to more opaque as they got darker, all the way up to pure black at 100% opacity. This allowed for displaying regular .bmp with alpha blending, but would also work perfectly for what you are suggesting. You'll have to wait for word from a Dev about the possibility of doing that in Rainmeter.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: Cut a meter into a shape (feature suggestion)

Post by poiru »

dragonmage wrote:I don't know for sure that GDI+ can do masks, but I do know that as far back as XP (maybe 98/ME) Stardock's apps (and others) used a method where a mask was a greyscale .bmp. Pure white on the mask translated to 100% transparent on the displayed image with greys translating to more opaque as they got darker, all the way up to pure black at 100% opacity.
AFAIK, you need to modify the pixels manually with GDI+, but this is definitely doable. Something to look at after we've shipped 2.3 :)
User avatar
bobgrosh
Posts: 134
Joined: May 1st, 2011, 10:33 pm

Re: Cut a meter into a shape (feature suggestion)

Post by bobgrosh »

poiru wrote: AFAIK, you need to modify the pixels manually with GDI+, but this is definitely doable. Something to look at after we've shipped 2.3 :)
Great news :thumbup:
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Cut a meter into a shape (feature suggestion)

Post by MerlinTheRed »

I've been wanting this for a long time too. I'd make it more generic and let the user specify an alpha mask (monochrome image, if multiple channels are present, take average or something like that) and a color mask (rgb-image, multiplied with the rgb-values of the original image pixel-by-pixel). Perhaps even let the user specify an operation like multiply, add, subtract, min/max etc.

Of course we should only do this if it's not too slow. I don't know how you guys handle image rendering but accessing and modifying single pixels can be pretty slow.
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!