Re: CreateCompatibleBitmap Size limits?? I need LARGE bitmaps!
- From: WHoit <WHoit@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 8 Aug 2006 12:45:01 -0700
Hi Mike -
I've read your article (thanks) and I've been playing with ways to go beyond
the memory limitations I'm getting in CreateDIBSection.
I've tried using a mapped file, but CreateDIBSection still fails at the same
size as when I did not use a mapped file.
I'm just curious if you could try this code on your system and let me know
the results?
*************
Dim bi As BITMAPINFO
Dim hfile As Long
Dim HFILEMAP As Long
Dim fmapname As String
Dim lWidth as Long
Dim lHeight as Long
lWidth=13200
lHeight=10200
With bi.bmiHeader
.biBitCount = 32
.biPlanes = 1
.biCompression = BI_RGB
.biSize = Len(bi.bmiHeader)
.biWidth = lWidth
.biHeight = lHeight
.biSizeImage = (lWidth * .biBitCount) + &H1F
.biSizeImage = .biSizeImage And Not &H1F&
.biSizeImage = .biSizeImage \ &H8
.biSizeImage = .biSizeImage * .biHeight
End With
fmapname = "C:\junkfile"
If Dir(fmapname) <> vbNullString Then
Kill fmapname
End If
hfile = CreateFile(fmapname, GENERIC_READ Or GENERIC_WRITE, 0, 0,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)
HFILEMAP = CreateFileMapping(hfile, 0, PAGE_READWRITE, 0,
bi.bmiHeader.biSizeImage, "MyMapping")
compDC = CreateCompatibleDC(0)
mybitmap = CreateDIBSection(compDC, bi, DIB_RGB_COLORS, 0, HFILEMAP, 0)
'<-- Fails here
CloseHandle hfile
CloseHandle HFILEMAP
*************
"Mike D Sutton" wrote:
.Would you be kind enough to point me to a sample or provide one (vb6) ?
I need a DC and a bitmap to render to.
Have a look at the DIB article on my site, that should give you all the code and information you need.
You may also want to go through the DC and/or DDB articles if you want more of a background on GDI.
Hope this helps,
Mike
- Microsoft Visual Basic MVP -
E-Mail: EDais@xxxxxxxx
WWW: Http://EDais.mvps.org/
- Follow-Ups:
- Re: CreateCompatibleBitmap Size limits?? I need LARGE bitmaps!
- From: Mike D Sutton
- Re: CreateCompatibleBitmap Size limits?? I need LARGE bitmaps!
- References:
- Re: CreateCompatibleBitmap Size limits?? I need LARGE bitmaps!
- From: Mike D Sutton
- Re: CreateCompatibleBitmap Size limits?? I need LARGE bitmaps!
- Prev by Date: Getting Fonts from FNT Files ?
- Next by Date: Re: Getting Fonts from FNT Files ?
- Previous by thread: Re: CreateCompatibleBitmap Size limits?? I need LARGE bitmaps!
- Next by thread: Re: CreateCompatibleBitmap Size limits?? I need LARGE bitmaps!
- Index(es):
Relevant Pages
|