Click here to Skip to main content
15,901,666 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionLost Focus on Mdi Parent Button? Pin
ghost1817-Sep-06 19:49
ghost1817-Sep-06 19:49 
AnswerRe: how to enlarge width data report ?? Pin
very_short_life9-Sep-06 4:28
very_short_life9-Sep-06 4:28 
QuestionVB6 - Inserting a data worksheet in a workbook. Pin
A Price7-Sep-06 17:00
A Price7-Sep-06 17:00 
QuestionHow to make glass effect image in .NET/WinXP Pin
re infecta7-Sep-06 10:44
re infecta7-Sep-06 10:44 
AnswerRe: How to make glass effect image in .NET/WinXP Pin
salysle7-Sep-06 13:21
salysle7-Sep-06 13:21 
GeneralRe: How to make glass effect image in .NET/WinXP Pin
re infecta7-Sep-06 20:55
re infecta7-Sep-06 20:55 
GeneralRe: How to make glass effect image in .NET/WinXP Pin
The ANZAC7-Sep-06 23:26
The ANZAC7-Sep-06 23:26 
AnswerRe: How to make glass effect image in .NET/WinXP Pin
hannesHTG8-Sep-06 3:33
hannesHTG8-Sep-06 3:33 
Put two Buttons on your form named btnBlendShapes and btnDrawImages respectively. Add a picturebox, named pic. Type this :

Import this
Imports System.Drawing.Imaging


Then,
Private Sub btnBlendShapes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBlendShapes.Click

    'alpha numbers has to be between values 0 and 255.
    'alpha 0 is fully transparent while alpha 255 is fully opaque

    'of course, change any of the alpha values below depending on which color you want to be more or
    'less transparent or opaque

    'the first apha value to be fully visible
    Dim alphaValue As Integer = 255

    'the second alpha value will have some transparency
    Dim alphaValue2 As Integer = 155

    'create 2 brushes. 1 brush with the first alpha value and the second brush using the 2nd alpha
    'value
    Dim aBrush As SolidBrush = New SolidBrush(Color.FromArgb(alphaValue, Color.Fuchsia))
    Dim aBrush2 As SolidBrush = New SolidBrush(Color.FromArgb(alphaValue2, Color.Goldenrod))

    'draw 2 rectangles, 1 with the first brush and the other rectangle using the 2nd brush
    pic.CreateGraphics.FillRectangle(aBrush, 0, 0, 100, 100)
    pic.CreateGraphics.FillRectangle(aBrush2, 50, 50, 100, 100)

End Sub

Private Sub btnDrawImages_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDrawImages.Click

    'the 2 images to use for the alpha blend. you may have to change the image paths to where the
    'images are on your computer.
    Dim imagePath As String = "AW-9TriplePan2.gif"
    Dim imagePath2 As String = "AW-9TriplePan2.gif"

    'create 2 new images with the above filenames
    Dim img As Image = Image.FromFile(imagePath)
    Dim img2 As Image = Image.FromFile(imagePath2)

    'create 2 new ojects to use the ImageAttrubute class and the ColorMatrix Class
    Dim i As ImageAttributes = New ImageAttributes
    Dim c As ColorMatrix = New ColorMatrix

    'draw both images onto the picturebox control. the first image will not have any changes made to
    'any of its attributes.
    pic.CreateGraphics.DrawImage(img, 0, 0, 200, 150)

    'with matrix33 you can adjust the images alpha value
    'values I think are to be between 0 and 1. Ex: .3, .25, or .5 ect....
    c.Matrix33 = 0.45
    i.SetColorMatrix(c)

    'this 2nd image will have its maxtrix33 element modified to make the image appear more
    'transparent. Remember the matrix33 element controls the images Alpha value.
    pic.CreateGraphics.DrawImage(img2, New Rectangle(50, 50, 200, 150), 0, 0, img2.Width, _
    img2.Height, GraphicsUnit.Pixel, i)

End Sub

Private Sub pic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pic.Click

    'will redraw the picturebox and clear the rectangles and images that were drawn
    pic.Refresh()

End Sub


And that's alphablending!


HTG CodeGuru Article Reviewer.
QuestionVB.NET not updating my primary keys Pin
MAJackson7-Sep-06 10:09
MAJackson7-Sep-06 10:09 
AnswerRe: VB.NET not updating my primary keys Pin
MAJackson8-Sep-06 7:16
MAJackson8-Sep-06 7:16 
QuestionAppending Word Documents Pin
Wafdof7-Sep-06 9:13
Wafdof7-Sep-06 9:13 
Questioncalling a function in the code behind from java script Pin
ONeil Tomlinson7-Sep-06 7:18
ONeil Tomlinson7-Sep-06 7:18 
AnswerRe: calling a function in the code behind from java script Pin
Guffa7-Sep-06 8:22
Guffa7-Sep-06 8:22 
Questionhow to export / save wave file from Resource as wave file Pin
elsahaba7-Sep-06 6:47
elsahaba7-Sep-06 6:47 
QuestionTreeview question Pin
KreativeKai7-Sep-06 6:32
professionalKreativeKai7-Sep-06 6:32 
AnswerRe: Treeview question Pin
KreativeKai7-Sep-06 9:20
professionalKreativeKai7-Sep-06 9:20 
AnswerRe: Treeview question Pin
salysle7-Sep-06 13:15
salysle7-Sep-06 13:15 
Questioneditable datagrid column Pin
vidhu raj7-Sep-06 5:03
vidhu raj7-Sep-06 5:03 
AnswerRe: editable datagrid column Pin
KreativeKai7-Sep-06 8:30
professionalKreativeKai7-Sep-06 8:30 
Questionprocedure working fine with oracle is not working when i call from vb Pin
Mohamed nishar7-Sep-06 4:48
Mohamed nishar7-Sep-06 4:48 
QuestionFunction to reverse a number Pin
dcomf7-Sep-06 4:24
dcomf7-Sep-06 4:24 
AnswerRe: Function to reverse a number Pin
aniskhan7-Sep-06 5:04
aniskhan7-Sep-06 5:04 
AnswerRe: Function to reverse a number Pin
aniskhan7-Sep-06 5:35
aniskhan7-Sep-06 5:35 
AnswerRe: Function to reverse a number Pin
Guffa7-Sep-06 8:28
Guffa7-Sep-06 8:28 
QuestionHow to update a table Pin
cstrader2327-Sep-06 2:17
cstrader2327-Sep-06 2:17 

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.