Click here to Skip to main content
15,912,400 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
Questionneed help with generics - multi key lookup Pin
Kalyan_A27-Feb-10 2:29
professionalKalyan_A27-Feb-10 2:29 
AnswerRe: need help with generics - multi key lookup Pin
Luc Pattyn27-Feb-10 2:36
sitebuilderLuc Pattyn27-Feb-10 2:36 
GeneralRe: need help with generics - multi key lookup Pin
Kalyan_A27-Feb-10 3:23
professionalKalyan_A27-Feb-10 3:23 
AnswerRe: need help with generics - multi key lookup Pin
Luc Pattyn27-Feb-10 4:04
sitebuilderLuc Pattyn27-Feb-10 4:04 
QuestionCreating Bitmap from MemoryStream Pin
xry200626-Feb-10 13:14
xry200626-Feb-10 13:14 
AnswerRe: Creating Bitmap from MemoryStream Pin
The Man from U.N.C.L.E.2-Mar-10 7:15
The Man from U.N.C.L.E.2-Mar-10 7:15 
GeneralRe: Creating Bitmap from MemoryStream Pin
xry20063-Mar-10 1:39
xry20063-Mar-10 1:39 
GeneralRe: Creating Bitmap from MemoryStream Pin
The Man from U.N.C.L.E.3-Mar-10 3:02
The Man from U.N.C.L.E.3-Mar-10 3:02 
Here is a direct translation of your c# code, done by SharpDevelop.

Could you try it out. Could be something you missed in translation, though I couldn't spot it.

VB
Private Function GetImage(position As Long, size As Integer) As Image
    Dim string1 As String
    Dim byteArray1 As Byte()
    Dim bitmap1 As Bitmap
    Dim stream1 As Stream = DirectCast(Nothing, Stream)
    Dim binaryReader1 As BinaryReader = DirectCast(Nothing, BinaryReader)
    Dim memoryStream1 As MemoryStream = DirectCast(Nothing, MemoryStream)
    Try
        string1 = String.Format("{0}gallery{1:D2}.enc", Session.RootPath, Me.index)
        stream1 = DirectCast(File.OpenRead(string1), Stream)
        binaryReader1 = New BinaryReader(stream1, Encoding.ASCII)
        Dim int64_1 As Long = binaryReader1.BaseStream.Seek(position, SeekOrigin.Begin)
        byteArray1 = binaryReader1.ReadBytes(size)
        Me.ColorBalance(byteArray1)
        memoryStream1 = New MemoryStream(byteArray1)
        Try
            bitmap1 = New Bitmap(DirectCast(memoryStream1, Stream))
        Catch
            bitmap1 = New Bitmap(64, 64)
        End Try
    Finally
        If memoryStream1 IsNot Nothing Then
            memoryStream1.Close()
            memoryStream1 = DirectCast(Nothing, MemoryStream)
        End If
        If binaryReader1 IsNot Nothing Then
            binaryReader1.Close()
            binaryReader1 = DirectCast(Nothing, BinaryReader)
        End If
        If stream1 IsNot Nothing Then
            stream1.Close()
            stream1 = DirectCast(Nothing, Stream)
        End If
    End Try
    Return bitmap1
End Function
If you have knowledge, let others light their candles at it.
Margaret Fuller (1810 - 1850)
[My Articles]  [My Website]

QuestionTimer reset Pin
Bob Beaubien26-Feb-10 11:57
Bob Beaubien26-Feb-10 11:57 
Answerclue Pin
Luc Pattyn26-Feb-10 12:23
sitebuilderLuc Pattyn26-Feb-10 12:23 
GeneralRe: clue Pin
Bob Beaubien26-Feb-10 12:34
Bob Beaubien26-Feb-10 12:34 
GeneralRe: clue Pin
Bob Beaubien26-Feb-10 12:40
Bob Beaubien26-Feb-10 12:40 
GeneralRe: clue Pin
Luc Pattyn26-Feb-10 13:13
sitebuilderLuc Pattyn26-Feb-10 13:13 
QuestionCode problem or exceeded array limits? Pin
Hurricane300026-Feb-10 5:15
Hurricane300026-Feb-10 5:15 
AnswerRe: Code problem or exceeded array limits? Pin
Luc Pattyn26-Feb-10 7:09
sitebuilderLuc Pattyn26-Feb-10 7:09 
AnswerRe: Code problem or exceeded array limits? Pin
Gideon Engelberth26-Feb-10 7:56
Gideon Engelberth26-Feb-10 7:56 
GeneralRe: Code problem or exceeded array limits? Pin
Hurricane300026-Feb-10 9:39
Hurricane300026-Feb-10 9:39 
QuestionExit on Keyboard button Pin
Bob Beaubien25-Feb-10 15:54
Bob Beaubien25-Feb-10 15:54 
AnswerRe: Exit on Keyboard button Pin
Dr.Walt Fair, PE25-Feb-10 17:00
professionalDr.Walt Fair, PE25-Feb-10 17:00 
GeneralRe: Exit on Keyboard button Pin
Bob Beaubien25-Feb-10 17:17
Bob Beaubien25-Feb-10 17:17 
QuestionShortcut Keys [solved] Pin
Mehdi Ghiasi24-Feb-10 23:20
Mehdi Ghiasi24-Feb-10 23:20 
AnswerRe: Shortcut Keys Pin
Nuri Ismail24-Feb-10 23:31
Nuri Ismail24-Feb-10 23:31 
GeneralRe: Shortcut Keys Pin
Mehdi Ghiasi24-Feb-10 23:44
Mehdi Ghiasi24-Feb-10 23:44 
GeneralRe: Shortcut Keys Pin
Nuri Ismail24-Feb-10 23:46
Nuri Ismail24-Feb-10 23:46 
QuestionHow can I programatically select video source using WebCam_Capture.dll PinPopular
M Wyatt24-Feb-10 13:53
M Wyatt24-Feb-10 13:53 

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.