flat assembler
Message board for the users of flat assembler.
Index
> Windows > Code for visualization |
Author |
|
revolution 07 Apr 2014, 14:27
The first place to start is the MS documentation for each API
Then you can write it like this: Code: invoke GetDC mov [DC],eax ;save for later invoke SetDIBItsToDevice,[DC],0,0,[maxx],... |
|||
07 Apr 2014, 14:27 |
|
SeryZone 07 Apr 2014, 14:44
revolution wrote: The first place to start is the MS documentation for each API Thanks, but I have on Delphi variable MyBMInfo (BItmapInfo). How to get DC from BitMap info or BitMap? And, maybe, I must add this: Code:
extrn bmp ;BitMap
|
|||
07 Apr 2014, 14:44 |
|
revolution 07 Apr 2014, 14:51
Bitmaps don't have DCs as such. But you can use CreateDC and then select a bitmap into the DC (with SelectObject) and use the standard GDI functions with it.
|
|||
07 Apr 2014, 14:51 |
|
SeryZone 07 Apr 2014, 15:08
okay, like this???
Code: ;visualizing format MS COFF ;data for visualization public Visualize extrn maxx ;Width extrn maxy ;Height extrn IterDat ;Data extrn min ;Minimum extrn max ;Maximum extrn pal ;palette extrn bmp DC rd 1 Visualize: ; Calculating invoke getDC invoke CreateDC, 0,0,bmp,0 ;What I must write??? mov [DC], eax invoke SetDIBItsToDevice,[DC],0,0,[maxx],[maxy] ; Howto??? |
|||
07 Apr 2014, 15:08 |
|
revolution 07 Apr 2014, 15:13
CreateDC deals with devices so it can't be used upon a bitmap. You need to use SelectObject to load the bitmap into the DC. And if you use CreateDC then you don't need GetDC. There is also CreateCompatibleDC which might be more appropriate depending upon what you are doing.
BTW: The MS docs are pretty extensive and informative on the use of DCs (Device Contexts). |
|||
07 Apr 2014, 15:13 |
|
baldr 07 Apr 2014, 15:56
SeryZone,
Division is a slow operation, ln(IterDat[x,y]/min) can be written as ln(IterDat[x,y])-ln(min) (with some accuracy lost, probably). Are IterDat[] items contained in range [min, max) (or [min, max])? |
|||
07 Apr 2014, 15:56 |
|
revolution 07 Apr 2014, 16:07
baldr wrote: Division is a slow operation ... |
|||
07 Apr 2014, 16:07 |
|
SeryZone 07 Apr 2014, 16:14
baldr wrote: SeryZone, Oh, I forgot to replace division))) Thank you! no, only some data in IterDat() in range [min; max). If smaller than min - first color in palette (pal[0]). if more than max - last color in palette (pal[4095]). |
|||
07 Apr 2014, 16:14 |
|
baldr 07 Apr 2014, 22:13
revolution,
We surely should look at the source. Somehow it makes me to say "wrong structure" right away. |
|||
07 Apr 2014, 22:13 |
|
SeryZone 08 Apr 2014, 12:26
baldr wrote: revolution, You want to see delphi source? |
|||
08 Apr 2014, 12:26 |
|
revolution 08 Apr 2014, 12:33
SeryZone wrote: You want to see delphi source? |
|||
08 Apr 2014, 12:33 |
|
SeryZone 08 Apr 2014, 13:16
Code: ;visualizing format MS COFF ;data for visualization include 'macro\if.inc' public Visualize extrn maxx ;Width extrn maxy ;Height extrn IterDat ;Data extrn min ;Minimum extrn max ;Maximum extrn pal ;palette extrn bmp DC rd 1 buffer rd maxx*maxy BMInfo BITMAPINFOHEADER sizeof.BITMAPINFOHEADER, [maxx], [maxy], 1, 32, 0, maxx*maxy*4 Visualize: ; Calculating mov [DC], eax fld qword [max], st0 ;move maximum to register st0 fdiv min ;and divide in on minimum fld1 st1 ;move 1 to st1 for result fyl2x ;compute log2(st0)*st1 and move result to st1 mov ecx,maxx*maxy @@: ;How to make cycle and how to call x and y in array??? loop @b invoke SetDIBItsToDevice,[DC],0,0,[maxx],[maxy],0,0,0,maxy,buffer,BMInfo Here, code without cycles.[/code] |
|||
08 Apr 2014, 13:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.