Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Frontend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wetterstation
Frontend
Commits
163d871f
Commit
163d871f
authored
5 years ago
by
Dennis Eisold
Browse files
Options
Downloads
Patches
Plain Diff
Windrose dreht sich jetzt
parent
ac544120
No related branches found
No related tags found
1 merge request
!23
Windrose dreht sich jetzt
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Wetterstation/Form1.Designer.cs
+136
-100
136 additions, 100 deletions
Wetterstation/Form1.Designer.cs
Wetterstation/Form1.cs
+19
-0
19 additions, 0 deletions
Wetterstation/Form1.cs
with
155 additions
and
100 deletions
Wetterstation/Form1.Designer.cs
+
136
−
100
View file @
163d871f
This diff is collapsed.
Click to expand it.
Wetterstation/Form1.cs
+
19
−
0
View file @
163d871f
...
@@ -145,10 +145,29 @@ namespace Wetterstation
...
@@ -145,10 +145,29 @@ namespace Wetterstation
lbWindSpeed
.
Invoke
(
new
Action
(()
=>
{
lbWindSpeed
.
Text
=
weatherData
.
windSpeed
+
" ms"
;
}));
lbWindSpeed
.
Invoke
(
new
Action
(()
=>
{
lbWindSpeed
.
Text
=
weatherData
.
windSpeed
+
" ms"
;
}));
lbWindricht
.
Invoke
(
new
Action
(()
=>
{
lbWindricht
.
Text
=
weatherData
.
windDeg
+
" °"
;
}));
lbWindricht
.
Invoke
(
new
Action
(()
=>
{
lbWindricht
.
Text
=
weatherData
.
windDeg
+
" °"
;
}));
lbLuftdruck
.
Invoke
(
new
Action
(()
=>
{
lbLuftdruck
.
Text
=
weatherData
.
pressure
+
" mbar"
;
}));
lbLuftdruck
.
Invoke
(
new
Action
(()
=>
{
lbLuftdruck
.
Text
=
weatherData
.
pressure
+
" mbar"
;
}));
pictureBox1
.
Invoke
(
new
Action
(()
=>
{
pictureBox1
.
Image
=
RotateImage
((
Bitmap
)
global
::
Wetterstation
.
Properties
.
Resources
.
ResourceManager
.
GetObject
(
"WindRose_neu"
),
(
int
)
weatherData
.
windDeg
);
}));
}
}
catch
(
Exception
ignored
)
{
}
catch
(
Exception
ignored
)
{
}
}
}
private
Bitmap
RotateImage
(
Bitmap
bmp
,
float
angle
)
{
float
height
=
bmp
.
Height
;
float
width
=
bmp
.
Width
;
int
hypotenuse
=
System
.
Convert
.
ToInt32
(
System
.
Math
.
Floor
(
Math
.
Sqrt
(
height
*
height
+
width
*
width
)));
Bitmap
rotatedImage
=
new
Bitmap
(
hypotenuse
,
hypotenuse
);
using
(
Graphics
g
=
Graphics
.
FromImage
(
rotatedImage
))
{
g
.
TranslateTransform
((
float
)
rotatedImage
.
Width
/
2
,
(
float
)
rotatedImage
.
Height
/
2
);
//set the rotation point as the center into the matrix
g
.
RotateTransform
(
angle
);
//rotate
g
.
TranslateTransform
(-(
float
)
rotatedImage
.
Width
/
2
,
-(
float
)
rotatedImage
.
Height
/
2
);
//restore rotation point into the matrix
g
.
DrawImage
(
bmp
,
(
hypotenuse
-
width
)
/
2
,
(
hypotenuse
-
height
)
/
2
,
width
,
height
);
}
return
rotatedImage
;
}
public
void
updateFormForecast
(
String
message
)
public
void
updateFormForecast
(
String
message
)
{
{
Console
.
WriteLine
(
"Entered updateFormForecast"
);
Console
.
WriteLine
(
"Entered updateFormForecast"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment