Click here to Skip to main content
15,892,797 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Flickering form Pin
eagertolearn17-Nov-05 5:41
eagertolearn17-Nov-05 5:41 
GeneralRe: Flickering form Pin
Joshua Quick17-Nov-05 21:10
Joshua Quick17-Nov-05 21:10 
GeneralRe: Flickering form Pin
eagertolearn18-Nov-05 14:05
eagertolearn18-Nov-05 14:05 
GeneralRe: Flickering form Pin
Joshua Quick18-Nov-05 14:29
Joshua Quick18-Nov-05 14:29 
GeneralRe: Flickering form Pin
eagertolearn20-Nov-05 19:40
eagertolearn20-Nov-05 19:40 
GeneralRe: Flickering form Pin
Joshua Quick21-Nov-05 6:28
Joshua Quick21-Nov-05 6:28 
QuestionIn Win 2000 Pro , why can not permit one user have only right read all file in one folder Pin
dinhnq15-Nov-05 15:17
dinhnq15-Nov-05 15:17 
QuestionImage Editing Problems Pin
Mazitan15-Nov-05 13:57
Mazitan15-Nov-05 13:57 
I am attempting to edit an image to give it a non 3D effect. My problem is that the code does exactly what it is suppose to do D'Oh! | :doh: . Because of this, quite a few images have these big ugly streaks which completely mess up the affect, all because this green in a range of 5 was to close to this color of black. (Example: try this on C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water lilies.jpg). Does anyone have any alternative ideas of how to get a smooth image from this?

'Create a cartoonish like affect    <br />
Public Function Cartoon(ByVal EditImage As Image, ByVal Range As Integer) As Image<br />
        Dim ModBMP As New Bitmap(EditImage) 'Image to eidt<br />
        Dim X As Integer, Y As Integer 'Positioning coordinates<br />
        Dim ColorCapture As RGB 'Public Structure(3 integers to handle colors, nothing special)<br />
        Dim Match As Boolean<br />
        Dim R As Integer, G As Integer, B As Integer<br />
        'Filter through<br />
        For X = 1 To ModBMP.Width - 1<br />
            For Y = 1 To ModBMP.Height - 1<br />
                'Get color value of first position<br />
                R = ModBMP.GetPixel(X, Y).R : G = ModBMP.GetPixel(X, Y).G : B = ModBMP.GetPixel(X, Y).B<br />
                'Get color value of one pixel behind<br />
                Try<br />
                    ColorCapture.R = ModBMP.GetPixel(X - 1, Y).R : ColorCapture.G = ModBMP.GetPixel(X - 1, Y).G : ColorCapture.B = ModBMP.GetPixel(X - 1, Y).B<br />
                Catch ex As Exception<br />
                    'MsgBox(ex.Message)<br />
                End Try<br />
                'Modify to enhance check (crap code)<br />
                'Dim Vivi As Integer = 0<br />
                'Vivi = HighestColor(R, G, B)<br />
                'If Vivi = 1 Then R = R * 5<br />
                'If Vivi = 2 Then G = G * 5<br />
                'If Vivi = 3 Then B = B * 5<br />
                'Check Relations between two areas (ReAdjusted to hard way of adding booleans)<br />
                Match = InRange(R, Range, ColorCapture.R) + InRange(G, Range, ColorCapture.G) + InRange(B, Range, ColorCapture.B)<br />
                If Match = True Then R = ColorCapture.R : G = ColorCapture.G : B = ColorCapture.B<br />
                'Adjust the image<br />
                ModBMP.SetPixel(X, Y, Color.FromArgb(R, G, B))<br />
            Next Y<br />
        Next X<br />
        EditImage = ModBMP<br />
        Return EditImage<br />
    End Function<br />
<br />
    'Purpose: Check highest color value to help figure between small differences<br />
    Public Function HighestColor(ByVal R As Integer, ByVal G As Integer, ByVal B As Integer) As Integer<br />
        'Check<br />
        Dim eR As Boolean, eG As Boolean, eB As Boolean<br />
        'Evaluate<br />
        If R < B And R < G Then eR = False<br />
        If G < R And G < B Then eG = False<br />
        If B < R And B < G Then eB = False<br />
        If eR = True Then Return 1<br />
        If eG = True Then Return 2<br />
        If eB = True Then Return 3<br />
    End Function<br />
<br />
    'Purpose: Return boolean of whether in range of this number<br />
    Public Function InRange(ByVal Number As Double, ByVal Range As Double, ByVal Target As Double) As Boolean<br />
        'Check<br />
        If Target <= Number + Range And Target >= Number - Range Then<br />
            InRange = True<br />
        Else<br />
            InRange = False<br />
        End If<br />
        'Return Results<br />
        Return InRange<br />
    End Function

AnswerRe: Image Editing Problems Pin
Christian Graus15-Nov-05 14:21
protectorChristian Graus15-Nov-05 14:21 
GeneralRe: Image Editing Problems Pin
Mazitan16-Nov-05 2:42
Mazitan16-Nov-05 2:42 
QuestionStretching BackgroundImage Pin
eagertolearn15-Nov-05 12:07
eagertolearn15-Nov-05 12:07 
AnswerRe: Stretching BackgroundImage Pin
Christian Graus15-Nov-05 12:53
protectorChristian Graus15-Nov-05 12:53 
GeneralRe: Stretching BackgroundImage Pin
eagertolearn15-Nov-05 16:08
eagertolearn15-Nov-05 16:08 
QuestionMatrix Transformations before rendering Pin
K. Shaffer15-Nov-05 8:43
K. Shaffer15-Nov-05 8:43 
Questiondisplaying search results Pin
JMS7615-Nov-05 7:07
JMS7615-Nov-05 7:07 
AnswerRe: displaying search results Pin
Guerven15-Nov-05 14:44
Guerven15-Nov-05 14:44 
GeneralRe: displaying search results Pin
JMS7616-Nov-05 5:55
JMS7616-Nov-05 5:55 
QuestionReferencing the selected ro in a DataGrid Pin
dptalt15-Nov-05 6:51
dptalt15-Nov-05 6:51 
AnswerRe: Referencing the selected ro in a DataGrid Pin
Guerven15-Nov-05 14:47
Guerven15-Nov-05 14:47 
AnswerRe: Referencing the selected ro in a DataGrid Pin
aseef15-Nov-05 21:45
aseef15-Nov-05 21:45 
GeneralRe: Referencing the selected ro in a DataGrid Pin
dptalt17-Nov-05 2:12
dptalt17-Nov-05 2:12 
QuestionCombobox issues Pin
lildragon15-Nov-05 6:36
lildragon15-Nov-05 6:36 
QuestionDisable the Windows Key Pin
Wilhelm-NA15-Nov-05 4:07
Wilhelm-NA15-Nov-05 4:07 
AnswerRe: Disable the Windows Key Pin
Dave Kreskowiak15-Nov-05 6:25
mveDave Kreskowiak15-Nov-05 6:25 
QuestionCSV file Pin
Dennis Huisman15-Nov-05 3:19
Dennis Huisman15-Nov-05 3:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.