bitblt

BitBlt Performance

I have a function that splits a multipage tiff into single pages and it uses the windows BitBlt function. In terms of performance, would the video card have any influence in doing the split? Would it be worth using a straight C/C++ library instead? ...

How to correctly screencapture a specific window on Aero/DWM

Background info: I have this MFC application I coded and been using for a long time that pretty much automatically saves screenshots to the hard disk when the user hits the Print Screen/Alt+Print Screen key. I have been putting off using anything related to Aero until now that I've been using Windows 7 RC for a couple of weeks. The pro...

Cursor disappears on bitblt

I have a windows application that scrapes pixels from the screen for recording (in the form of a video) to a custom screen-sharing format. The problem is that on machines using a software cursor, blitting from the screen with SRCCOPY|CAPTUREBLIT (so that layered windows also show up in the image) causes the cursor to blink, as described...

Custom Controls via BitBlt / Alphablend Functions --- Help I'm confused

Platform: Windows Mobile 6 Classic / .NET CF 3.5 Problem: Custom Controls, that display alphablended images do not behave well with images on Parent control. Also, hidding and show such controls induces flicker when parent has many images to redraw. More Details: A custom button Control that displays an image with transparencies. I us...

Bitblt blackness

I am running this following code, HDC hdc; HDC hdcMem; HBITMAP bitmap; RECT c; GetClientRect(viewHandle, &c); // instead of BeginPaint use GetDC or GetWindowDC hdc = GetDC(viewHandle); hdcMem = CreateCompatibleDC(hdc); // always create the bitmap for the memdc from the window dc bitmap = CreateCompatibleBitmap(hdc,c.right-c.left,200);...

Converting from HBITMAP to Jpeg or Png in C++

Does anyone know how I can use an HBITMAP variable to write a png or jpeg file? I first looked into doing this with GDI+ but it gives me errors telling me min/max haven't been defined (defining them just brings more problems), I then looked into libpng's C++ bindings (png++) and couldn't get the examples to compile. thanks, Mikey ...

BitBlt() equivalent in Objective-C/Cocoa

I made a scrolling tile 2D video game in visual basic a few years back. I am translating it to Cocoa for the Mac. Is there a framework that would allow me to use BitBlt? Or is there an equivalent to BitBlt without using OpenGL? Thanks! ...

How to use Win32's BitBlt using Ruby?

Does anyone know how to use Win32's BitBlt() using Ruby? It seems like you need to use a destination DC (device context) and how can Ruby handle that? I use GetPixel() and it is really slow even to get 100 pixels (takes about 10 seconds). thanks. ...

C# Bitblit from Bitmap to control (Compact Framework)

Hi everybody! I used once BitBlt to save a screenshot to an image file (.Net Compact Framework V3.5, Windows Mobile 2003 and later). Worked fine. Now I want to draw a bitmap to a form. I could use this.CreateGraphics().DrawImage(mybitmap, 0, 0), but I was wondering if it would work with BitBlt like before and just swap the params. So I ...

BitBlt code not working

I'm trying to use this code to draw a Bitmap directly onto a PictureBox: Bitmap bmp = (Bitmap)Bitmap.FromFile(@"C:\Users\Ken\Desktop\Load2.bmp"); Graphics grDest = Graphics.FromHwnd(pictureBox1.Handle); Graphics grSrc = Graphics.FromImage(bmp); IntPtr hdcDest = grDest.GetHdc(); IntPtr hdcSrc = grSrc.GetHdc(); BitBlt(hdcDest, 0, 0, pictu...

2D Engine scrolling on OpenGL via hardware?

hi, I'm using OpenGL as the bottom end for a 2D tiling engine. When everything is 2D, it is simple to optimize certain issues. For example, scrolling. If I know a certain section of the screen needs to scroll off the bottom, then I can just blit over that portion. I'm evening moving more than 1 pixel at a time. Without explicit hardware...

Win32 window capture with BitBlt not displaying border

I have written some c++ code to capture a window to a .bmp file. BITMAPFILEHEADER get_bitmap_file_header(int width, int height) { BITMAPFILEHEADER hdr; memset(&hdr, 0, sizeof(BITMAPFILEHEADER)); hdr.bfType = ((WORD) ('M' << 8) | 'B'); // is always "BM" hdr.bfSize = 0;//sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (width *...

Copy Small Bitmaps on to Large Bitmap with Transparency Blend: What is faster than graphics.DrawImage(smallBitmap, x , y) ?

I have identified this call as a bottleneck in a high pressure function. graphics.DrawImage(smallBitmap, x , y); Is there a faster way to blend small semi transparent bitmaps into a larger semi transparent one? Example Usage: XY[] locations = GetLocs(); Bitmap[] bitmaps = GetBmps(); //small images sizes vary approx 30px x 30px...

How to clean up after myself when drawing directly to the screen

I'm drawing directly to the screen using BitBlt and GetDC(IntPtr.Zero). Is there some way to call Refresh or Invalidate on the whole screen when I'm done, so that I don't leave big chunks of paint everywhere (digitally speaking)? Update: when you draw directly to the screen like I'm doing, whatever you draw remains there until the win...

How to increase performance over GDI's DrawImage(Unscaled)?

In my user control's paint handler I iterate over a collection of predefined Bitmap objects and draw them to the client area thusly: C# version: private void Control_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; foreach (BitmapObj bmpObj in _bitmapObjCollection) { g.DrawImageUnscaled(bmpObj.Bitmap, b...

How to tweak the performance of Bit blit on Barco monitors?

Hi, The performance of bit blit on Small monitor(16 bpp,60Hz,1280X1024 resolution) it gives 0.9909ms. The performance of big monitors(8bpp,60hz,2048X5260) it gives 52.315ms . I use SRCCOPY to do the bit blit operation.how we can optimize the performance of bit blit on big monitor? Please share your thoughts. Thanks kk ...

SRCCOPY removes transparancy from BITBLITTED IMAGE

BitBlt(meteor.main, 0, 0, meteor.img_width, meteor.img_height, meteor.image, meteor.mask_x, meteor.mask_y, SRCAND); BitBlt(meteor.main, 0, 0, meteor.img_width, meteor.img_height, meteor.image, meteor.img_x, meteor.img_y, SRCPAINT); BitBlt(buffer, 0, 0, 800, 600, meteor.main, 0, 0, SRCCOPY); I know the first two bitblts make the tra...

WinAPI/GDI: why snapshot of large windows includes taskbar?

Hello people. I am using GDI+ to take window snapshot, the code is: CComBSTR bstrfname (fname); HDC hdc = CreateCompatibleDC (hDC); HBITMAP hbmp = CreateCompatibleBitmap (hDC, CFG_WIDTH, CFG_HEIGHT); HBITMAP hbmp0 = (HBITMAP)SelectObject (hdc, hbmp); BitBlt (hdc, 0, 0, CFG_WIDTH, CFG_HEIGHT, hDC, 0, 0, SRCCOPY); Gdiplus::Bitmap ...

BitBlt + UpdateLayeredWindow and CreateDIBSection in 16-bit desktop color depth

Hello there! I have an application with transparent background in client area which is drawn black because the window is not layered. In each of it's WM_PAINT messages I am doing a BitBlt to a memory-DC, after that I use the memory-DC with UpdateLayeredWindow to a layered canvas window. setup of memory-DC: HDC hdcMemory = CreateCompat...

BitBlt in Qt4 ?

What is the recommended method of copying one QImage into another at a particular position in Qt4? QImage::bitblt was removed in Qt4. Does the QImage now need to be converted to a PixMap and back? ...