Skip to content

Instantly share code, notes, and snippets.

@redj
Created February 16, 2019 03:16
Show Gist options
  • Save redj/5cbc36dc453c4f737aaf6a3c599ad271 to your computer and use it in GitHub Desktop.
Save redj/5cbc36dc453c4f737aaf6a3c599ad271 to your computer and use it in GitHub Desktop.
picMutex.Release();
#if defined(USE_IMAGE_READER)
if(bitmap)
{
#if defined(USE_IMAGE_READER)
Size imgSize = { bitmap.width, bitmap.height };
#else
Size imgSize = { width, height };
#endif
// surface.Stretch(bitmap, 0,0, 0,0, size.w, size.h, bitmap.width, bitmap.height);
float sx = 0, sy = 0, sw = imgSize.w, sh = imgSize.h;
float dx = 0, dy = 0, w = size.w, h = size.h;
Pointf texCoords[4] =
{
{ (sx) / imgSize.w, (sy) / imgSize.h },
{ (sx+sw)/ imgSize.w, (sy) / imgSize.h },
{ (sx+sw)/ imgSize.w, (sy+sh)/ imgSize.h },
{ (sx) / imgSize.w, (sy+sh)/ imgSize.h }
};
int i = 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment