Aurigma Forums
»
Graphics Mill
»
Discussions – Graphics Mill
»
Example in VB.Net Brightness and contrast on TrackBar1_Scroll with MultiLayerViewer1
Rank: Member
Groups: Guest
Joined: 4/6/2010(UTC) Posts: 24
|
Hi Is Possibile view a example code in VB.NET for windows application this Function? Brightness and contrast on TrackBar1_Scroll with MultiLayerViewer1 applied on Layer and only VObject in Layer..... Thank you for reply Maurizio
|
|
|
|
Rank: Member
Groups: Guest
Joined: 4/6/2010(UTC) Posts: 24
|
help me please
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
Hi, You can implement brightness and contrast to bitmap of particular ImageVObject. However _image field is a private in ImageVObject. So you can get it using Reflection only: Code:Dim imageInfo As System.Reflection.FieldInfo = _
imageVObj.GetType().GetField("_image", _
System.Reflection.BindingFlags.NonPublic Or _
System.Reflection.BindingFlags.DeclaredOnly Or _
System.Reflection.BindingFlags.Instance)
Dim image As Aurigma.GraphicsMill.Bitmap = _
CType(imageInfo.GetValue(imageVObj), _
Aurigma.GraphicsMill.Bitmap)
Now you can implement brightness and contrast to this bitmap. How to work with these effects you can find in Main Demo sample. |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 4/6/2010(UTC) Posts: 24
|
Hi Tamila I have see MainDemo sample for VB.NET but if i change value i don't see preview in image but i see my modified after i click ok button :(.... If i have in VB.NET TrackBar1_Scroll with maximum value 100 and Minimum vale -100 when i change value is possible see in Multilayerviewe1 the changes ? i have try in This mode but don't work... Private Sub TrackBar1_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar1.Scroll Dim LumBri As New Aurigma.GraphicsMill.Transforms.BrightnessContrast LumBri.BrightnessAmount = TrackBar1.value end sub Thank you Maurizio
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
Quote:when i change value is possible see in Multilayerviewe1 the changes ? Unfortunately it is impossible for MultiLayerViewer. |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 4/6/2010(UTC) Posts: 24
|
System exists to do this? :(
|
|
|
|
Rank: Member
Groups: Guest
Joined: 4/6/2010(UTC) Posts: 24
|
hi if i have a layer0 with Photo because impossibile adjust Brightness and Contrast or impossibile example applyed GrayScale? i try in this mode but dont'work :( Dim BrighContr As New Aurigma.GraphicsMill.Transforms.BrightnessContrast Dim layer1 As New Aurigma.GraphicsMill.WinControls.Layer("First") MultiLayerViewer1.CurrentLayer = layer2 BrighContr.BrightnessAmount = 0.9F BrighContr.ApplyTransform(MultiLayerViewer1.CurrentLayer = layer2 ) thank you :( Edited by user Thursday, May 13, 2010 6:22:02 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
Hi, The following line is incorrect: Code:BrighContr.ApplyTransform(MultiLayerViewer1.CurrentLayer = layer2 )
ApplyTransform() method needs a bitmap, not a layer. You should use something like this: Code:Dim imageInfo As System.Reflection.FieldInfo = _
imageVObj.GetType().GetField("_image", _
System.Reflection.BindingFlags.NonPublic Or _
System.Reflection.BindingFlags.DeclaredOnly Or _
System.Reflection.BindingFlags.Instance)
Dim image As Aurigma.GraphicsMill.Bitmap = _
CType(imageInfo.GetValue(imageVObj), _
Aurigma.GraphicsMill.Bitmap)
Dim BrighContr As New Aurigma.GraphicsMill.Transforms.BrightnessContrast
BrighContr.BrightnessAmount = 0.9F
BrighContr.ApplyTransform(image)
'Now you can put transformed bitmap image into new imageVObj instead of current
MultiLayerViewer1.CurrentLayer.VObjects.Remove(imgVObj)
Dim newImgVObj As Aurigma.GraphicsMill.WinControls.ImageVObject(image, False, 0, 0)
MultiLayerViewer1.CurrentLayer.VObjects.Add(newImgVObj)
Edited by user Thursday, May 13, 2010 7:50:54 PM(UTC)
| Reason: Not specified |
|
|
|
|
Rank: Member
Groups: Guest
Joined: 4/6/2010(UTC) Posts: 24
|
ok i try your method: in last two line i have a error: Dim newImgVObj As Aurigma.GraphicsMill.WinControls.ImageVObject(image, False, 0, 0) MultiLayerViewer1.CurrentLayer.VObjects.Add(newImgVObj) image???? newimgvobj??? i past all line: Code:Dim bmp As New Aurigma.GraphicsMill.Bitmap
Dim imgVObj As New Aurigma.GraphicsMill.WinControls.ImageVObject(bmp, False, 0, 0)
Dim imageInfo As System.Reflection.FieldInfo = imgVObj.GetType().GetField("_image", _
System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.DeclaredOnly Or System.Reflection.BindingFlags.Instance)
Dim image As Aurigma.GraphicsMill.Bitmap = CType(imageInfo.GetValue(imgVObj), Aurigma.GraphicsMill.Bitmap)
Dim BrighContr As New Aurigma.GraphicsMill.Transforms.BrightnessContrast
BrighContr.BrightnessAmount = 0.9F
BrighContr.ApplyTransform(image)
'Now you can put transformed bitmap image into new imageVObj instead of current
MultiLayerViewer1.CurrentLayer.VObjects.Remove(imgVObj)
Dim newImgVObj As Aurigma.GraphicsMill.WinControls.ImageVObject(image, False, 0, 0)
MultiLayerViewer1.CurrentLayer.VObjects.Add(newImgVObj)
this method is possibile usage Grayscale and adjust color and other effect ? Thank you Tamila Maurizio
|
|
|
|
Rank: Advanced Member
Groups: Guest
Joined: 3/9/2008(UTC) Posts: 554
Was thanked: 1 time(s) in 1 post(s)
|
Hi, Quote:ok i try your method: in last two line i have a error: Dim newImgVObj As Aurigma.GraphicsMill.WinControls.ImageVObject(image, False, 0, 0) MultiLayerViewer1.CurrentLayer.VObjects.Add(newImgVObj) image???? newimgvobj??? This problem appears because the New is lost in Dim newImgVObj ... So the following lines are right: Code:Dim newImgVObj As New Aurigma.GraphicsMill.WinControls.ImageVObject(image, False, 0, 0)
MultiLayerViewer1.CurrentLayer.VObjects.Add(newImgVObj)
Quote:this method is possible usage Grayscale and adjust color and other effect ? You can apply any effects to image Bitmap (see the code above). About applying effects I recommend you to read these articles. Edited by user Sunday, May 16, 2010 12:15:04 PM(UTC)
| Reason: Not specified |
|
|
|
|
Aurigma Forums
»
Graphics Mill
»
Discussions – Graphics Mill
»
Example in VB.Net Brightness and contrast on TrackBar1_Scroll with MultiLayerViewer1
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.