The MASM Forum

Projects => ObjAsm => Topic started by: HSE on November 21, 2019, 08:07:04 AM

Title: DrawStr rotation in Pixelmap
Post by: HSE 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: ;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.
Title: Re: DrawStr rotation in Pixelmap
Post by: Biterider 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
Title: Re: DrawStr rotation in Pixelmap
Post by: Biterider 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:

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

Title: Re: DrawStr rotation in Pixelmap
Post by: HSE on April 07, 2020, 04:34:23 AM
Hi Biterider!

No AVX here  :biggrin:

Thanks anyway  :thumbsup:

HSE
Title: Re: DrawStr rotation in Pixelmap
Post by: Biterider 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
Title: Re: DrawStr rotation in Pixelmap
Post by: HSE on April 07, 2020, 07:03:20 AM
 :biggrin: :biggrin:  :thumbsup:

Quote from: Biterider on April 07, 2020, 06:06:39 AM
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.



Title: Re: DrawStr rotation in Pixelmap
Post by: Biterider 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
Title: Re: DrawStr rotation in Pixelmap
Post by: HSE 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
Title: Re: DrawStr rotation in Pixelmap
Post by: tempuyax 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
Title: Re: DrawStr rotation in Pixelmap
Post by: Biterider 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
Title: Re: DrawStr rotation in Pixelmap
Post by: tempuyax 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