• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

Image Processing without using Temporary Files

From Visual Basic, I currrently call some routines in a C dll that does all of my image processing.  Currently, what I do is I use temporary files, to make this happen.  I pass the PictureBox's handle and the temporary file to the C routine.  The C routine, takes the handle, does some image processing to it, and then writes it out to the temporary file.  In visual basic, I then load the temporary file to the Picture box and then delete the temporary file.  I am wondering if its possible for me to do something similar to this without using a temporary file, as the performance might be better.

Below is a synopsis of what what I do:
In VB:

Dim tempRawFile As String
tempRawFile = GetTempFileName()
DLLFile.C_Routine Picture1.Handle, tempRawFile
Picture1 = LoadPicture(tempRawFile)

In C this is what I do:
int CALLINGCONV C_Routine(HBITMAP fromHBMP,char *rawFileName) {

// I do something to fromHBMP then I write it out to rawFileName
// I then return OK

1 Solution
Have you tried a Picture1.Refresh?  Might work best if AutoRedraw = True  That way the picture box will use the hidden memory bitmap to repaint the picture box.

Picture1.AutoRedraw = True
... set picture property
DLLFile.C_Routine Picture1.Handle
Picture1.Refresh  'force redraw based on memory bitmap


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now