It is currently April 23rd, 2024, 1:40 pm

Image getting cut off when rotated

Get help with creating, editing & fixing problems with skins
Kc12
Posts: 2
Joined: January 8th, 2019, 5:52 am

Image getting cut off when rotated

Post by Kc12 »

(All links go to imgur)


So I'm trying to set up a calendar and I'm having an issue with rotating this image in rainmeter.

When I use this code, the image shows up fine.

However, when I add the ImageRotate command into this code, the image rotates, but gets cut off along the bottom and side.



Anyone know what the hell I am doing wrong? I'm pretty new to this, so sorry if it's an easy fix. Thanks in advance.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image getting cut off when rotated

Post by balala »

Kc12 wrote: January 8th, 2019, 5:57 am Anyone know what the hell I am doing wrong? I'm pretty new to this, so sorry if it's an easy fix. Thanks in advance.
You are not doing wrong anything. This issue has been introduced with the last update (Rainmeter 4.3 Beta r3273) and has been already reported. Probably the developers will need a while to discover and fix the problem. Until then we have to wait.
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image getting cut off when rotated

Post by balala »

In your case to rotate the image there are other solutions, too. I'm talking about TransformationMatrix, which if applied doesn't has the described issue. Although not too easy to be used, it can be done with this option, too. You can find a very good description of how this option can be used here. According to this description, you can rotate the meter for example in the following form:

Code: Select all

[MeterDay]
Meter=Image
ImageName=Days\Monday.png
X=160
Y=120
TransformationMatrix=(Cos(Rad(#Angle#)));(-Sin(Rad(#Angle#)));(Sin(Rad(#Angle#)));(Cos(Rad(#Angle#)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#Angle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#Angle#))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#Angle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#Angle#))))
DynamicVariables=1
This will rotate the image around its center with an angle which has to be defined into the [Variables] section. So add it there:

Code: Select all

[Variables]
Angle=-15
I can't apply in my case this solution, because the meter I'm working with already has a TransformationMatrix set and should have to combine them. I'd prefere to not do this, but if I won't find other solution, I'll try out this, too, but in your case it might work.
Kc12
Posts: 2
Joined: January 8th, 2019, 5:52 am

Re: Image getting cut off when rotated

Post by Kc12 »

Thanks for the reply. I tried rolling back to the official 4.2 final release and it fixed the problem. It's definitely not as elegant of a solution as yours, but it's working for now. Whenever they get around to fixing it I'll update to 4.3.

Much thanks :thumbup:
User avatar
balala
Rainmeter Sage
Posts: 16162
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image getting cut off when rotated

Post by balala »

Kc12 wrote: January 9th, 2019, 6:20 am Thanks for the reply. I tried rolling back to the official 4.2 final release and it fixed the problem. It's definitely not as elegant of a solution as yours, but it's working for now. Whenever they get around to fixing it I'll update to 4.3.
A fix has been released, but it's not published yet: https://forum.rainmeter.net/viewtopic.php?f=123&t=30910&e=1&view=unread#p157559
(read the replies below too).