Author Topic: DrawStr rotation in Pixelmap  (Read 3643 times)

HSE

  • Member
  • *****
  • Posts: 2499
  • AMD 7-32 / i3 10-64
DrawStr rotation in Pixelmap
« on: November 21, 2019, 08:07:04 AM »
Hi Biterider!!

There is a minor problem with string bitmap rotation: extremes are cutted.

Apparently can be solved extending string bitmap:
Code: [Select]
;Obtain the dimensions of the printed text, in the context of the temp device
  m2z TextRect.left
  m2z TextRect.top
  m2z TextRect.right
  m2z TextRect.bottom
  mov ebx, dRenderFlags
  or ebx, DT_CALCRECT
  invoke DrawTextEx, hTempDC, pText, -1, addr TextRect, ebx, NULL

  mov eax, TextRect.bottom        <<<<   magic here
  add TextRect.right, eax         <<<<
 

The solution is easier than understand rotation fundamentals  :biggrin:, but perhaps is incorrect.
Equations in Assembly: SmplMath

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: DrawStr rotation in Pixelmap
« Reply #1 on: November 21, 2019, 09:13:29 PM »
Hi HSE
Thanks for your feedback. I'll check the logic to see if I find a bug.
Biterider

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: DrawStr rotation in Pixelmap
« Reply #2 on: April 07, 2020, 02:13:32 AM »
Hi HSE
I have revised the code and I think I have found the culprit. It was that line:

Code: [Select]
invoke DrawTextEx&StrType&, hTempDC, pText, -1, addr TextRect, ebx, NULL
where &StrType& was missing and called the wrong API.

I resurrected an old demo that I used to check the result.
I hope it works for you now.  :biggrin:


I completed LoadFileA/LoadFileW and SaveFileA/SaveFileW in the posted file.

Biterider


HSE

  • Member
  • *****
  • Posts: 2499
  • AMD 7-32 / i3 10-64
Re: DrawStr rotation in Pixelmap
« Reply #3 on: April 07, 2020, 04:34:23 AM »
Hi Biterider!

No AVX here  :biggrin:

Thanks anyway  :thumbsup:

HSE
Equations in Assembly: SmplMath

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: DrawStr rotation in Pixelmap
« Reply #4 on: April 07, 2020, 06:06:39 AM »
Hi HSE
I'm sorry  :sad:
It has to be the new s2s macro when instancing a new object. I restricted the macro to only use the GP registers and recompiled it.
I hope it works now.

Biterider
« Last Edit: April 07, 2020, 04:20:40 PM by Biterider »

HSE

  • Member
  • *****
  • Posts: 2499
  • AMD 7-32 / i3 10-64
Re: DrawStr rotation in Pixelmap
« Reply #5 on: April 07, 2020, 07:03:20 AM »
 :biggrin: :biggrin:  :thumbsup:

It has to be the new s2s macro when instancing a new object.
Could be in your building. I was thinking that the new (unreleased ?) CloneRect use s2s.



Equations in Assembly: SmplMath

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: DrawStr rotation in Pixelmap
« Reply #6 on: April 07, 2020, 04:25:55 PM »
Hello HSE
You are probably right. I only changed the available registers in the New macro. There are probably other occurrences.
I tried again and deactivated the MM register list in the s2s macro. This change should work everywhere.

New upload in the post above.

Biterider

HSE

  • Member
  • *****
  • Posts: 2499
  • AMD 7-32 / i3 10-64
Re: DrawStr rotation in Pixelmap
« Reply #7 on: April 08, 2020, 12:39:05 AM »
Hi Biterider!!

 Build 3 work perfect here, also build 4.

  I can not build the application, because there is a sintaxis problem when CloneRect expand mrm. I'm sure pretty easy to fix, a little of entertainment for this days :biggrin:.
 
  But I think you are not using in this demo WinHelper.inc or System.inc Version C.1.0, October 2017.

Regards. HSE
Equations in Assembly: SmplMath

tempuyax

  • Regular Member
  • *
  • Posts: 4
Re: DrawStr rotation in Pixelmap
« Reply #8 on: April 24, 2020, 05:26:25 AM »

Hi
I really like this objasm32. and I tried it with HXDOS which I booted with DOS Window ME. Demo01c runs smoothly ...


regards,

Tempuyax
Indonesia, North Borneo

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: DrawStr rotation in Pixelmap
« Reply #9 on: April 24, 2020, 06:00:33 AM »
Hi tempuyax
I am glad to hear that you like it.  :biggrin:
Consider switching to the latest ObjAsm model for dual bitness (64/32 bit) compilation.
The older ObjAsm32 is no longer actively developed because it is included in the former.

Biterider

tempuyax

  • Regular Member
  • *
  • Posts: 4
Re: DrawStr rotation in Pixelmap
« Reply #10 on: April 25, 2020, 07:57:13 AM »
Hehehe

at first I did not understand it, after all this time I used it. I am very happy. what I've been looking for is here. Thank you my bro.

I still love the old model, to research open the x86 engine screen deeper. because of that I have to go down to the level of the chipset machine. not for making applications.

regards,

tempuyax