News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

annoying GDI text,too narrow spaces

Started by daydreamer, May 01, 2020, 04:45:34 AM

Previous topic - Next topic

daydreamer

Hi
drawtext and textout,draws too thin " " ,but in db's in editor its form a rectangular text
if I replace with "X____________X" instead I get the right number
I use a loop to go thru all text lines
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--


daydreamer

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Manos


daydreamer

Quote from: Manos on May 02, 2020, 04:52:52 AM
Use: ExtTextOut
It is better.

Manos.
thanks,I try that
was temporary stuck on different bug,not redrawing at all
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

Any way to control what extended ascii part shows?
It don't show anything useful right now
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Manos

Go there:
https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-exttextouta

Manos.

daydreamer

looks like SetTextCharacterExtra() also works on drawtext

mov eax,rv(TextOutW,hDC,400,400,ebx,20)
doesnt output hiragana/katakana/cjk unicode,just "A - - - - - - - - "
using

testuni dw 041h,03041h,03a1h,04070h,04060h,04050h,04040h,04030h,04020h,04010h
        dw 040f0h,040e0h,040d0h
        dw 040c0h,040b0h,040a0h,04190h,04101h,04102h,04103h,04104h
        dw 0,0,0,0,0,0,0,0,0,0,0

[code]
mov eax,rv(DrawTextW,hDC,ebx,20,ADDR txtrect, DT_NOCLIP);
works for A,hiragana,katakana?,cjk unicode

textoutw too old interface on win10?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

its very easy to have simplified code compared to C with settextcolor and setBKcolor
instead of get/set combo to save/restore the previous color(s),its just
Settextcolor....
push eax ;returns old color
setBKcolor
push eax ;returns old color
......section that draws text
pop eax
setbkcolor(eax)
pop eax
setbkcolor(eax)

also tried out simpler use of Messagebox return without use variable to return in C
if(MessageBox(message,caption,MB_YESNO)==ID_YES){
//yescode here
}
else {
//nocode here
}
}
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

jj2007

Check your API calls... they don't look correct. Besides, it should be done like this:

include \masm32\MasmBasic\Res\MbGui.asm
Event Paint
  push rv(SetTextColor, PtDC, Red)
  push PtDC
  push rv(SetBkColor, PtDC, Blue)
  push PtDC
  invoke TextOut, PtDC, 20, 20, Chr$("Hello World"), 11
  call SetBkColor
  call SetTextColor 
GuiEnd

daydreamer

Quote from: jj2007 on June 05, 2020, 06:53:02 AM
Check your API calls... they don't look correct. Besides, it should be done like this:

include \masm32\MasmBasic\Res\MbGui.asm
Event Paint
  push rv(SetTextColor, PtDC, Red)
  push PtDC
  push rv(SetBkColor, PtDC, Blue)
  push PtDC
  invoke TextOut, PtDC, 20, 20, Chr$("Hello World"), 11
  call SetBkColor
  call SetTextColor 
GuiEnd

That's great solution  :thumbsup:
I have some separate proc's that draw gdi, and have hdc as argument
So maybe it could somehow be used for first gdi call,because it's already on stack
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

I want you to test these on different machines
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

HSE

2020 is drawing over statusbar.

Flickering is very good  :biggrin:
Equations in Assembly: SmplMath

daydreamer

Quote from: HSE on June 08, 2020, 06:48:54 AM
2020 is drawing over statusbar.

Flickering is very good  :biggrin:
next step hardware acceleration maybe,well reduce to drawing
beside the arrow keys there are tests controlling lvl change +-,rightclick and various keys tests popup messages,also possible to use flute to return to lvl0(surface)
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding