Click here to Skip to main content
15,890,882 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: URGENT HELP NEEDED : DB2 Connection failed in Visual Basic 6.0 Pin
Senthilkumar E11-Mar-14 4:08
Senthilkumar E11-Mar-14 4:08 
QuestionRe: URGENT HELP NEEDED : DB2 Connection failed in Visual Basic 6.0 Pin
Eddy Vluggen12-Mar-14 1:28
professionalEddy Vluggen12-Mar-14 1:28 
AnswerRe: URGENT HELP NEEDED : DB2 Connection failed in Visual Basic 6.0 Pin
Dave Kreskowiak11-Mar-14 4:51
mveDave Kreskowiak11-Mar-14 4:51 
QuestionHow to exempt a text box from being filled Pin
Diepriye10-Mar-14 7:42
Diepriye10-Mar-14 7:42 
AnswerRe: How to exempt a text box from being filled Pin
Richard MacCutchan10-Mar-14 7:49
mveRichard MacCutchan10-Mar-14 7:49 
GeneralRe: How to exempt a text box from being filled Pin
Diepriye10-Mar-14 7:54
Diepriye10-Mar-14 7:54 
GeneralRe: How to exempt a text box from being filled Pin
Richard MacCutchan10-Mar-14 8:02
mveRichard MacCutchan10-Mar-14 8:02 
QuestionConverting Canvas Element to image Pin
Vinay Sakpal10-Mar-14 1:36
professionalVinay Sakpal10-Mar-14 1:36 
Hi Guyz,

I am developing windows metro apps using vb.net and XAML.

I need to convert canvas element which contains ink strokes on it.

I am using the below code :















<canvas x:name="CollectionSignature" height="120" width="350" background="White" margin="0" horizontalalignment="Left">





Vb.Net code :

Public Shared Async Function GetSignatureImageString(oElement As Canvas) As Task(Of String)
Try



Dim o As New RenderTargetBitmap
Await o.RenderAsync(oElement, Convert.ToInt32(oElement.Width), Convert.ToInt32(oElement.Height))
Dim aryData = Await o.GetPixelsAsync()

Dim logicaldpi = DisplayInformation.GetForCurrentView().LogicalDpi

Dim oStorageFile As StorageFile = Await ApplicationData.Current.TemporaryFolder.CreateFileAsync(oElement.Name + ".png", CreationCollisionOption.ReplaceExisting)
Dim oStream As IRandomAccessStream = Await oStorageFile.OpenAsync(FileAccessMode.ReadWrite)
Dim oEncoder As BitmapEncoder = Await BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, oStream)
oEncoder.SetPixelData(BitmapPixelFormat.Bgra8, BitmapAlphaMode.Ignore, Convert.ToInt16(oElement.Width), Convert.ToInt16(oElement.Height), logicaldpi, logicaldpi, aryData.ToArray())
Await oEncoder.FlushAsync()

Dim oBuffer As IBuffer = Await FileIO.ReadBufferAsync(oStorageFile)
Dim aryData1 As Byte() = oBuffer.ToArray()

oStream.Dispose()
oEncoder = Nothing
oStorageFile = Nothing
aryData = Nothing
o = Nothing

Return Convert.ToBase64String(aryData1)
Catch ex As Exception

End Try
End Function


I am getting 'Value does not false within expected range' on 'o.renderasync' method.

Can you please help?

Thanks,

Vinay
AnswerRe: Converting Canvas Element to image Pin
Richard MacCutchan10-Mar-14 1:55
mveRichard MacCutchan10-Mar-14 1:55 
QuestionAsk | Visual Basic 6.0 | How to transfer datagridview values to a listview. Please help me. Pin
Member 106548088-Mar-14 17:54
Member 106548088-Mar-14 17:54 
AnswerRe: Ask | Visual Basic 6.0 | How to transfer datagridview values to a listview. Please help me. Pin
Richard MacCutchan8-Mar-14 22:26
mveRichard MacCutchan8-Mar-14 22:26 
AnswerRe: Ask | Visual Basic 6.0 | How to transfer datagridview values to a listview. Please help me. Pin
Eddy Vluggen9-Mar-14 2:22
professionalEddy Vluggen9-Mar-14 2:22 
Questionhow to register mobile no in http://email2sms.netcore.co.in/ Pin
Virendra Singh Bhanu8-Mar-14 1:42
Virendra Singh Bhanu8-Mar-14 1:42 
AnswerRe: how to register mobile no in http://email2sms.netcore.co.in/ Pin
OriginalGriff8-Mar-14 2:05
mveOriginalGriff8-Mar-14 2:05 
AnswerRe: how to register mobile no in http://email2sms.netcore.co.in/ Pin
sudipb3-Jan-17 19:44
sudipb3-Jan-17 19:44 
QuestionVBA - Connection to Sybase via JDBC/Java connection Pin
MyOwnBoss7-Mar-14 10:02
MyOwnBoss7-Mar-14 10:02 
QuestionRe: VBA - Connection to Sybase via JDBC/Java connection Pin
Richard MacCutchan7-Mar-14 22:40
mveRichard MacCutchan7-Mar-14 22:40 
QuestionIs it possible to pass a collection by reference from vb6 to vb.net? Pin
sashaw26-Mar-14 11:05
sashaw26-Mar-14 11:05 
QuestionRe: Is it possible to pass a collection by reference from vb6 to vb.net? Pin
Richard Deeming7-Mar-14 0:02
mveRichard Deeming7-Mar-14 0:02 
AnswerRe: Is it possible to pass a collection by reference from vb6 to vb.net? Pin
sashaw27-Mar-14 3:13
sashaw27-Mar-14 3:13 
GeneralRe: Is it possible to pass a collection by reference from vb6 to vb.net? Pin
Dave Kreskowiak7-Mar-14 4:00
mveDave Kreskowiak7-Mar-14 4:00 
GeneralRe: Is it possible to pass a collection by reference from vb6 to vb.net? Pin
sashaw27-Mar-14 6:58
sashaw27-Mar-14 6:58 
AnswerRe: Is it possible to pass a collection by reference from vb6 to vb.net? Pin
Eddy Vluggen7-Mar-14 0:30
professionalEddy Vluggen7-Mar-14 0:30 
QuestionPre-load libraries Pin
alejx6-Mar-14 7:11
alejx6-Mar-14 7:11 
AnswerRe: Pre-load libraries Pin
Dave Kreskowiak6-Mar-14 10:33
mveDave Kreskowiak6-Mar-14 10:33 

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.