News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

User defined shapes?

Started by hfheatherfox07, April 29, 2011, 03:20:31 AM

Previous topic - Next topic

hfheatherfox07

Hi I have seen an example done in MASM (no source)
were SHP1 and SHP2 were used to create an exe that was separated in 2 ( it was transparent were there was no shape)

This is not to be confused with regions... there was no regions used at all or bitmaps...
I have always wanted to know how it was done ...

This is the rsrc.rc

Any idea how it was done??? any body ever came across this???
I'd love to know ...

P.S.
In my search for creating that effect of a see through area I did find how to put a "Glass hole" in a window ( that is not what I am looking to do)
but I figured some of you would appreciate the example that were one this page ... here is that page:

http://geocities.ws/xmemor/2lz/tinyasm.html

and here is that rsrc.rc

dedndave

that is a very interesting site
and interesting URL - i thought geocities was gone   :P

here is some stuff you might also enjoy...
http://www.codeproject.com/KB/library/XXcontrols.aspx

there is another one called "sdraw.lib" - a little hard to find, though

someplace, i remember seeing circular radio knob controls that rotate, but i can't find that one

dedndave

these aren't the knobs i was looking for, but similar
http://www.c-sharpcorner.com/UploadFile/desaijm/KnobControlusingWindowsForms11182005004925AM/KnobControlusingWindowsForms.aspx
more from the same guy
http://www.codeproject.com/KB/cpp/knobcontrol.aspx

the ones i remember had a variety of controls
you also had the option of adding a slider along side the knob - different colors/sizes, etc

maybe when i become a bit more proficient, i may attack something like that   :P





couldn't resist - my current rig....

it would be cool to have a library to make a panel like that - meters and all   :P

hfheatherfox07

 So nothing so far on this shape thing :(

qWord

hi,
in the attachment an quick example on an 'own-shaped window'.

FPU in a trice: SmplMath
It's that simple!

Phil Klisma

Quote from: dedndave on April 29, 2011, 03:45:40 AM
someplace, i remember seeing circular radio knob controls that rotate, but i can't find that one
off the top of my head
there is an audio mastering suite (Nuendo) has the same rotating dial feature.
seems like the same task as a 3D button that swaps between two images when depressed/relleased.
track the mouse movement in a region close to the dial image and change images according to change in mouse coords.
the resolution of the rotation may require a lot of images. so use two images one for the body of the knob and one for the indicator pip.
and just redraw the indicator pip and highlight in the new positions
Unless you want to use an open GL thing and actually rotate the object.
im trying to remember where the code was that made a series of rotating balls that shifted rotation axis in the direction of the mouse when you click near them, HMM.. have to dig through the archives

qWord

well,
creating rotating knobs isn't a hard job. I've done this some time back using GDI+ (also donable with the GDI)  - all you need is some basic knowledge on vectors and matrices.
FPU in a trice: SmplMath
It's that simple!

donkey

TestDepartment had a good example of masking buttons with regions, you can download the archive at the forum web site:

http://website.masm32.com/

Also I think Qvasimodo did a region from bitmap thing once, not sure where you can get that, I haven't heard from him in a couple of years.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

hfheatherfox07

#8
Quote from: donkey on April 30, 2011, 04:01:50 AM
TestDepartment had a good example of masking buttons with regions, you can download the archive at the forum web site:

http://website.masm32.com/

Also I think Qvasimodo did a region from bitmap thing once, not sure where you can get that, I haven't heard from him in a couple of years.

Edgar

Hi I posted an example of a region from bitmap here :
http://www.masm32.com/board/index.php?topic=16480.0

It is in:  "CAPSLOCK_ON Message_2.zip"

I use The RGN Generator...( that is what everybody uses :bg )



I tried to upload it ( but it said that the attachment was too big 320KB ?)

So here it is:

http://www.codeguru.com/code/legacy/tools/RGNCreator_demo.zip

It is from here:

http://www.codeguru.com/tools/standalonetools/article.php/c1389

So easy to use  :bg

hfheatherfox07

Quote from: qWord on April 29, 2011, 10:16:42 PM
hi,
in the attachment an quick example on an 'own-shaped window'.



Thanks for the replay qWord.. I guess I should of titled my topic better what I am trying to achieve is a user defined owner draw shape using a resource file and "IDC_SHP1"

please see "What I am trying to accomplish but with SHP in  rsrc.zip"  ... I was able to do that one with the above region creator

I want to do it with "IDC_SHP1" in the resource , that way you have more control over the region , and you do not need a new bitmap all the time!

here is an example that I tried ( I tried over 30 of them by now LOL):
"Owner draw shapes using IDC_SHP.zip"
I can not find anything on  IDC_SHP???



dedndave

almost anything you can do in a resource file, you can also do in code
in many cases, the code may be smaller, too   :P

hfheatherfox07

Quote from: dedndave on April 30, 2011, 09:29:17 PM
almost anything you can do in a resource file, you can also do in code
in many cases, the code may be smaller, too   :P

The point of my question was how to use "IDC_SHP1" using a resource file to create owner draw shape

dedndave

i don't think you can make a region owner drawn in resource
you can create the window, like any other window, in the resource file
but, what gives it shape is the code that is typically found in the WM_CREATE handler

qWord

here an example using GDI+
FPU in a trice: SmplMath
It's that simple!

hfheatherfox07

@dedndave

I have seen ( I have a little app example) that was created just like that with 2 IDC_SHP in the resource file... So I know it is possible   ::)

any ways I had too many windows open and in my house keeping frenzy I deleted it .... :(

the good copy that I complied like that is just the GUI , the source I though I moved to my project folders ...but sadly ... it got recycled...

by the time I notice it was gone ... even a restore data program could not salvage it ( must of wrote over the sectors )