The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: hfheatherfox07 on August 25, 2011, 08:45:31 PM

Title: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 25, 2011, 08:45:31 PM
Hi,
I have a few examples were a long strip of images is loaded and used as the tool bar Icon (for buttons) ....
How do I use the same concept to load smile tool bar for scrolling text ?
I have seen it done using masm32 but how to define each smile?
Like smile 1 through 12  I have seen an example were  in the text  for the scroller for each smile you have db " offh,0h"  <- that is smile 1 than db "offh,2dh" that is smile 4

I don't see the logic in that?

any thought? is it like the sprite example in masm?

Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 01:16:01 AM
Or how can I load just one smilie face and have it scroll in a the text scroller ?
Title: Re: Load bmp tool bar "Like" image
Post by: dedndave on August 26, 2011, 01:26:08 AM
Hutch uses the "Rebar" method
there may be other ways, but....
http://msdn.microsoft.com/en-us/library/bb774375%28v=VS.85%29.aspx
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 01:27:35 AM
I have tons of example in MASM for that but how do I do it for a scrolling Text?
Title: Re: Load bmp tool bar "Like" image
Post by: dedndave on August 26, 2011, 01:31:58 AM
i'm not really sure what you mean
you want to stick smileys in with the text ?
kinda like chatting with yahoo messenger ?

i guess it's a matter of...
loading the image
calculating source coordinates (to get the smiley you want)
calculating destination coordinates (like in a compatible DC)
and painting the image in there   :P
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 01:38:47 AM
Quote from: dedndave on August 26, 2011, 01:31:58 AM
i'm not really sure what you mean
you want to stick smileys in with the text ?
kinda like chatting with yahoo messenger ?

i guess it's a matter of...
loading the image
calculating source coordinates (to get the smiley you want)
calculating destination coordinates (like in a compatible DC)
and painting the image in there   :P

yap I dunno how to do that.... look at the video here http://www.masm32.com/board/index.php?topic=17168.0  go straight to 9:48  to see that effect

http://cyberdoomsystems.narod.ru/ripp/about.rar  from here http://cyberdoomsystems.narod.ru/ripp.html

how did he do that?


soo neat
Title: Re: Load bmp tool bar "Like" image
Post by: baltoro on August 26, 2011, 01:45:53 AM
It looks like you are compiling your program as a console application. I'm fairly sure that console applications can't have menus, or rebars (or, bitmaps displayed).   
When you compile with ML.exe, specify the /SUBSYSTEM:WINDOWS switch. And, of course, you'll have to call CreateWindowEx somewhere.
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 01:48:20 AM
Quote from: baltoro on August 26, 2011, 01:45:53 AM
It looks like you are compiling your program as a console application. I'm fairly sure that console applications can't have menus, or rebars (or, bitmaps displayed).   
When you compile with ML.exe, specify the SUBSYSTEM:WINDOW switch. And, of course, you'll have to call CreateWindowEx somewhere.


