🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
6 messages
6 total messages Started by Asger Jørgensen Sat, 27 Oct 2007 02:16
Draw patern like scrollbar background
#1133
Author: Asger Jørgensen
Date: Sat, 27 Oct 2007 02:16
17 lines
1102 bytes
Hi there

I need to draw a patern like scrollbar background
pixels like this:

gray white gray white
white gray white gray 
gray white gray white
white gray white gray 
gray white gray white
white gray white gray 

How is that done ??

Thanks in advance
Kind regards
Asger
Re: Draw patern like scrollbar background
#1134
Author: Bob Gonder
Date: Sat, 27 Oct 2007 15:05
20 lines
1487 bytes
Asger J�rgensen wrote:

>I need to draw a patern like scrollbar background

You might consider using the
standard "Hatch brush" HS_DIAGCROSS.
See CreateHatchBrush()

Otherwise, first create a bitmap for it.
You might be able to use MSPAINT to create an 8x8 bitmap.

Then decide what you really want to do with it.
See Help on
	Patern Brush
	Pattern
	Using Pens
See also
	CreateHatchBrush()
	CreatePatternBrush()
	CreateDIBPatternBrushPt()
Re: Draw patern like scrollbar background
#1135
Author: JF Jolin
Date: Sat, 27 Oct 2007 15:26
8 lines
970 bytes
Here is a complete example of alternate rows in a listview.

http://www.codeproject.com/useritems/ListView_Alternating_Row.asp


Cordialy,
__
JF Jolin
Re: Draw patern like scrollbar background
#1136
Author: Asger Jørgensen
Date: Sat, 27 Oct 2007 17:35
34 lines
1936 bytes
Hi Bob Gonder 

In article <8qj6i3lpjsp7rs3vjguhd87ek7pp2i1o8j@4ax.com> 
notbg@notmindspring.invalid 
 Bob Gonder says:
> Asger Jørgensen wrote:
> 
> >I need to draw a patern like scrollbar background
> 
> Otherwise, first create a bitmap for it.
> You might be able to use MSPAINT to create an 8x8 bitmap.

   PatBmp = new Graphics::TBitmap();
   PatBmp->Height = 2;
   PatBmp->Width = 2;
   PatBmp->Canvas->Pixels[0][0] = clBtnHighlight;
   PatBmp->Canvas->Pixels[0][1] = clBtnFace;
   PatBmp->Canvas->Pixels[1][0] = clBtnFace;
   PatBmp->Canvas->Pixels[1][1] = clBtnHighlight;

   Canvas->Brush->Bitmap = PatBmp;
   Canvas->FillRect(PaintRect);

Thanks Bob
This works quite nicely.:-)

Do You know if it would be faster if i use a 
bitmap size 8 x 8, not that this is notisable 
slow (on my machine)

Thanks again
Kind regards
Asger
Re: Draw patern like scrollbar background
#1137
Author: Bob Gonder
Date: Sat, 27 Oct 2007 19:51
9 lines
1444 bytes
Asger J�rgensen wrote:

>Do You know if it would be faster if i use a 
>bitmap size 8 x 8, not that this is notisable 
>slow (on my machine)

I don't know.
I mentioned 8x8 because that was what the help talked about.
But they were showing a larger pattern, too.
Re: Draw patern like scrollbar background
#1138
Author: Asger Jørgensen
Date: Sat, 27 Oct 2007 20:39
13 lines
1285 bytes
Hi JF

In article <op.t0u3uzdqjr09w3@localhost> 
jfj@nospam.com 
 JF Jolin says:
> Here is a complete example of alternate rows in a listview.
> 
> http://www.codeproject.com/useritems/ListView_Alternating_Row.asp

Thanks for Your suggestion
Kind regards
Asger
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads