Questions tagged [stretchblt]

The StretchBlt function copies a bitmap from a source rectangle into a destination rectangle, stretching or compressing the bitmap to fit the dimensions of the destination rectangle, if necessary. The system stretches or compresses the bitmap according to the stretching mode currently set in the destination device context.

18 questions
25
votes
4 answers

Memory corruption in System.Move due to changed 8087CW mode (png + stretchblt)

I have strange a memory corruption problem. After many hours debugging and trying I think I found something. For example: I do a simple string assignment: sTest := 'SET LOCK_TIMEOUT '; However, the result sometimes becomes: sTest = 'SET…
André
  • 8,920
  • 1
  • 24
  • 24
5
votes
1 answer

StretchBlt is too slow, anyway faster?

I'm using StretchBlt to draw a resized real-time video. ::SetStretchBltMode(hDC, HALFTONE); ::StretchBlt(hDc, 0, 0, 1225, 689, hwNd, 0, 0, 1364, 768, SRCCOPY); However, the StretchBlt api is too slow. It's take about 100ms on my computer…
LeDuc
  • 245
  • 2
  • 9
4
votes
2 answers

StretchBlt Shrink Corruption

I'm using Windows (both 7 & XP - both 32bit) and coding in C++ I am receiving bitmaps from an external source. These bitmaps are of a fixed resolution (384x288) After I receive a bitmap, I need to resize it based on a variable sized layout, so I'm…
Dave
  • 1,696
  • 4
  • 23
  • 47
3
votes
1 answer

Accurately mapping pixels scaled by Graphics.DrawImage

I have a Winforms application that uses Graphics.DrawImage to stretch and draw a bitmap, and I need help understanding precisely how the source pixels map to the destination. Ideally I want to write a function like: Point MapPixel(Point p, Size…
rkagerer
  • 4,157
  • 1
  • 26
  • 29
3
votes
1 answer

StretchBlt and filtering alpha channels

I am scaling an image down with StretchBlt(). http://img684.imageshack.us/img684/2152/stretchblt.png As you can see, it currently looks like I have to choose between quality filtering and transparency. Is there any way to get both? This is the only…
Artfunkel
  • 1,832
  • 17
  • 23
3
votes
0 answers

Strange behaviour of BitBlt for a second monitor that is not being set as primary

I capture images using BitBlt / StretchBlt API's on windows 10, depending upon the necessity for scaling the screen or not. Whenever I capture the 2nd monitor that is not being configured as primary, there seems to be a strange behaviour that the…
iamrameshkumar
  • 1,328
  • 1
  • 14
  • 34
2
votes
1 answer

Images not printing after the latest security update

My application fails to print after the latest security update. None of the API calls fail, yet the images don't show even in PDF. Text and shapes like lines print fine. The code loads a JPG image using IPicture interface and OleLoadPicture(). Then…
IgorD
  • 155
  • 1
  • 8
2
votes
0 answers

HBITMAP StretchBlt caused image saturation

I used the following code to resize win32 HBITMAP. HBITMAP ResizeBitmap(HDC hDC, HBITMAP source) { HDC hMemDC2 = CreateCompatibleDC(hDC); HGDIOBJ hOld2 = SelectObject(hMemDC2, source); BITMAP bitmap = { 0 }; GetObject(hBitmap,…
fireman
  • 193
  • 8
2
votes
0 answers

StretchBlt only works when nHeightDest is negative

I'm trying to use StretchBlt in order to copy pixels from a memory hdc to the window hdc. The memory hdc gets the image from an invisible window which renders a stream using openGL. Here's my code: BITMAPINFOHEADER createBitmapHeader(int width, int…
Nitzan Tomer
  • 155,636
  • 47
  • 315
  • 299
2
votes
1 answer

StretchBlt giving monochrome bitmap as output

I m writing code for scaling down the image in VC++. When i save destination bitmap it gives monochrome image. Code: int iNewWidth = 400; int iNewHeight = 500; CImage image; HRESULT rs=image.Load(_T("E:\\input.jpg")); int a=10; CDC destDC; int…
Shashank
  • 97
  • 1
  • 4
2
votes
1 answer

StretchBlt() doesn't create a mirror image

According to MSDN: StretchBlt creates a mirror image of a bitmap if the signs of the nWidthSrc and nWidthDest parameters or if the nHeightSrc and nHeightDest parameters differ. So I tried creating upside-down image. I have a class looking like…
PookyFan
  • 785
  • 1
  • 8
  • 23
1
vote
1 answer

StretchBlt fails

I have a COM component. This COM components shows an image on the screen. The image bits are copied through a buffer like this: IplImage iplimage = image; IplImage *img2 = cvCreateImage(cvGetSize(&iplimage), …
Vitor Py
  • 5,145
  • 4
  • 39
  • 62
0
votes
1 answer

Why is my stretchblt images losing colours?

I am having some difficulties in correctly populating a CListCtrl with thumbnails of monitor displays. On the right of my CDialog I have a static control and I render the image on a white canvas like this: void…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
1 answer

Viewing a bitmap in a fixed space in mfc

I am trying to design an application that loads bitmap images. I have bitmaps of varying sizes but I want them to be displayed on a constant space ( like a rectangle of size 500x500). I've tried StretchBlt() in the following way but the results are…
Justin M
  • 29
  • 3
0
votes
2 answers

The correct method for drawing a bitmap image into a window

I have a function which takes a rectangular region of a bitmap image, rescales it to different dimensions, and draws it at some offset inside of a window within my dialog-box application: void DrawImage(HANDLE hImageBitmap, CDC*…
goodvibration
  • 5,980
  • 4
  • 28
  • 61
1
2