16,016,759 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by shubh2895 (Top 7 by date)
shubh2895
18-Aug-17 6:28am
View
thank you so much... it helps me alot..... :)
sorry for the harassing....
shubh2895
18-Aug-17 6:08am
View
Graeme_Grant Please Help.
i am so close to the answer.
shubh2895
18-Aug-17 5:05am
View
Please Help me..:(
shubh2895
18-Aug-17 4:47am
View
PLEASE
HELP ME....
i am start with new question.
shubh2895
18-Aug-17 3:48am
View
OK :)
https://www.codeproject.com/Questions/1201941/HOW-to-brightness-image-in-WPF-VB-using-slider-con
shubh2895
18-Aug-17 3:42am
View
thanks for Crop code... it works....
please help
i am stuck on image brightness problem in wpf using slider control.
i tried to pass values to this function it gives error
"object reference not set to the instance of object"
Public Shared Function Brightness(ByVal image As Bitmap, ByVal SliderValue As Integer) As Bitmap
'DrawImage(image, GetBrightnessMatrix(percent))
Dim brtR As Single = CSng(SliderValue / 100)
Dim brtG As Single = CSng(SliderValue / 100)
Dim brtB As Single = CSng(SliderValue / 100)
Dim image_attr As New ImageAttributes
Dim cm As ColorMatrix = New ColorMatrix(New Single()() _
{ _
New Single() {brtR, 0.0, 0.0, 0.0, 0.0}, _
New Single() {0.0, brtG, 0.0, 0.0, 0.0}, _
New Single() {0.0, 0.0, brtB, 0.0, 0.0}, _
New Single() {0.0, 0.0, 0.0, 1.0, 0.0}, _
New Single() {0.0, 0.0, 0.0, 0.0, 1.0}})
Dim rect As Rectangle = _
Rectangle.Round(image.GetBounds(GraphicsUnit.Pixel))
Dim wid As Integer = image.Width
Dim hgt As Integer = image.Height
Dim img As New Bitmap(wid, hgt)
Dim gr As Graphics = Graphics.FromImage(img)
image_attr.SetColorMatrix(cm)
gr.DrawImage(image, rect, 0, 0, wid, _
hgt, GraphicsUnit.Pixel, image_attr)
Return img
End Function
Private Sub SliderBrightness_ValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.RoutedPropertyChangedEventArgs(Of System.Double)) Handles SliderBrightness.ValueChanged
If image1.Source IsNot Nothing Then
Dim i As Integer
i = SliderBrightness.Value
StackPanelImage.Source = ToBitmapImage(Brightness(bitmapimage, i))
End If
End Sub
shubh2895
18-Aug-17 3:14am
View
thanks for Crop code... it works....
please help
i am stuck on image brightness problem in wpf using slider control.
i tried to pass values to this function it gives error
"object reference not set to the instance of object"
Public Shared Function Brightness(ByVal image As Bitmap, ByVal SliderValue As Integer) As Bitmap
'DrawImage(image, GetBrightnessMatrix(percent))
Dim brtR As Single = CSng(SliderValue / 100)
Dim brtG As Single = CSng(SliderValue / 100)
Dim brtB As Single = CSng(SliderValue / 100)
Dim image_attr As New ImageAttributes
Dim cm As ColorMatrix = New ColorMatrix(New Single()() _
{ _
New Single() {brtR, 0.0, 0.0, 0.0, 0.0}, _
New Single() {0.0, brtG, 0.0, 0.0, 0.0}, _
New Single() {0.0, 0.0, brtB, 0.0, 0.0}, _
New Single() {0.0, 0.0, 0.0, 1.0, 0.0}, _
New Single() {0.0, 0.0, 0.0, 0.0, 1.0}})
Dim rect As Rectangle = _
Rectangle.Round(image.GetBounds(GraphicsUnit.Pixel))
Dim wid As Integer = image.Width
Dim hgt As Integer = image.Height
Dim img As New Bitmap(wid, hgt)
Dim gr As Graphics = Graphics.FromImage(img)
image_attr.SetColorMatrix(cm)
gr.DrawImage(image, rect, 0, 0, wid, _
hgt, GraphicsUnit.Pixel, image_attr)
Return img
End Function
Private Sub SliderBrightness_ValueChanged(ByVal sender As System.Object, ByVal e As System.Windows.RoutedPropertyChangedEventArgs(Of System.Double)) Handles SliderBrightness.ValueChanged
If image1.Source IsNot Nothing Then
Dim i As Integer
i = SliderBrightness.Value
StackPanelImage.Source = ToBitmapImage(Brightness(bitmapimage, i))
End If
End Sub
Show More