image - VB.Net Create a ImageGenerator process -


i want know how can make process..

im doing this:

        timecount = 0         timer.start()         dim count integer = 1, next boolean         each datarow datarow in database.rows             nextimage = false             while nextimage = false                 try                     dim ext string = ".png"                     if rbjpg.checked = true ext = ".jpg"                     generateimage(datarow, imagefrom, fbd.selectedpath, ext, count)                     nextimage = true                 catch ex exception                     timer.stop()                     dim result dialogresult = messagebox.show(ex.message, "error", messageboxbuttons.abortretryignore, messageboxicon.error)                     if result = windows.forms.dialogresult.ignore                         timer.start()                         nextimage = true                     elseif result = windows.forms.dialogresult.retry                         timer.start()                         nextimage = false                     elseif result = windows.forms.dialogresult.abort                         prggenerate.value = 0                         exit                     end if                 end try             loop             count += 1             prggenerate.increment(1)         next 

but colapse program , uses lot of ram.

i cant show nothing during process, example: elapsed time. , timer never start.

sorry bad english.

it's not clear me how you're setting imagefrom variable, here's simple example using backgroundworker():

private sub backgroundworker1_dowork(sender object, e system.componentmodel.doworkeventargs) handles backgroundworker1.dowork     timecount = 0     me.invoke(sub()                   timer.start()               end sub)     dim count integer = 1, nextimage boolean     each datarow datarow in database.rows         nextimage = false         while nextimage = false             try                 dim ext string = ".png"                 if rbjpg.checked = true ext = ".jpg"                 generateimage(datarow, imagefrom, fbd.selectedpath, ext, count)                 nextimage = true             catch ex exception                 me.invoke(sub()                               timer.stop()                               dim result dialogresult = messagebox.show(ex.message, "error", messageboxbuttons.abortretryignore, messageboxicon.error)                               if result = windows.forms.dialogresult.ignore                                   timer.start()                                   nextimage = true                               elseif result = windows.forms.dialogresult.retry                                   timer.start()                                   nextimage = false                               elseif result = windows.forms.dialogresult.abort                                   prggenerate.value = 0                                   exit                               end if                           end sub)             end try         loop         count += 1         me.invoke(sub()                       prggenerate.increment(1)                   end sub)     next end sub  private sub backgroundworker1_runworkercompleted(sender object, e runworkercompletedeventargs) handles backgroundworker1.runworkercompleted     messagebox.show("done!") end sub 

you'd start background thread with:

backgroundworker1.runworkerasync() 

Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -