News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Recent posts

#81
The Workshop / Re: A useful tool: BMP data vi...
Last post by Biterider - November 22, 2024, 05:00:29 AM
Hi
This is a good idea, sinsi!
During this time you can also set the cursor to IDC_WAIT.
Alternatively, a spinner would be a nice addition.

Biterider
#82
The Workshop / Re: A useful tool: BMP data vi...
Last post by sinsi - November 22, 2024, 04:15:12 AM
A slight speed up
;before you start writing the bitmap
    invoke SendMessage,ResultsDispHandle,WM_SETREDRAW,0,0
;when you exit
    invoke SendMessage,ResultsDispHandle,WM_SETREDRAW,1,0
    invoke RedrawWindow,ResultsDispHandle,0,0,RDW_ERASE or RDW_FRAME or RDW_INVALIDATE or RDW_ALLCHILDREN
#83
The Workshop / Re: A useful tool: BMP data vi...
Last post by sinsi - November 22, 2024, 04:00:46 AM
Buffer wasn't big enough
TheDialogProc PROC hWin:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
local bmpfilesize:DWORD   ;<<<added
;...
; Read bitmap header:
INVOKE CreateFile, ADDR fileOpenName, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL
MOV bmpFileHandle, EAX

    invoke GetFileSize,eax,0 ;<<<added
    mov bmpfilesize,eax      ;<<<added
   
INVOKE HeapAlloc, HeapHandle, 0, eax ;<<<moved from above and changed
MOV FileBuffer, EAX               ;<<<moved from above

INVOKE ReadFile, bmpFileHandle, FileBuffer, bmpfilesize, ADDR bytesRead, NULL ;<<<added bmpfilesize

BITMAPFILEHEADER partly wrong
bfOffBits DD ? ;Offset to bitmap data in file (from end of this structure)
;incorrect, it's the offset from the header start


It sure takes a long time to show the bitmap bits.
#84
The Workshop / Re: A useful tool: BMP data vi...
Last post by zedd151 - November 22, 2024, 03:36:30 AM
With the checkbox checked, and while the text is scrolling, if any user interaction with the window - the program becomes unresponsive, cannot move or minimize the window, plus the dreaded 'busy' cursor pop up.

Also for larger 24 bit bitmaps, displayed bitmap size = 0. Which obviously is wrong.
For larger indexed images, program crashes.

I will run some more tests in a little while, and possibly attach any other bitmaps that cause wrong results. (Via PostImage) I have to test first if the posted image is exactly what I had uploaded (including the bitmap headers) Not sure if PostImage does any manipulation of the uploaded files, or not...


Later:  It seems that PostImage converts the bitmap to .png image.  :sad:
I'll try to zip it, if I can get it small enough to attach here.

Two (zipped seperately) images attached. "2.bmp" uses 24 bit color and displayed "bitmap size = 0", "4.bmp" uses 256 colors and the program crashes.
#85
The Workshop / Re: A useful tool: BMP data vi...
Last post by sinsi - November 22, 2024, 01:44:09 AM
(42c4.d08): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
*** WARNING: Unable to verify checksum for BMPinfo2.exe
eax=00000030 ebx=02bd0020 ecx=00000003 edx=00000001 esi=02cd0ffd edi=00cff000
eip=00262cac esp=00cfefc8 ebp=00cff0e8 iopl=0         nv up ei pl nz ac pe nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210216
BMPinfo2!ShowBitmapData+0x2ff:
00262cac ad              lods    dword ptr [esi]      ds:002b:02cd0ffd=????????
Bitmap is 1107x711x24bpp (2,363,418 bytes)

Your info
Info for file "Untitled.bmp":

BMP width: 1107
BMP height: 711
no. planes: 1
bits/pixel: 24
bitmap size: 2363364 bytes
compression: 0
horiz. res: 3778
vert. res: 3778
# colors used: 0
Bitmap stride: 3324 bytes
Bitmap padding: 3 byte(s)

--- BMP has no palette ---
#86
The Laboratory / Re: Holey Window
Last post by NoCforMe - November 21, 2024, 11:01:41 AM
En inglese, por favor:

QuoteClass cursor identifier. This member must be an identifier for a cursor resource. If this member is NULL, an application must explicitly set the shape of the cursor each time the mouse is moved to the application window.
#87
The Workshop / Re: A useful tool: BMP data vi...
Last post by NoCforMe - November 21, 2024, 05:31:06 AM
Whoops, sorry: one of my buffers wasn't quite big enough, and when I tested it with a larger BMP ...

New version (that won't stall) attached.
#88
The Laboratory / Re: Holey Window
Last post by HSE - November 21, 2024, 04:58:59 AM
QuoteTipo: HCURSOR

Identificador del cursor de clase. Este miembro debe ser un identificador para un recurso de cursor. Si este miembro es NULL, una aplicación debe establecer explícitamente la forma del cursor cada vez que el mouse se mueve a la ventana de la aplicación.
#89
The Workshop / A useful tool: BMP data viewer
Last post by NoCforMe - November 20, 2024, 06:32:00 PM
Finally finished my BMP data viewer and tested it: seems to work fine with all possible BMP formats. This program is the reason I posted about aligning data to 32-bit boundaries, since all BMP bitmap data must be aligned so.

Check it out. It displays all the data in the BMP header, shows the bitmap bits, and shows the palette for those files (4- and 8-bits per pixel) that have a palette. Plus a few more bits of info: the stride and bitmap padding, whether the file has alpha-channel data (32bpp files only), and the number of unique colors in the bitmap for paletted files.

Let me know of any problems, suggestions, etc. If you don't want to wait for all that data to scroll by, uncheck the "Show bitmap data" checkbox. The info displays in an edit control so you can copy the data from it.

Fixed version attached to reply #1 below.
#90
The Laboratory / Re: Holey Window
Last post by NoCforMe - November 20, 2024, 02:02:42 PM
Wait a sec: now I'm not so sure about this.

Why would not having a default cursor defined for a window cause the busy cursor to appear? Wouldn't it default to the regular old arrow? Or would registering the class with a NULL cursor cause Windows to show busy when you don't set a cursor like it's expecting you to? (Which tells me that in that case the busy cursor IS the default cursor.)

What else could cause the busy cursor? Could it be that no window is currently selected, or activated, or whatever? Does the cursor change if you click on the window to select it?

Of course the fact that setting a default cursor for the window class made the busy cursor go away does point to that being the cause of the problem, but is that really the case?