News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Graphic Static

Started by digelo, January 20, 2013, 01:23:58 AM

Previous topic - Next topic

digelo

Hi

I wanna make that static controls in my application and be able to change its colors and size, Can somebody help me in this?

xandaz

    You must subclass it or use your own user defined class and process the messages needed to show those  counters. I'm going to work something out and post later. Ok? Thanks for letting me help. Got to get my hands back on ASM.

digelo

Thank you , any help would be most welcome

MichaelW

For a 7-segment style display, without a scalable 7-segment font the size change will be difficult.
Well Microsoft, here's another nice mess you've gotten us into.

jj2007

Quote from: MichaelW on January 20, 2013, 07:14:02 AM
For a 7-segment style display, without a scalable 7-segment font the size change will be difficult.

Sounds like a nice little project. LUTs, CreatePolygon, FillRgn, ... ;-)

dedndave

i would probably use StretchBlt and draw my own   :P

MichaelW

I doubt that StretchBlt would produce good results. I think drawing the digits as a collection of polygons could produce good results, but doing so would be difficult.
Well Microsoft, here's another nice mess you've gotten us into.

dedndave

well - it isn't quite clear what he wants
he says he wants "...able to change its colors and size"
but, he doesn't really say if he wants that on the fly or case-by-case

even so - StretchBlt will do fairly well if you SetStretchBltMode to HALFTONE and SetBrushOrgEx

MichaelW

For a Windows program I would not bother with any sort of N-segment display. They were a good development in their time, and there are still good reasons to use them for certain applications, but why accept their limitations when you don't have to.
Well Microsoft, here's another nice mess you've gotten us into.

Farabi

If you want to draw to the static control you have to use GetWindowLong and change the default procedure address. I cant find any easy way to that directly without changing the control procedure.
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

qWord

#10
That was fiddly ... in the attachment an example (GDI) that may be used as a base.

qWord

EDIT upload: some changes to reduce CPU usage . Also WM_DESTROY was not process by the control.
EDIT2: Further improvements
MREAL macros - when you need floating point arithmetic while assembling!

MichaelW

#11
Quote from: dedndave on January 20, 2013, 10:43:10 AM
StretchBlt will do fairly well if you SetStretchBltMode to HALFTONE and SetBrushOrgEx

The attachment contains a quick and dirty test app. I can't see any effect from SetStretchBltMode and SetBrushOrgEx, perhaps because I'm doing something wrong, but even so StretchBlt does much better than I thought it would.

Correction, I can see an effect, but I have to capture the window and zoom it up. The effect does improve the image quality, but it is present only when the size is reduced, and for the best quality you need to be working with a 24-bit bitmap. So it looks like the way to do this is to create the digit bitmap at the largest size, and reduce the size as necessary. The second attachment contains a sample of the result.



Well Microsoft, here's another nice mess you've gotten us into.

jj2007


Farabi

Quote from: qWord on January 20, 2013, 05:39:45 PM
That was fiddly ... in the attachment an example (GDI) that may be used as a base.

qWord

Did it drawn on each static control like he want? I see you use a timer for trigering the drawing.
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

Gunther

#14
Hi qWord,

well written example.  :t

Gunther
You have to know the facts before you can distort them.