Questions tagged [stretchdibits]

15 questions
6
votes
1 answer

StretchDIBits seems slow, Is there any API faster?

I want to draw a dib on to a HDC, the same size. I am using : des and src are of the same size. ::StretchDIBits(hdc, des.left,des.top,des.right - des.left,des.bottom - des.top, src.left, GetHeight() - src.bottom,…
user25749
  • 4,489
  • 13
  • 57
  • 83
3
votes
2 answers

How would I draw a PNG image using LoadImage and StretchDIBits?

(This is related to the question on How would I load a PNG image using Win32/GDI (no GDI+ if possible)?.) Hi all, I was wondering, given that you have a PNG resource embedded in a binary file with the ID IDB_PNG1, and an LPDRAWITEMSTRUCT to draw…
user541686
  • 189,354
  • 112
  • 476
  • 821
3
votes
1 answer

Windows StretchBlt API performance

I timed a DDB drawing operation which uses multiple StretchBlt and StretchDIBits calls. And I found that, time to complete is increase/decrease proportionally to the destination window size. With 900x600 window it takes around 5ms, but with…
9dan
  • 4,038
  • 2
  • 26
  • 42
2
votes
1 answer

StretchDIBits failed, sometimes it draw nothing,

I am using gdi c++, StretchDIBits function sometimes failed if I draw large Images such as 7000*5000. It draw nothing. GetLastError() says no enough system resource. Can anyone explain why StretchDIBits need resource even The DC is prepared…
user25749
  • 4,489
  • 13
  • 57
  • 83
2
votes
1 answer

StretchDIBits issue

I want to blit 32bit image (PNG with alpha channel) over 32bit Bitmap (or Bitmap32). I don't know how to tell function to blend image instead of bliting it. Like using AlphaBlend instead of BitBlt, I need to make this function to blend image instead…
Ivan Mark
  • 453
  • 1
  • 5
  • 16
1
vote
2 answers

Drawing On GDI+ Graphics Object a Bitmap using StretchDIBits for Scaling

I am drawing bitmap images on graphics object using DrawImage method But the Images are in large number so it is taking too much time for Drawing. I have read in this forum that using StretchDIBits takes less time for Drawing. I am scaling the…
VideoDev
  • 111
  • 2
  • 7
1
vote
1 answer

how to set GDI HDC's drawable region?

I want to draw a HBITMAP onto HDC, I used StretchDIBits. It works fine. ::StretchDIBits. however, I only want a window to watch the drawing result, beside the window, I wish the stretchDIBits do not take any effect(It can not draw on other area),…
user25749
  • 4,489
  • 13
  • 57
  • 83
1
vote
1 answer

StretchDIBits failing only at specific image dimensions

I'm using StretchDIBits to print an image and it is failing when the image is at certain sizes for some unknown reason. The image data is loaded into an unsigned int array from some some other image source in 24-bit BGR format. I've already verified…
Justin G
  • 716
  • 1
  • 8
  • 24
0
votes
1 answer

How to access original pixel in a view changed by StretchDIBits

A View in our legacy application is displaying an image using StretchDIBits. In case you are not familiar with StretchDIBits, it is used to display an image with given size to another size on MFC View. For example, an image of size (128,120) can be…
Tae-Sung Shin
  • 18,949
  • 31
  • 125
  • 230
0
votes
1 answer

MFC: How do you print a DI Bitmap to the printer?

I'm using MFC and trying to use OnPrint() to print the contents of a DI Bitmap. I know how to get my bitmap, I know of ::StretchDIBit to get to to a DC, but to do it, I need to know the paper size and want to say if normal bitmap size fits, just…
df234987
  • 413
  • 1
  • 9
0
votes
1 answer

Repainting image after going to full screen and back in C++/CLI

I'm building application, which paints raw bitmap images on label's hdc using StrechDIBits. ptr = g->GetHdc(); dc = (HDC)ptr.ToInt32 (); SetStretchBltMode (dc, COLORONCOLOR); StretchDIBits (dc, 0, 0, (int) (LabelPictureShow->Width), (int)…
Vladik
  • 1
  • 2
0
votes
1 answer

How to imitate shadow around the thumbnails by StretchDIBits?

I am now writing a image viewer, It is used for view thumbnails. As it is ugly, I decide to draw shadow round thumbnail. There is background color. I am using StretchDIBits to draw a shadow image at the location of thumbnail. However it is really…
user25749
  • 4,489
  • 13
  • 57
  • 83
0
votes
0 answers

Alternatives to StretchDIBits win32 API

I am using StretchDIBits function to draw four different Bitmap's pixeldata(DIBits) to different parts of a window. StretchDIBits immediately displays the copied bits in the window. I was wondering if there was a way to defer showing the copied…
thunderbird
  • 2,471
  • 4
  • 23
  • 49
0
votes
1 answer

DrawDib StretchDIBits which one is faster?

I've never used DrawDib APIs, My Application's UI rendering is based on stretchDIBits. Because there are really lots of large images to draw , the stretchDIBits's (HAFTONE is used to get better render result) performace is bad... I heard about …
user25749
  • 4,489
  • 13
  • 57
  • 83
0
votes
2 answers

Image shaking when StretchDIBits partially

I am using C++ GDI, StretchDIBits to draw images on DC. Because the original Image is large, and high quality is needed. I use HAFTONE mode, to draw whole image on DC(zoom the image) seems time comsuming. So I decide to draw partially using…
user25749
  • 4,489
  • 13
  • 57
  • 83