Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ERROR: AV's and IWButton.picture.data: the parameter is incorrect
#22
I have an IW app which is a map tile server that creates tiles (via bitmap then to png) if they do not already exist using threads.  UserSession thread should be equivalent in your case.

Below is a sample locking / unlocking a bitmap while editing and should eliminate collisions. 

Code:
try {
  try {

    ...
    if(!bmp->Canvas->TryLock()) { LogError("BMP TryLock failed."); return; }
    ...
    //SAMPLE BMP MANIPULATION
    ...
    bmp->Canvas->CopyMode = cmSrcCopy;
    bmp->Canvas->CopyRect(Types::TRect(0,0,IDIM,IDIM),bmp_odim->Canvas,Types::TRect((ODIM-IDIM)/2,(ODIM-IDIM)/2,((ODIM-IDIM)/2)+IDIM,((ODIM-IDIM)/2)+IDIM));
    //END SAMPLE
    ...

  } catch (Exception &e) {
    LogError("RenderToCanvas:  "+e.Message);
  }
} __finally {
  if(bmp->Canvas->LockCount) bmp->Canvas->Unlock();
}


Regards,
Mark
Reply


Messages In This Thread
RE: ERROR: AV's and IWButton.picture.data: the parameter is incorrect - by MJS@mjs.us - 02-09-2020, 04:53 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)