(http://www.weedforums.com/images/smilies/bong-hits.gif)

LOL I need some of that Hahahahaha

what are you assembling ??
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 02:01:56 AM
Quote from: dedndave on August 26, 2011, 01:31:58 AM
i'm not really sure what you mean
you want to stick smileys in with the text ?
kinda like chatting with yahoo messenger ?

i guess it's a matter of...
loading the image
calculating source coordinates (to get the smiley you want)
calculating destination coordinates (like in a compatible DC)
and painting the image in there   :P

I know how to load the image and paint the image ....

but how to:
calculating source coordinates (to get the smiley you want)
and:
calculating destination coordinates (like in a compatible DC)
in the example that I saw that was just added in the scroller....

Title: Re: Load bmp tool bar "Like" image
Post by: dedndave on August 26, 2011, 02:03:46 AM
cut him some slack...
he's havin a mid-life crisis  (http://tipsylights.com/wp-content/uploads/2010/11/smoking-smiley-54371.gif)
Title: Re: Load bmp tool bar "Like" image
Post by: dedndave on August 26, 2011, 02:05:47 AM
well - that doesn't look all that difficult   :P
it's more about paint and scroll than it is about getting an image in there
what i mean is, the paint and scroll code is the hard part
after all the stuff you've been doing, i should come to you to ask how - lol
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 02:08:31 AM
Quote from: dedndave on August 26, 2011, 02:03:46 AM
cut him some slack...
he's havin a mid-life crisis  (http://tipsylights.com/wp-content/uploads/2010/11/smoking-smiley-54371.gif)

I just meant he was running the wrong program    (http://www.picdrop.net/uploads/ANIMATIONPCLOADING.gif)
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 02:10:47 AM
Quote from: dedndave on August 26, 2011, 02:05:47 AM
well - that doesn't look all that difficult   :P
it's more about paint and scroll than it is about getting an image in there
what i mean is, the paint and scroll code is the hard part
after all the stuff you've been doing, i should come to you to ask how - lol

I know how to load a smilie see here: http://www.masm32.com/board/index.php?topic=17099.0

I used it to CreateCaret ... but I dunno how to:

1. choose different smilie
2. integrate it into the scrolling text
Title: Re: Load bmp tool bar "Like" image
Post by: dedndave on August 26, 2011, 02:18:01 AM
well - a little knowledge of bitmap format is all you need to calculate the source image coordinates
i think everything is stored in 4-bytes per pixel format
the total width of the source image X 4 X line number (zero based) will get you the start of a line
index into each line to get the part of the image you want
i have little experience with this stuff - there is probably a really cool API function to do it for you   :P

as for integrating it into the text - that is, again, a matter of calculating coordinates
then, i suppose BitBlt the thing over there
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 02:21:16 AM
back to the rebar .... that uses a structure like this:

tbrbtns TBBUTTON <7,10000,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <8,10001,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>
TBBUTTON <0,10002,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <1,10003,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
TBBUTTON <2,10004,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
ntbrbtns equ 6


how could that be used for smilies....

also if  you down load the example http://cyberdoomsystems.narod.ru/ripp/about.rar   you will see that the smilies are positioned in the data for the text scroller
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 02:25:36 AM
Quote from: dedndave on August 26, 2011, 02:18:01 AM
well - a little knowledge of bitmap format is all you need to calculate the source image coordinates
i think everything is stored in 4-bytes per pixel format
the total width of the source image X 4 X line number (zero based) will get you the start of a line
index into each line to get the part of the image you want
i have little experience with this stuff - there is probably a really cool API function to do it for you   :P

as for integrating it into the text - that is, again, a matter of calculating coordinates
then, i suppose BitBlt the thing over there

I dunno if that would work ...in the caret example

there is a structure like this:

CarPos struct
x dd ?
y dd ?
CarPos ends

cp CarPos <>
than to bit bit the caret :
invoke BitBlt,hDC,X,cp.y,50,50,CarDC,0,0,SRCCOPY

but that is in a fix position.... I want it to scroll
Title: Re: Load bmp tool bar "Like" image
Post by: Twister on August 26, 2011, 02:26:45 AM
Just because you can come on here to get answers to your dim-witted projects does not mean you can insult people who are helping you out.

You have to be kidding me, honestly. You are saying "Oh ho ho, what are you smoking?". You put up two images of a bong and a blunt; why are you being a brat?

And I have taken a look at your previous posts, and I don't like how your threads add up.

It's not hard to put two and two together.
Title: Re: Load bmp tool bar "Like" image
Post by: hfheatherfox07 on August 26, 2011, 02:29:22 AM
Quote from: Horton on August 26, 2011, 02:26:45 AM
Just because you can come on here to get answers to your dim-witted projects does not mean you can insult people who are helping you out.

You have to be kidding me, honestly. You are saying "Oh ho ho, what are you smoking?". You put up two images of a bong and a blunt; why are you being a brat?

And I have taken a look at your previous posts, and I don't like how your threads add up.

It's not hard to put two and two together.

That was just for fun ....was not to insult anybody  ..... in the spirit of smilies

Cheers