Click here to Skip to main content
15,917,061 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: can we automatically manage paging in datagridview in windows application Pin
Thomas Stockwell16-Jul-08 4:46
professionalThomas Stockwell16-Jul-08 4:46 
AnswerRe: can we automatically manage paging in datagridview in windows application Pin
Piyush Vardhan Singh17-Jul-08 2:16
Piyush Vardhan Singh17-Jul-08 2:16 
QuestionVB6 clickable label Pin
tatchung15-Jul-08 21:35
tatchung15-Jul-08 21:35 
AnswerRe: VB6 clickable label Pin
Zaegra15-Jul-08 21:44
Zaegra15-Jul-08 21:44 
GeneralRe: VB6 clickable label Pin
tatchung15-Jul-08 22:06
tatchung15-Jul-08 22:06 
QuestionReports are not visible at client machine Pin
meetaqadir15-Jul-08 20:56
meetaqadir15-Jul-08 20:56 
AnswerRe: Reports are not visible at client machine Pin
_Damian S_16-Jul-08 16:40
professional_Damian S_16-Jul-08 16:40 
QuestionSaving Bitmap to WBMP Pin
threemp315-Jul-08 19:14
threemp315-Jul-08 19:14 
I'm not sure if this question is okay to ask, but does anyone know how to save a Bitmap object to a WBmp file?

My current code is below, but it doesn't work properly (I think I'm doing something wrong with the bitshifting to pack 8 pixels into a byte):

Dim fs As System.IO.FileStream = System.IO.File.OpenWrite(newFilename)
        Dim img As Bitmap = Image.FromFile(filename)

        ' Write Header
        fs.WriteByte(0)
        fs.WriteByte(0)
        fs.WriteByte(img.Width)
        fs.WriteByte(img.Height)

        ' Convert colour to 1bit and packet bits into byte
        Dim iByte As Byte = 0
        Dim iCurrentBit As Integer = 0
        For x As Integer = 0 To img.Width - 1
            For y As Integer = 0 To img.Height - 1

                Dim clr As Color = img.GetPixel(x, y)
                If (clr.R > 128) And (clr.G > 128) And (clr.B > 128) Then
                    If iCurrentBit >= 7 Then
                        iByte = iByte Or ((2 << iCurrentBit) - 1)
                    Else
                        iByte = iByte Or (2 << iCurrentBit)
                    End If
                End If

                If iCurrentBit >= 7 Then
                    fs.WriteByte(iByte)
                    iByte = 0
                    iCurrentBit = 0
                End If
                iCurrentBit += 1

            Next
        Next

        fs.Flush()
        fs.Close()

AnswerRe: Saving Bitmap to WBMP Pin
Luc Pattyn16-Jul-08 0:18
sitebuilderLuc Pattyn16-Jul-08 0:18 
GeneralRe: Saving Bitmap to WBMP Pin
threemp316-Jul-08 13:04
threemp316-Jul-08 13:04 
GeneralRe: Saving Bitmap to WBMP Pin
Luc Pattyn16-Jul-08 13:19
sitebuilderLuc Pattyn16-Jul-08 13:19 
QuestionPlay .pps / .ppt file without installing MS Office Powerpoint Pin
divyesh143215-Jul-08 18:09
divyesh143215-Jul-08 18:09 
QuestionRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Paul Conrad16-Jul-08 4:39
professionalPaul Conrad16-Jul-08 4:39 
AnswerRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Thomas Stockwell16-Jul-08 4:48
professionalThomas Stockwell16-Jul-08 4:48 
GeneralRe: Play .pps / .ppt file without installing MS Office Powerpoint Pin
Paul Conrad16-Jul-08 4:50
professionalPaul Conrad16-Jul-08 4:50 
QuestionEfficiently resizing an image with a pixel resize Pin
jacobjordan15-Jul-08 10:59
jacobjordan15-Jul-08 10:59 
AnswerRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 11:18
sitebuilderLuc Pattyn15-Jul-08 11:18 
GeneralRe: Efficiently resizing an image with a pixel resize [modified] Pin
jacobjordan15-Jul-08 12:37
jacobjordan15-Jul-08 12:37 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 13:21
sitebuilderLuc Pattyn15-Jul-08 13:21 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
jacobjordan15-Jul-08 13:25
jacobjordan15-Jul-08 13:25 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 13:50
sitebuilderLuc Pattyn15-Jul-08 13:50 
GeneralRe: OnPaint Pin
Luc Pattyn15-Jul-08 15:05
sitebuilderLuc Pattyn15-Jul-08 15:05 
GeneralRe: Efficiently resizing an image with a pixel resize Pin
Luc Pattyn15-Jul-08 17:32
sitebuilderLuc Pattyn15-Jul-08 17:32 
Questiontreeview problem Pin
Member 226047315-Jul-08 10:31
Member 226047315-Jul-08 10:31 
AnswerRe: treeview problem Pin
Mr.PoorEnglish15-Jul-08 11:01
Mr.PoorEnglish15-Jul-08 11:01 

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.