News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

trebleclef

Started by shankle, October 11, 2007, 09:30:07 PM

Previous topic - Next topic

shankle

I have coded a reasonably decent looking trebleclef. It uses about 11,000 pixels to make it a decent size on the new PRINTERS and it overlays the staff lines without wiping them out . If I put it in a program and execute it a dozen times I can go to a movie and come back and it still won't be finished. This is totally unexceptable. I don't think I can create bitmaps or load it to memory as the codeing was quite difficult and large on paper.

Here is what I would like to do and wonder if it is feasible:
Make a separate program just to compile the trebleclef for a location and somehow include
the COMPILED result in the main program. 4 of these separate programs with different y axis would suffice and make the printing very fast as it would already be done.
Thanks for your advice,
JPS
The greatest crime in my country is our Congress

MichaelW

If you have code that can draw the treble clef, why not draw it once and then save it as a bitmap?
eschew obfuscation

Tedd

What's wrong with using this: http://www.masm32.com/board/index.php?topic=7898.msg57907#msg57907 ? It's pretty much instantaneous, fully scalable, and a lot less effort.
To avoid erasing the staff lines you can call SetBkMode(hDC,TRANSPARENT), or even draw the clef first and then the lines over it (if it's all in black the result is the same.)
Though yes, you do need the font. Alternatively, I suppose you could draw a fairly large bitmap version once and save that in the resources, then scale it down to whatever size you want and do a transparent blit - not sure how nice it will look after scaling without some smoothing applied, and the size of the stored bitmap is likely to be close to the size of the font anyway.
No snowflake in an avalanche feels responsible.

shankle

Where can I find Iczelions tut 25? I understand it's about generating bitmaps.
I downloaded Iczelions tutes from Hutches site but they stop at tut 24.

Tedd - I tried to find the Treble Clef in the music module with no luck.
I'm thinking of creating a bitmap and moving my paper generated image
to the bitmap. All I need is a white background and black characters, save
the image somehow and use it to place the TC any where on a printed
page that I need it. In the past I have created small bitmaps with MSN
Paint but this is going to be quite a challenge for me.
The greatest crime in my country is our Congress

shankle

Here is what I have come up with so far:

.data?
hdcMem      HDC       ?
hBitmap      HDC       ?

        invoke CreateCompatibleDC, hdc
        mov hdcMem, eax
        invoke CreateCompatibleBitmap, hdcMem,152,528
        mov hBitmap, eax
        invoke SelectObject, hdcMem,hBitmap
        invoke PatBlt,hBitmap,0,0,152,527,WHITENESS ; clear memory to white
        invoke PatBlt,hBitmap,0,528,30,1,BLACKNESS ; black pattern for bitblt
        invoke BitBlt,hBitmap,8ah,1,5,1,hBitmap,0,528,BLACKNESS ; build the image from array     
;          db     8ah,8bh,8ch,8dh,8eh,0h
      ; hundreds of build image lines here
      ; next write memory bitmap to a file.bmp

Not sure if I got the handles right for the various macros.
Also how do I write the memory bitmap to a *.bmp file?

Would appreciate comments.
Thanks,
jps
The greatest crime in my country is our Congress

MichaelW

Tutorial 25 should be available here.
eschew obfuscation