topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
Change Windows Background color in Windows 8 | Enrico,
In Windows 8 works with WindowText as I explained. Maybe it has changed in 8.1 |
Change XBROWSE Style? | Dear All,
I can define TXBrowse as "Windows Style=0x50210000" in .RC or .RES. But if I need to define from source code with out .RC or .RES.
How do I can define it?
Thanks |
Change XBROWSE Style? | What does the style Windows Style=0x50210000 mean? |
Change XBROWSE Style? | Dear Mr.Rao,
I need TXBRowse with flat border style as picture.
[url=https://postimages.org/:3a3dvwjt][img:3a3dvwjt]https://s8.postimg.cc/nk0y8qsbp/flat-border.png[/img:3a3dvwjt][/url:3a3dvwjt] |
Change XBROWSE Style? | Hi, Dutch.
Did you resolve? |
Change XBROWSE Style? | Mr. Dutch
Set
oBrw:lDrawBorder := .t. |
Change XBROWSE Style? | Dear Mr.Rao,
I've tried this but it doesn't effect.
[code=fw:3oc50xrj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.Ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> TEST<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oDlgTEST<br /><span style="color: #00C800;">LOCAL</span> oFnt<br /><span style="color: #00C800;">LOCAL</span> oBtIDOK<br /><span style="color: #00C800;">LOCAL</span> oXBRW101<br /> <br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFnt <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"MS Sans Serif"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-8</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgTEST ;<br /> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">15</span>,<span style="color: #000000;">6</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">45</span>,<span style="color: #000000;">84</span> ;<br /> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TXBrowse demo"</span> ;<br /> <span style="color: #0000ff;">STYLE</span> WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE <br /><br />@ <span style="color: #000000;">211</span>, <span style="color: #000000;">252</span> <span style="color: #0000ff;">BUTTON</span> oBtIDOK ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">14</span> ;<br /> <span style="color: #0000ff;">OF</span> oDlgTEST ;<br /> <span style="color: #0000ff;">FONT</span> oFnt ;<br /> <span style="color: #0000ff;">PIXEL</span><br /><br />@ <span style="color: #000000;">5</span>, <span style="color: #000000;">4</span> <span style="color: #0000ff;">XBROWSE</span> oXBRW101 ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">297</span>, <span style="color: #000000;">202</span> ;<br /> <span style="color: #0000ff;">OF</span> oDlgTEST ;<br /> <span style="color: #0000ff;">FONT</span> oFnt ;<br /> <span style="color: #0000ff;">PIXEL</span><br /><br /> oXBRW101:<span style="color: #000000;">lDrawBorder</span> := .T.<br /> oXBRW101:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgTEST<br /><span style="color: #00C800;">RETURN</span> <span style="color: #000000;">0</span><br /> </div>[/code:3oc50xrj]
[url=https://postimages.org/:3oc50xrj][img:3oc50xrj]https://s33.postimg.cc/4nf6jcw4f/flat-border.png[/img:3oc50xrj][/url:3oc50xrj][url=https://postimages.org/:3oc50xrj]image hosting over 10mb[/url:3oc50xrj]
[quote="nageswaragunupudi":3oc50xrj]Mr. Dutch
Set
oBrw:lDrawBorder := .t.[/quote:3oc50xrj]
Thanks, |
Change XBROWSE Style? | Add the clause NOBORDER to XBROWSE command, whenever you create from sourcecode. Just make it a habit to use always.
(Not for resources)
On bottom and right, you see the border drawn by lDrawBorder when HScroll and VScroll are absent.
[url=https://imageshack.com/i/pnKOSRtPp:10vji6ar][img:10vji6ar]https://imagizer.imageshack.com/v2/xq90/923/KOSRtP.png[/img:10vji6ar][/url:10vji6ar] |
Change XBROWSE Style? | Is it included in FWH 18.05? |
Change XBROWSE Style? | Hi Mr. Rao,
How can I change border color to light blue?
also if there is a scroolbar in the xbrowse, border is not impressed.
Thanks, |
Change XBROWSE Style? | [quote="dutch":290lr9de]Is it included in FWH 18.05?[/quote:290lr9de]
It is already there in many previous versions too. |
Change XBROWSE Style? | [quote:1acrizml]How can I change border color to light blue?
[/quote:1acrizml]
We will provide color choice in future versions.
[code=fw:1acrizml]<div class="fw" id="{CB}" style="font-family: monospace;"><br />also <span style="color: #00C800;">if</span> there is a scroolbar in the <span style="color: #0000ff;">xbrowse</span>, border is not impressed.<br /> </div>[/code:1acrizml]
Yes, you are right.
We are unable to draw the border outside the scrollbar.
Drawing the border inside the scrollbar is not looking good.
If you like you may play with this and give your feedback and advice.
Look for the code
::Box( 1, 1 ..... )
towards the end of the Paint() method.
Keep changing the values and let us know if you feel something looks better. |
Change XBROWSE Style? | In 18.05, we can specify oBrw:nClrBorder |
Change XBROWSE Style? | [quote="dutch":3qdpv50l]Dear Mr.Rao,
I need TXBRowse with flat border style as picture.
[/quote:3qdpv50l]
You have tried?
[code=fw:3qdpv50l]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> @ nRow, nCol <span style="color: #0000ff;">XBROWSE</span> ....<br /> ... <span style="color: #0000ff;">STYLE</span> FLAT NOBORDER<br /><br /><span style="color: #B900B9;">// :lFlatStyle := .T.</span><br /><br /> </div>[/code:3qdpv50l]
and
[code=fw:3qdpv50l]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #B900B9;">//:nClrBorder := Rgb( 73, 134, 231 ) // only in Fwh 18.05</span><br /> :<span style="color: #000000;">lDrawBorder</span> := .T.<br /> </div>[/code:3qdpv50l] |
Change XBROWSE Style? | Dear Mr.Cristobal and Mr.Rao,
Yes, it is working [2015,NOBORDER and lDrawBorder].
Thank you so much. |
Change XBROWSE Style? | [quote="nageswaragunupudi":bo540duy]In 18.05, we can specify oBrw:nClrBorder[/quote:bo540duy]
Hi Mr. Rao,
Have you noticed that nClrBorder is not painted when xbrowse is empty? |
Change XBROWSE Style? | [quote="Horizon":3l0t0ami][quote="nageswaragunupudi":3l0t0ami]In 18.05, we can specify oBrw:nClrBorder[/quote:3l0t0ami]
Hi Mr. Rao,
Have you noticed that nClrBorder is not painted when xbrowse is empty?[/quote:3l0t0ami]
Yes, thanks.
Fixed in FWH1808. |
Change a no modal dialog to modal after activate | Is possible change a no modal dialog to modal after activate him?
I refer to any like:
(...)
activate dialog oDlg NoWait centered
// do anything
// turn oDlg to modal here!
Regards,
Maurilio |
Change a no modal dialog to modal after activate | Maurilio,
What you descibe doesn't sound very useful.
Example. You put up a non-modal dialog over a parent window and the user clicks on the toolbar on the parent window, but instead of the button working, the dialog becomes modal. I can imagine a very confused user.
Perhaps I am not understanding what you are trying to do?
James |
Change a no modal dialog to modal after activate | James,
What I want do is create a black or gray dialog and turn it transparent (it will causa a shadow over my screen) and after I activate my dialog.
The effect I want is like when whe click Start / Shutdown where the backgroud turn shadowed.
Now I do this sequence:
1. create a non modal dialog (shadow)
2. create a modal dialog
3. when close the modal close shadow too
My problem:
The shadow effect display ok, but if I click in non modal dialog (shadow) it appear over the modal dialog and I can't get back...
Regards
Maurilio |
Change a no modal dialog to modal after activate | Maurilio,
Hmm. The modal/non-modal state is set via the STYLE clause and I don't think an object can have it's style changed after it is created (but I may be wrong).
Can you just make both dialogs modal? You can call one modal dialog from another, but the user wouldn't be able to click on the first dialog (the shadow). I mean, they could click on it, but the click would be ignored. You can close the first dialog via code after the second one is opened.
I don't know it that helps.
James |
Change a no modal dialog to modal after activate | Maurilio,
If you disable (oWnd:Disable()) all windows and dialogs under the dialog, it will act as a modal dialog. |
Change a no modal dialog to modal after activate | James and Antonio,
I'll do some tests.
Thanks a lot!
Maurilio |
Change author in excel | Hi,
Is it possible to fill the author, Title and other property-fields of an excel-file via FiveWin?
Thanks
Marc |
Change author in excel | When I do not know how to do something in Excel I record a macro, make the changes, then go back and edit the macro to see how Excel did it. |
Change author in excel | The problem is that a macro doesn't record changing the title or author.
Marc |
Change author in excel | That does make it harder <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
I will check. |
Change author in excel | Hi,
I found on the MicroSoft-site an example how to change the 'Subject'-field it in VBA
[code=fw:1slgpefa]<div class="fw" id="{CB}" style="font-family: monospace;">Dim properties As Microsoft.Office.Core.DocumentProperties<br /><br />properties = DirectCast<span style="color: #000000;">(</span>Globals.ThisDocument.BuiltInDocumentProperties, _<br /> Microsoft.Office.Core.DocumentProperties<span style="color: #000000;">)</span><br /><br />properties.Item<span style="color: #000000;">(</span><span style="color: #ff0000;">"Subject"</span><span style="color: #000000;">)</span>.Value = <span style="color: #ff0000;">"Whitepaper"</span><br /><br /> </div>[/code:1slgpefa]
Do you know how to do this in FWH?
Thanks,
Marc |
Change author in excel | Please try the following code. I have not tested this.
[code=fw:339jiplg]<div class="fw" id="{CB}" style="font-family: monospace;">oWorkBook:<span style="color: #000000;">BuiltinDocumentProperties</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Author"</span><span style="color: #000000;">)</span> := cAuthor <br />oWorkBook:<span style="color: #000000;">BuiltinDocumentProperties</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Title"</span><span style="color: #000000;">)</span> := cTitle <br />oWorkBook:<span style="color: #000000;">BuiltinDocumentProperties</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Comments"</span><span style="color: #000000;">)</span> := cComments</div>[/code:339jiplg]
Regards
[b:339jiplg]Anser[/b:339jiplg] |
Change author in excel | Anser,
Unfortunately it doesn't work. I have this error
[quote:3q36b6hf] Error description: Error Excel.Application:ACTIVESHEET/16389 E_FAIL: _BUILTINDOCUMENTPROPERTIES
Args:
[ 1] = C Test
Stack Calls
===========
Called from: win32ole.prg => TOLEAUTO:_BUILTINDOCUMENTPROPERTIES(0)
[/quote:3q36b6hf]
Regards,
Marc |
Change author in excel | Sorry, I missed Value in the statement.
This is working fine for me.
[code=fw:bokh8yf1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oExcel,oWorkBook<br /> <br /> oExcel:=CreateObject<span style="color: #000000;">(</span> <span style="color: #ff0000;">"excel.application"</span> <span style="color: #000000;">)</span><br /> oWorkBook:=oExcel:<span style="color: #000000;">Workbooks</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> oWorkBook:<span style="color: #000000;">BuiltinDocumentProperties</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Author"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #ff0000;">"Anser K.K."</span><br /> oWorkBook:<span style="color: #000000;">BuiltinDocumentProperties</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Title"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #ff0000;">"Test Title"</span><br /> oWorkBook:<span style="color: #000000;">BuiltinDocumentProperties</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Comments"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> := <span style="color: #ff0000;">"Test Comments"</span><br /> <br /> cFile := <span style="color: #ff0000;">'D:<span style="color: #000000;">\t</span>est.xlsx'</span><br /> <br /> oWorkBook:<span style="color: #000000;">saveAS</span><span style="color: #000000;">(</span> cFile <span style="color: #000000;">)</span><br /> oExcel:<span style="color: #000000;">Quit</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Done"</span><span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">Nil</span></div>[/code:bokh8yf1]
Regards
[b:bokh8yf1]Anser[/b:bokh8yf1] |
Change author in excel | Thanks Anser,
It's working fine now!!
Regards,
Marc |
Change behavior of minimize button | Hi all,
is it possible to change the standard behavior of the minimize and close button of a window ?
A click on minimize should hide the windows |
Change behavior of minimize button | [code:2v4zu7f8]
#define SIZE_MINIMIZED 1
ACTIVATE WINDOW oWnd ;
ON RESIZE If( nSizeType == SIZE_MINIMIZED, oWnd:Hide(), oWnd:Show() )
[/code:2v4zu7f8] |
Change behavior of minimize button | Antonio,
many thanks, it´s working.
But when i try to show the window again (oWnd:Show() ), it´s only shown in the taskbar. Do i miss something to restore it completely ? |
Change behavior of minimize button | Stefan,
Try:
oWnd:Restore(), oWnd:Show() |
Change behavior of minimize button | Antonio,
works perfectly <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
many thanks |
Change color active folder. | Dear All,
I would like to change active folder in different color than the other for showing the which active folder has focused as sample.
- upper picture is normal folder
- lower picture is that I need. I try with ::nClrPane or ::SetColors() but it doesn't successful.
How to do that? Or Which way is the better solution.
[url=https://postimg.org/image/6noshvwtb/:2osxdnmg][img:2osxdnmg]https://s27.postimg.org/58n7t5vqb/Folder1.png[/img:2osxdnmg][/url:2osxdnmg][url=https://postimage.org/:2osxdnmg]photo hosting sites[/url:2osxdnmg]
Thanks in advance.
Dutch |
Change color active folder. | Try with this DATAs
[code=fw:1jcfp6zg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> :<span style="color: #000000;">aGradSel</span> := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, METRO_GRIS2, METRO_GRIS2 <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">aGradUnSel</span> := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, CLR_WHITE, CLR_WHITE <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">aGradOver</span> := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, METRO_STEEL, METRO_STEEL <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//</span><br /> :<span style="color: #000000;">aGradOverUnSel</span> := :<span style="color: #000000;">aGradOver</span><br /> :<span style="color: #000000;">aGradDis</span> := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">1</span>, CLR_WHITE, METRO_STEEL <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <br /> :<span style="color: #000000;">bClrText</span> := <span style="color: #000000;">{</span> | o, n | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> o:<span style="color: #000000;">aEnable</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span> .and. o:<span style="color: #000000;">aVisible</span><span style="color: #000000;">[</span> n <span style="color: #000000;">]</span>, ;<br /> <span style="color: #000000;">(</span> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> n = o:<span style="color: #000000;">nOption</span>, CLR_WHITE, ;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> n = o:<span style="color: #000000;">nOver</span>, CLR_BLUE, METRO_STEEL <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, ;<br /> GetSysColor<span style="color: #000000;">(</span> CLR_GRAY <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nSeparator</span> := <span style="color: #000000;">0</span><br /> ATail<span style="color: #000000;">(</span> :<span style="color: #000000;">aDialogs</span> <span style="color: #000000;">)</span>:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> CLR_BLUE, CLR_WHITE <span style="color: #000000;">)</span><br /><br /><br /> </div>[/code:1jcfp6zg] |
Change color active folder. | Dear Cristobal
It has an error.
[code=fw:3r6hncu9]<div class="fw" id="{CB}" style="font-family: monospace;">Description : <span style="color: #000000;">Warning</span> BASE/<span style="color: #000000;">1005</span> <span style="color: #0000ff;">Message</span> not found: <span style="color: #000000;">TFOLDER</span>:_AGRADSEL<br /> </div>[/code:3r6hncu9] |
Change color active folder. | Sorry, I only use FolderEx |
Change color in a bmp | Hello,
I would like to change some of the colors programmatically. Can you please help me on that.
Thanks in advance
Otto
[img:2boyoes9]http://www.atzwanger-software.com/fw/oculto.bmp[/img:2boyoes9] |
Change color in a bmp | Otto,
If the bitmap is already shown as a control:
[code=fw:25fec00o]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">local</span> hDC := oBmp:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">for</span> nRow = <span style="color: #000000;">0</span> <span style="color: #0000ff;">to</span> oBmp:<span style="color: #000000;">nHeigth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> - <span style="color: #000000;">1</span><br /> <span style="color: #00C800;">for</span> nCol = <span style="color: #000000;">0</span> <span style="color: #0000ff;">to</span> oBmp:<span style="color: #000000;">nWidth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> - <span style="color: #000000;">1</span> <br /> <span style="color: #00C800;">if</span> GetPixel<span style="color: #000000;">(</span> hDC, nRow, nCol <span style="color: #000000;">)</span> == nClrToReplace<br /> SetPixel<span style="color: #000000;">(</span> hDC, nRow, nCol, nClrNew <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <span style="color: #00C800;">next</span><br /><span style="color: #00C800;">next</span><br /><br />oBmp:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:25fec00o] |
Change color in a bmp | Dear Antonio,
thank you for your help.
But it seems that this function is working to slow for my purpose.
Is it possible to print a transparent bmp over the original.
Thank you in advance
Otto
[img:1ajk5e7a]http://www.atzwanger-software.com/fw/camping2.jpg[/img:1ajk5e7a] |
Change color in a bmp | I think you can use
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=35518&start=0">viewtopic.php?f=3&t=35518&start=0</a><!-- l --> |
Change color in a bmp | Use Windows GDI functions FloodFill() or ExtFloodFill(). |
Change color in a bmp | Otto,
[quote:1fkehl5h]Use Windows GDI functions FloodFill() or ExtFloodFill().[/quote:1fkehl5h]
a idea maybe using a colorpicker
I still have to work on the < floodfill function >
I could not' find any working tests inside the forum or sample folder <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: -->
I don't know for the moment if we can fill a single cell
inside the image on mouseclick
1. select a color
2. use floodfill inside the working image 1
3. after selections save the result to image 1 and 2
4. delete old selections with floodfill using color white
There are 2 colorpickers
one with all colors and one with a colorselection
[img:1fkehl5h]http://www.service-fivewin.de/IMAGES/Floodfill1.jpg[/img:1fkehl5h]
regards
Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> |
Change color in a bmp | if I have this figure and I wanted to click on the pencils and recognize the color and then fill the white part of the drawing with the selected color, what can I do?
[img:3t3dmhfp]https://i.postimg.cc/kXFD9Lts/ff.jpg[/img:3t3dmhfp] |
Change color in a bmp | 1, Get hDC.
2. Read pixels around the coordinates of the mouse cursor.
3. Determine that it is a white color and change it.
Only it's a long time.
You can specify the polygon with the corresponding color yourself |
Change color in a bmp | [quote="Natter":bnsmrymu]1, Get hDC.
2. Read pixels around the coordinates of the mouse cursor.
3. Determine that it is a white color and change it.
Only it's a long time.
You can specify the polygon with the corresponding color yourself[/quote:bnsmrymu]
In words you are all good, I know what I should do, if I asked how to do it it means that perhaps I have not succeeded,
in fact even if I know how to fill an area in a drawing I do not know the function or the command to take the pixel color only by clicking with the mouse |
Change color in a bmp | I made a sample test
[code=fw:ma1sqwzx]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cFile:=<span style="color: #ff0000;">"a.jpg"</span><br /> <span style="color: #00C800;">local</span> cColori:=<span style="color: #ff0000;">"colori.bmp"</span><br /> <span style="color: #00C800;">local</span> oDlg,oBmp,oImg<br /> <span style="color: #00C800;">local</span> nColor:= <span style="color: #000000;">1</span>,oColor<br /> <span style="color: #00C800;">local</span> hdc<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oHand HAND<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">600</span><br /><br /> @ <span style="color: #000000;">4</span>,<span style="color: #000000;">1</span> XIMAGE oImg filename cFile <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">220</span>,<span style="color: #000000;">1</span> XIMAGE oBmp filename cColori <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /> @ <span style="color: #000000;">4</span>, <span style="color: #000000;">220</span> <span style="color: #0000ff;">get</span> oColor <span style="color: #0000ff;">var</span> ncolor <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>,<span style="color: #000000;">30</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> ncolor,ncolor <span style="color: #0000ff;">UPDATE</span><br /><br /><br /> oBmp:<span style="color: #000000;">oCursor</span> = oHand<br /> oBmp:<span style="color: #000000;">bLClicked</span> = <span style="color: #000000;">{</span> | nRow, nCol | <span style="color: #000000;">(</span>GetColor<span style="color: #000000;">(</span> nRow, nCol, oBmp,@nColor <span style="color: #000000;">)</span>, <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span>nColor<span style="color: #000000;">)</span>, oColor:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">dialog</span> oDlg<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//--------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> GetColor<span style="color: #000000;">(</span> nRow, nCol, oBmp,nColor <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> hDC := oBmp:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> nColor := GetPixel<span style="color: #000000;">(</span> hDC, nCol, nRow <span style="color: #000000;">)</span><br /> DeleteDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span><br /> oBmp:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------//</span></div>[/code:ma1sqwzx]
for the first time it takes the color but does not refresh the get, the second time and after the color is always -1 why?
[b:ma1sqwzx]a.jpg[/b:ma1sqwzx]
[img:ma1sqwzx]https://i.postimg.cc/fLH9g4hs/a.jpg[/img:ma1sqwzx]
[b:ma1sqwzx]color.bmp[/b:ma1sqwzx]
[img:ma1sqwzx]https://i.postimg.cc/sgFZL9bM/colori.png[/img:ma1sqwzx] |
Change color in a bmp | Silvio
my changes and tests
I tested < Floodfill and ExtFloodFill > but got NO result <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
[code=fw:3qkq2v4x]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> cFile:=<span style="color: #ff0000;">"a.bmp"</span><br /><span style="color: #00C800;">local</span> cColori:=<span style="color: #ff0000;">"colori.png"</span><br /><span style="color: #00C800;">local</span> oDlg,oBmp,oImg<br /><span style="color: #00C800;">local</span> nColor := <span style="color: #000000;">0</span>, oColor<br /><span style="color: #00C800;">local</span> hdc, nPickRow := <span style="color: #000000;">0</span>, nPickCol := <span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> oSay1, oSay2, oSay3, oFont <br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oHand HAND<br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Verdanal"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-12</span> BOLD<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">520</span>, <span style="color: #000000;">520</span><br /><br />@ <span style="color: #000000;">4</span>,<span style="color: #000000;">1</span> XIMAGE oImg filename cFile <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg<br />oImg:<span style="color: #000000;">oCursor</span> := oHand<br />oImg:<span style="color: #000000;">bPainted</span> := < |hDC| <br /> FLOODFILL<span style="color: #000000;">(</span> nPickRow, nPickCol, nColor <span style="color: #000000;">)</span> <br /><span style="color: #B900B9;">// FILLCOLOR( hDC, oImg, nPickRow, nPickCol, nColor )</span><br /> oSay1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSay2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSay3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />><br />oImg:<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol | nPickRow := nRow, nPickCol := nCol, oImg:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br />@ <span style="color: #000000;">220</span>,<span style="color: #000000;">1</span> XIMAGE oBmp filename cColori <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">180</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oDlg<br />@ <span style="color: #000000;">220</span>, <span style="color: #000000;">183</span> <span style="color: #0000ff;">get</span> oColor <span style="color: #0000ff;">var</span> ncolor <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> nColor, nColor <span style="color: #0000ff;">UPDATE</span><br /><br />@ <span style="color: #000000;">190</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay0 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Top, Left, color"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">0</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br />@ <span style="color: #000000;">200</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay1 <span style="color: #0000ff;">var</span> nPickRow <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br />@ <span style="color: #000000;">210</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay2 <span style="color: #0000ff;">var</span> nPickCol <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br />@ <span style="color: #000000;">220</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay3 <span style="color: #0000ff;">var</span> nColor <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /><br />oBmp:<span style="color: #000000;">oCursor</span> := oHand<br />oBmp:<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol | <span style="color: #000000;">(</span> ncolor := GETCOLOR<span style="color: #000000;">(</span> oBmp, nRow, nCol <span style="color: #000000;">)</span>, ;<br /> oColor:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span>nColor, nColor<span style="color: #000000;">)</span>, oColor:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br />oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//-----------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> GETCOLOR<span style="color: #000000;">(</span> oBmp, nRow, nCol <span style="color: #000000;">)</span><br /><br />hDC := oBmp:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />nColor := GetPixel<span style="color: #000000;">(</span> hDC, nCol, nRow <span style="color: #000000;">)</span><br />oBmp:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> nColor<br /><br /><span style="color: #B900B9;">//-----------------------</span><br /><br /><span style="color: #00C800;">FUNCTION</span> FILLCOLOR<span style="color: #000000;">(</span> hDC, oImg, nRow, nCol, nColor <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//MsgAlert( nRow, "Row" )</span><br /><span style="color: #B900B9;">//MsgAlert( nCol, "Column" )</span><br /><span style="color: #B900B9;">//MsgAlert( nColor, "Color" )</span><br /><br /><span style="color: #B900B9;">//ExtFloodFill( hDC, nRow, nCol, ncolor, 1 )</span><br />FloodFill<span style="color: #000000;">(</span> nRow, nCol, nColor <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> </div>[/code:3qkq2v4x]
On imageclick I show the cursor-position and color-value
[img:3qkq2v4x]http://www.service-fivewin.de/IMAGES/Floodtest.jpg[/img:3qkq2v4x]
the cleaned image with deleted dirty areas <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: -->
[img:3qkq2v4x]http://www.service-fivewin.de/IMAGES/A.bmp[/img:3qkq2v4x]
Floodfill is done with PIXELFORMER <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: -->
Reduce the image to 4 colors to clean the image from dirty areas
The original image shows the result ( floodfill ) without cleaning
[img:3qkq2v4x]http://www.service-fivewin.de/IMAGES/B.bmp[/img:3qkq2v4x]
next save the image with full colors to fill the wanted sections close to clear borders
See the result after cleaning <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
[img:3qkq2v4x]http://www.service-fivewin.de/IMAGES/C.bmp[/img:3qkq2v4x]
regards
Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
Change color in a bmp | Sorry
I selet the colors
then click on Image not fill the color into area why ? |
Change color in a bmp | Silvio,
showing a black and white image I expected that You want to repaint it
because from Rao
[quote:3ij7fsub]Use Windows GDI functions FloodFill() or ExtFloodFill().[/quote:3ij7fsub]
I used the extended test for maybe getting a working [color=#0000FF:3ij7fsub]FLOODFILL[/color:3ij7fsub]-solution
a answer of Your question is included
[quote:3ij7fsub]for the first time it takes the color but does not refresh the get,
the second time and after the color is always -1 why?[/quote:3ij7fsub]
[img:3ij7fsub]http://www.service-fivewin.de/IMAGES/Floodtest1.bmp[/img:3ij7fsub]
regards
Uwe |
Change color in a bmp | image A is black and white
the handicapped child must take a color on image B and click on part of image A and color the part delimited by the lines.
In your example I am able to take the color from image B but then when I click on image A it does not color the selected area
in an old program done at least 15 years ago I was able to color a specific area (region) in an image of a map of Italy
when I was scrolling through a record in an xbrowse as you can see on this picture
[img:2rr01bmp]https://i.postimg.cc/k5vLVBr1/hte.png[/img:2rr01bmp]
on this application I used FloodFill function
[code=fw:2rr01bmp]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /> <span style="color: #000000;">25</span>, <span style="color: #000000;">10</span> BITMAP oBmp <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"CARTINA"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">127</span>, <span style="color: #000000;">179</span> NOBORDER TRANSPARENT<br />oBmp:<span style="color: #000000;">bPainted</span> := <span style="color: #000000;">{</span> |hDC| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> Empty<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, <span style="color: #00C800;">nil</span>, ;<br /> FloodFill<span style="color: #000000;">(</span> hDC, oBrw:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> <span style="color: #000000;">5</span> <span style="color: #000000;">]</span>, oBrw:<span style="color: #000000;">oTreeItem</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span>, <span style="color: #00C800;">nil</span>, CLR_RED <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:2rr01bmp] |
Change color in a bmp | [quote="ukoenig":1sn24azb]Silvio,
regards
Uwe[/quote:1sn24azb]
Uwe, Now the test colorize all the image and not the area
please try the test
[code=fw:1sn24azb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><br /> <span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> cFile:=<span style="color: #ff0000;">"a.bmp"</span><br /> <span style="color: #00C800;">local</span> cColori:=<span style="color: #ff0000;">"colori.png"</span><br /> <span style="color: #00C800;">local</span> oDlg,oBmp,oImg<br /> <span style="color: #00C800;">local</span> nColor := <span style="color: #000000;">0</span>, oColor<br /> <span style="color: #00C800;">local</span> hdc, nPickRow := <span style="color: #000000;">0</span>, nPickCol := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> oSay1, oSay2, oSay3, oFont<br /> <span style="color: #00C800;">local</span> nColorSet:= <span style="color: #000000;">1</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oHand HAND<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Verdanal"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-12</span> BOLD<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">520</span>, <span style="color: #000000;">520</span><br /><br /> @ <span style="color: #000000;">4</span>,<span style="color: #000000;">1</span> XIMAGE oImg filename cFile <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg<br /> oImg:<span style="color: #000000;">oCursor</span> := oHand<br /> oImg:<span style="color: #000000;">bPainted</span> := < |hDC|<br /> oSay1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSay2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSay3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> ><br /><br /><br /><br /><br /> @ <span style="color: #000000;">220</span>,<span style="color: #000000;">1</span> XIMAGE oBmp filename cColori <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">180</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">220</span>, <span style="color: #000000;">183</span> <span style="color: #0000ff;">get</span> oColor <span style="color: #0000ff;">var</span> ncolor <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> nColor, nColor <span style="color: #0000ff;">UPDATE</span><br /><br /> @ <span style="color: #000000;">190</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay0 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Top, Left, color"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">0</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /> @ <span style="color: #000000;">200</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay1 <span style="color: #0000ff;">var</span> nPickRow <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /> @ <span style="color: #000000;">210</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay2 <span style="color: #0000ff;">var</span> nPickCol <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /> @ <span style="color: #000000;">220</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay3 <span style="color: #0000ff;">var</span> nColor <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /><br /> oBmp:<span style="color: #000000;">oCursor</span> := oHand<br /> oBmp:<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol | <span style="color: #000000;">(</span> ncolor := GETCOLOR<span style="color: #000000;">(</span> oBmp, nRow, nCol <span style="color: #000000;">)</span>, ;<br /> oColor:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span>nColor, nColor<span style="color: #000000;">)</span>, oColor:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,nColorSet:=ncolor <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oImg:<span style="color: #000000;">blClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol | nPickRow := nRow, nPickCol := nCol,;<br /> FILLCOLOR<span style="color: #000000;">(</span>oImg, nPickRow, nPickCol, nColorSet <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> <span style="color: #B900B9;">//-----------------------</span><br /><br /> <span style="color: #00C800;">FUNCTION</span> GETCOLOR<span style="color: #000000;">(</span> oBmp, nRow, nCol <span style="color: #000000;">)</span><br /> hDC := oBmp:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> nColor := GetPixel<span style="color: #000000;">(</span> hDC, nCol, nRow <span style="color: #000000;">)</span><br /> oBmp:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> nColor<br /><br /> <span style="color: #B900B9;">//-----------------------</span><br /><br /> <span style="color: #00C800;">FUNCTION</span> FILLCOLOR<span style="color: #000000;">(</span> oImg, nRow, nCol, nColor <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> hDC:=oImg:<span style="color: #000000;">getDc</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> FloodFill<span style="color: #000000;">(</span> hDC, nRow, nCol, <span style="color: #00C800;">nil</span>,nColor <span style="color: #000000;">)</span><br /> oImg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> <span style="color: #B900B9;">//----------------------</span><br /><br /> </div>[/code:1sn24azb] |
Change color in a bmp | Silvio,
it seems to work now with BMP but I still noticed a problem using JPG <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
Just change these lines
xImage moving and zooming will delete selected colors <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: -->
@ 4,1 XIMAGE oImg filename cFile SIZE 200,200 OF oDlg
[size=150:3c9p7tc9]oImg:nUserControl := 0[/size:3c9p7tc9]
oImg:oCursor := oHand
[size=150:3c9p7tc9]oImg:blClicked := { | nCol, nRow | nPickRow := nRow, nPickCol := nCol,;
[/size:3c9p7tc9]FILLCOLOR(oImg, nPickRow, nPickCol, nColorSet ) }
// -----------
FUNCTION FILLCOLOR( oImg, nRow, nCol, nColor )
LOCAL hDC := oImg:getDc()
FloodFill( hDC, nRow, nCol, nil, nColor )
[color=#FF0000:3c9p7tc9]oImg:SaveToBmp( "A.bmp" )[/color:3c9p7tc9] // save the last result <!-- s:!: --><img src="{SMILIES_PATH}/icon_exclaim.gif" alt=":!:" title="Exclamation" /><!-- s:!: -->
oImg:ReleaseDC()
RETURN NIL
[size=150:3c9p7tc9]The original test-image[/size:3c9p7tc9]
[img:3c9p7tc9]http://www.service-fivewin.de/IMAGES/A.bmp[/img:3c9p7tc9]
[size=150:3c9p7tc9]The test[/size:3c9p7tc9]
[img:3c9p7tc9]http://www.service-fivewin.de/IMAGES/A.jpg[/img:3c9p7tc9]
[size=150:3c9p7tc9]sample from Otto[/size:3c9p7tc9]
[img:3c9p7tc9]http://www.service-fivewin.de/IMAGES/Otto1.jpg[/img:3c9p7tc9]
regards
Uwe |
Change color in a bmp | Uwe,
I made a test (using ExtFloodFill)
[img:10fg78x4]https://i.postimg.cc/7ZMtT4rW/risultato.jpg[/img:10fg78x4]
I do not believe that in fivewin you cannot draw and color a drawing in a uniform way |
Change color in a bmp | Silvio, I think I know where the problem is. Please post your code and the bitmap.
Best regards,
Otto |
Change color in a bmp | [quote="Otto":3qua16rx]Silvio, I think I know where the problem is. Please post your code and the bitmap.
Best regards,
Otto[/quote:3qua16rx]
Otto,
this is the test
[code=fw:3qua16rx]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><br /> <span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cColori:=<span style="color: #ff0000;">"colori.png"</span><br /> <span style="color: #00C800;">local</span> cModello:=<span style="color: #ff0000;">"Modello.jpg"</span><br /> <span style="color: #00C800;">local</span> cFile:=<span style="color: #ff0000;">"da_colorare.jpg"</span><br /> <span style="color: #00C800;">local</span> oDlg,oBmp,oImg,oImgx<br /> <span style="color: #00C800;">local</span> nColor := <span style="color: #000000;">0</span>, oColor<br /> <span style="color: #00C800;">local</span> hdc, nPickRow := <span style="color: #000000;">0</span>, nPickCol := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> oSay1, oSay2, oSay3, oFont<br /> <span style="color: #00C800;">local</span> nColorSet:= <span style="color: #000000;">1</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oHand HAND<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Verdanal"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-12</span> BOLD<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">dialog</span> oDlg <span style="color: #0000ff;">size</span> <span style="color: #000000;">1100</span>, <span style="color: #000000;">500</span><br /><br /> @ <span style="color: #000000;">4</span>,<span style="color: #000000;">1</span> BITMAP oImgx filename cModello <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">270</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> NOBORDER<br /> @ <span style="color: #000000;">4</span>,<span style="color: #000000;">280</span> BITMAP oImg filename cFile <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">260</span>,<span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> NOBORDER<br /> @ <span style="color: #000000;">210</span>,<span style="color: #000000;">260</span> BITMAP oBmp filename cColori <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">50</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> NOBORDER<br /><br /><br /><br /> oImg:<span style="color: #000000;">oCursor</span> := oHand<br /> oImg:<span style="color: #000000;">bPainted</span> := < |hDC|<br /> oSay1:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSay2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oSay3:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> ><br /><br /><br /> @ <span style="color: #000000;">210</span>, <span style="color: #000000;">18</span> <span style="color: #0000ff;">get</span> oColor <span style="color: #0000ff;">var</span> ncolor <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> nColor, nColor <span style="color: #0000ff;">UPDATE</span> NOBORDER<br /> @ <span style="color: #000000;">210</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">say</span> oSay0 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Top, Left, color"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">30</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">0</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /> @ <span style="color: #000000;">200</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay1 <span style="color: #0000ff;">var</span> nPickRow <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /> @ <span style="color: #000000;">210</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay2 <span style="color: #0000ff;">var</span> nPickCol <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /> @ <span style="color: #000000;">220</span>, <span style="color: #000000;">210</span> <span style="color: #0000ff;">say</span> oSay3 <span style="color: #0000ff;">var</span> nColor <span style="color: #0000ff;">size</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #000000;">255</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">UPDATE</span><br /><br /> oBmp:<span style="color: #000000;">oCursor</span> := oHand<br /> oBmp:<span style="color: #000000;">bLClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol | <span style="color: #000000;">(</span> ncolor := GETCOLOR<span style="color: #000000;">(</span> oBmp, nRow, nCol <span style="color: #000000;">)</span>, ;<br /> oColor:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span>nColor, nColor<span style="color: #000000;">)</span>, oColor:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,nColorSet:=ncolor <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oImg:<span style="color: #000000;">blClicked</span> := <span style="color: #000000;">{</span> | nRow, nCol | nPickRow := nRow, nPickCol := nCol,;<br /> FILLCOLOR<span style="color: #000000;">(</span>oImg, nPickRow, nPickCol, nColorSet <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /> oFont:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /> <span style="color: #B900B9;">//-----------------------</span><br /><br /> <span style="color: #00C800;">FUNCTION</span> GETCOLOR<span style="color: #000000;">(</span> oBmp, nRow, nCol <span style="color: #000000;">)</span><br /> hDC := oBmp:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> nColor := GetPixel<span style="color: #000000;">(</span> hDC, nCol, nRow <span style="color: #000000;">)</span><br /> oBmp:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> nColor<br /><br /> <span style="color: #B900B9;">//-----------------------</span><br /><br /> <span style="color: #00C800;">FUNCTION</span> FILLCOLOR<span style="color: #000000;">(</span> oImg, nRow, nCol, nColor <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> hDC:=oImg:<span style="color: #000000;">getDc</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> hBrush := CreateSolidBrush<span style="color: #000000;">(</span> nColor <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> hOld := SelectObject<span style="color: #000000;">(</span>hDC, hBrush<span style="color: #000000;">)</span><br /> ExtFloodFill<span style="color: #000000;">(</span>hDC, nCol, nRow,CLR_WHITE,<span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> SelectObject<span style="color: #000000;">(</span> hDC, hOld <span style="color: #000000;">)</span><br /> DeleteObject<span style="color: #000000;">(</span> hBrush <span style="color: #000000;">)</span><br /> <span style="color: #B900B9;">//FloodFill( hDC, nCol, nRow, nil, nColor )</span><br /> oImg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3qua16rx]
see your maiil |
Change color in a bmp | Hello Silvio,
Great example.
ExtFloodFill only works on one color.
You have in your image at the border another color.
[img:1w3n2eu6]https://mybergland.com/fwforum/silviodug2.jpg[/img:1w3n2eu6]
Store your image as monochrome and all is working fine.
[img:1w3n2eu6]https://mybergland.com/fwforum/dugcolor.jpg[/img:1w3n2eu6]
Thank you for sharing.
Now I have an easter present for my grandchildren.
Best regards,
Otto |
Change color in a bmp | good
[img:vg2cfsit]https://i.postimg.cc/Fz34wK7x/good.png[/img:vg2cfsit]
but there are many white points also |
Change color in a bmp | Silvio, zoom your image, and you will see you have also RGB(204,204,204) inside the white spaces.
You must clean up the image.
Best regards,
Otto |
Change color in a bmp | Otto,
I have many images , How I can clear all ? |
Change color in a bmp | Silvio, maybe Uwe knows a way?
Best regards,
Otto |
Change color in a bmp | Hello Silvio,
Try this online service:
<!-- m --><a class="postlink" href="https://onlinepngtools.com/change-png-color">https://onlinepngtools.com/change-png-color</a><!-- m -->
Best regards,
Otto |
Change color in a bmp | New release ( Otto see on your mail)
[img:hejyxnpr]https://i.postimg.cc/6png9Kdk/nn.png[/img:hejyxnpr] |
Change color of say when mouse is over it | Antonio,
is there a way to change the color of the text of a say-object when the mouse is moved over it and the cursor changes to HAND?
I did this for years with an old class called sensitive say:
[code=fw:2mpvkvfn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">REDEFINE</span> SENSITIVE <span style="color: #0000ff;">SAY</span> geSay2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">903</span> <span style="color: #0000ff;">of</span> SuchFolder:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>;<br /> COLOROVER RGB<span style="color: #000000;">(</span> <span style="color: #000000;">128</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /> BOX TRANSPARENT;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>HelpTopic<span style="color: #000000;">(</span>IDH_SM_CHECK<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> </div>[/code:2mpvkvfn]
But now in Vista the transparent painting with this old class does not work any more.
Thanks for help,
Dietmar |
Change color of say when mouse is over it | Hello Dietmar,
you could try with lWantClick.
Best regards,
Otto
[code=fw:k6apfduh]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oSay:<span style="color: #000000;">lWantClick</span> := .t.<br /> oSay:<span style="color: #000000;">bMMoved</span> = <span style="color: #000000;">{</span>||oSay:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, RGB<span style="color: #000000;">(</span><span style="color: #000000;">128</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:k6apfduh] |
Change color of say when mouse is over it | [code=fw:28x9u9x2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> oSay:<span style="color: #000000;">lWantClick</span> := .t.<br /> oSay:<span style="color: #000000;">bMMoved</span> = <span style="color: #000000;">{</span>||oSay:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, RGB<span style="color: #000000;">(</span><span style="color: #000000;">128</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:28x9u9x2][/quote]
Sorry, but the color does not change...
Dietmar |
Change color of say when mouse is over it | Dietmar,
what version of FW do you use?
Do you have this line in Say class:
[quote:amqldsic]
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TSay
if ... nMsg == WM_NCHITTEST ) // To have a standard behavior on Clicks
[/quote:amqldsic]
Best regards,
Otto |
Change color of say when mouse is over it | [quote="Otto":176zxg4x]Dietmar,
what version of FW do you use?
latest: 9.04
Do you have this line in Say class:
[quote:176zxg4x]
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TSay
if ... nMsg == WM_NCHITTEST ) // To have a standard behavior on Clicks
[/quote:176zxg4x][/quote:176zxg4x]
yes.
Do you get the color change?
Grüße,
Dietmar |
Change color of say when mouse is over it | Hello Dietmar,
yes. As soon as you move the mouse on the control the event is fired and it works.
I only don’t know – there are many ways – what would be the best way and when to change the color back to the original.
I have version 9.02 but I don’t think there was another change in the class.
Best regards,
Otto
[code=fw:i5jwn084]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// A sample showing to to let a SAY accept Clicks events</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#define</span> COLOR_BTNFACE <span style="color: #000000;">15</span><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oDlg, oSay, oCursor<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oCursor HAND<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Test"</span><br /> oSay:<span style="color: #000000;">lWantClick</span> = .t.<br /> oSay:<span style="color: #000000;">bMMoved</span> = <span style="color: #000000;">{</span>|| oSay:<span style="color: #000000;">SetColor</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, RGB<span style="color: #000000;">(</span><span style="color: #000000;">128</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oSay:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oSay:<span style="color: #000000;">oCursor</span> = oCursor<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:i5jwn084] |
Change color of say when mouse is over it | Not very elegant, but this works.
[code=fw:1r9sfvdn]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"urllink.ch"</span><br /><br />.....<br />< other code ><br /> <br />@ <span style="color: #000000;">40</span>, <span style="color: #000000;">20</span> URLLINK oSay URL <span style="color: #ff0000;">'This is a say'</span> ;<br /> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oWnd CLROVER CLR_HRED <span style="color: #0000ff;">FONT</span> oFont<br /><br /><other code><br /><br /> </div>[/code:1r9sfvdn]
Probably a better way would be to derive a class from TUrlLink, with more features for mouseover, like change of font, change of background and foreground colors, attach an action block on click, etc. Or write a class derived from TSay with similar features |
Change columns color at run-time TXBrowse()? *Fixed Now* | Dear All,I try to set color CLR_RED for columns that content 'X' but it's not working.How can I do that? This is image of my sample code.[url=http://img507.imageshack.us/my.php?image=columnscolorof2.jpg:1mbdvymt][img:1mbdvymt]http://img507.imageshack.us/img507/8096/columnscolorof2.th.jpg[/img:1mbdvymt][/url:1mbdvymt][code:1mbdvymt]
#include 'fivewin.ch'
#include 'xbrowse.ch'
FUNCTION Main
local oWnd, oBrw
local aStatus := { {'1','','X','','X'}, ;
{'2','X','X','','X'}, ;
{'3','','','X','X'} }
local n
DEFINE WINDOW oWnd TITLE "Change columns colors"
oBrw := TXBrowse():New( oWnd )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:nFreeze := 1
oBrw:bLDblClick := {|nRow,nCol,nKeyFlag| msginfo( eval(oBrw:acols[oBrw:nAt()]:bStrData) ) }
oBrw:SetArray( aStatus )
for n := 1 to len(aStatus)
oBrw:aCols[n]:bClrStd := {|| { CLR_BLACK, iif(eval(oBrw:aCols[n]:bStrData)='X',CLR_RED,CLR_WHITE) } }
next
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd ON INIT oBrw:SetFocus()
return nil
[/code:1mbdvymt]Regards,Dutch |
Change columns color at run-time TXBrowse()? *Fixed Now* | Dutch,Try this: oBrw:aCols[n]:bClrStd := {|| iif(eval(oBrw:aCols[n]:bStrData)='X',{CLR_BLACK,CLR_RED},{CLR_BLACK,CLR_WHITE } } James |
Change columns color at run-time TXBrowse()? *Fixed Now* | Dear James,It still doesn't work. It likes the eval(oBrw:aCols[n]:bStrData) don't return correctly.[quote="James Bott":1ks2uekl]Dutch,
Try this:
oBrw:aCols[n]:bClrStd := {|| iif(eval(oBrw:aCols[n]:bStrData)='X',{CLR_BLACK,CLR_RED},{CLR_BLACK,CLR_WHITE } }
James[/quote:1ks2uekl]I try this code but still doesn't work.[code:1ks2uekl]
oBrw:aCols[n]:bClrStd := {|| iif(aStatus[oBrw:nArrayAt][n]='X',{CLR_BLACK,CLR_RED},{CLR_BLACK,CLR_WHITE }) } [/code:1ks2uekl] |
Change columns color at run-time TXBrowse()? *Fixed Now* | DutchXbrowse behaves a bit strange on evaluating colors, try it this way oBrw:aCols[I]:bClrStd := {|| {CLR_BLACK,iif(eval(oBrw:aCols[n]:bStrData)='X',CLR_RED,CLR_WHITE ) } }HTHRichard |
Change columns color at run-time TXBrowse()? *Fixed Now* | Dutch,>I try to set color CLR_RED for columns that content 'X' but it's not workingI think you have problem with this logic. Do you want to change the color of the entire colomn if there is a X in any row in the column? If so this is going to be very hard to do. You will need to scan the entire database looking for X's before you decide which color to make the column.You can't do this with a codeblock that is only looking at the current row.Perhaps I don't understand what you are trying to do?James |
Change columns color at run-time TXBrowse()? *Fixed Now* | Dear James,In the past I use TWBrowse() to do as picture and now I would like to change to TXBrowse().[url=http://img440.imageshack.us/my.php?image=twbrowsejo6.jpg:1hj5r458][img:1hj5r458]http://img440.imageshack.us/img440/686/twbrowsejo6.th.jpg[/img:1hj5r458][/url:1hj5r458]This is TWbrowse() code that I use. It is able to change bBkColor, bTextColor at runtime.[code:1hj5r458]
REDEFINE LISTBOX oBrw FIELDS "" ;
ID 103 ;
OF oDlg
oBrw:nAt := 1
oBrw:bLine := { || aRmNo[oBrw:nAt] }
oBrw:bGoTop := { || oBrw:nAt := 1 }
oBrw:bGoBottom := { || oBrw:nAt := Eval( oBrw:bLogicLen ) }
oBrw:bSkip := { | nWant, nOld | nOld := oBrw:nAt, oBrw:nAt += nWant,;
oBrw:nAt := Max( 1, Min( oBrw:nAt, Eval( oBrw:bLogicLen ) ) ),;
oBrw:nAt - nOld }
oBrw:bLogicLen:= { || Len( aRmNo ) }
oBrw:SetArray( aRmNo )
oBrw:lDrawSelect := .T.
oBrw:aColSizes := aSizes
oBrw:aHeaders := aHead
oBrw:aJustify := aJust
oBrw:aHJustify := aHJust
oBrw:lAdjBrowse := .F.
oBrw:lAdjLastCol := .F.
oBrw:lCellStyle := .T.
oBrw:nLineStyle := 11
oBrw:nFreeze := 1
oBrw:nLineHeight := 20
oBrw:nHeaderHeight:= 22
oBrw:lMChange := .F.
oBrw:bGoLeft := {|| oBrw:nColAct > 2 }
oBrw:bBkColor := {|nRow,nCol,nStyle| if(nStyle=0,SetClr(oBrw:nAt,nCol,nStyle,oBrw,aRmSt),) }
oBrw:bTextColor := {|nRow,nCol,nStyle| if(nStyle=1,SetClr(oBrw:nAt,nCol,nStyle,oBrw,aRmSt),) }
* oBrw:bFont := {|nRow,nCol,nStyle| if(nStyle=1.and.aDate[nCol]=1, oFnt:hFont , if(nStyle=0.or.nStyle=3, oFont:hFont , ) ) }
oBrw:bChange := {|| oBrw:Refresh() }
oBrw:nClrNFFore := oBrw:nClrText
oBrw:nClrNFBack := oBrw:nClrPane
[/code:1hj5r458]Regards,Dutch |
Change columns color at run-time TXBrowse()? *Fixed Now* | Dear Richard,Your example is the same first sample above and It doesn't work correctly.[quote="Richard Chidiak":21b6g1yz]Dutch
Xbrowse behaves a bit strange on evaluating colors, try it this way
oBrw:aCols[I]:bClrStd := {|| {CLR_BLACK,iif(eval(oBrw:aCols[n]:bStrData)='X',CLR_RED,CLR_WHITE ) } }
HTH
Richard[/quote:21b6g1yz]Regards,Dutch |
Change columns color at run-time TXBrowse()? *Fixed Now* | Please modify the code like this[code:27ibjq64]
for n := 1 to len(aStatus)
oBrw:aCols[n]:bClrStd := { || CellColor( oBrw, n ) }
next
...
...
//-----------------------------//
static function CellColor( oBrw, n )
return {|| { CLR_BLACK, iif(eval(oBrw:aCols[n]:bStrData)='X',CLR_RED,CLR_WHITE) } }
//-----------------------------//
[/code:27ibjq64]The problem is because of using loop variable to construct a codeblock. |
Change columns color at run-time TXBrowse()? *Fixed Now* | Dear nageswaragunupudiI try as your suggestion and now it shows correctly as following code[quote="nageswaragunupudi":9vf975im]Please modify the code like this
[code:9vf975im]
for n := 1 to len(aStatus)
oBrw:aCols[n]:bClrStd := { || CellColor( oBrw, n ) }
next
...
...
//-----------------------------//
static function CellColor( oBrw, n )
return {|| { CLR_BLACK, iif(eval(oBrw:aCols[n]:bStrData)='X',CLR_RED,CLR_WHITE) } }
//-----------------------------//
[/code:9vf975im]
The problem is because of using loop variable to construct a codeblock.[/quote:9vf975im]
[url=http://img216.imageshack.us/my.php?image=columnscolorrf3.jpg:9vf975im][img:9vf975im]http://img216.imageshack.us/img216/8127/columnscolorrf3.th.jpg[/img:9vf975im][/url:9vf975im]
[code:9vf975im]
#include 'fivewin.ch'
#include 'xbrowse.ch'
FUNCTION Main
local oWnd, oBrw
local aStatus := { {'1','','X','','X'}, ;
{'2','X','X','','X'}, ;
{'3','','','X','X'} }
local n
DEFINE WINDOW oWnd TITLE "Change columns colors"
oBrw := TXBrowse():New( oWnd )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:nFreeze := 1
oBrw:bLDblClick := {|nRow,nCol,nKeyFlag| msginfo( eval(oBrw:acols[oBrw:nAt()]:bStrData) ) }
oBrw:SetArray( aStatus )
for n := 1 to len(aStatus[1])
oBrw:aCols[n]:bClrStd := CellColor( oBrw, n )
next
/*
for n := 1 to len(aStatus)
* oBrw:aCols[n]:bClrStd := {|| { CLR_BLACK, iif(eval(oBrw:aCols[n]:bStrData)='X',CLR_RED,CLR_WHITE) } }
* oBrw:aCols[n]:bClrStd := {|| iif(eval(oBrw:aCols[n]:bStrData)='X',{CLR_BLACK,CLR_RED},{CLR_BLACK,CLR_WHITE }) }
oBrw:aCols[n]:bClrStd := {|| iif(aStatus[oBrw:nArrayAt][n]='X',{CLR_BLACK,CLR_RED},{CLR_BLACK,CLR_WHITE }) }
next
*/
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd ON INIT oBrw:SetFocus()
return nil
static function CellColor( oBrw, n )
return {|| { CLR_HCYAN, iif(eval(oBrw:aCols[n]:bStrData)='X',CLR_RED,CLR_WHITE) } }
[/code:9vf975im]Regards,Dutch |
Change columns color at run-time TXBrowse()? *Fixed Now* | DutchThis is a piece of code from my application, it works OK[code:34p1af4z]
FOR I = 1 TO LEN(oBrw:aCols)
oBrw:aCols[I]:nWidth := ASIZE[I]
oBrw:aCols[I]:oDataFont := {||IIF(DET->SDETAIL,TABCOL[12],IIF(DET->ENR = "3" .OR. DET->ENR = "1" ,TABOBJ[04], TABCOL[11] ) ) }
oBrw:aCols[I]:bClrStd := {|| {CLR_BLUE, If( DET->SDETAIL,CLR_YELLOW,CLR_WHITE) } }
NEXT
[/code:34p1af4z]HTHRichard |
Change columns color at run-time TXBrowse()? *Fixed Now* | It work as spectation.Thanks to all,Dutch |
Change columns title array on line - Resolved - | I have an array 16 columns
with a radiomenu I change a nvalue
[img:15rb3xwp]https://i.postimg.cc/nLjFwf78/bu.jpg[/img:15rb3xwp]
I wish change the title of [b:15rb3xwp]SetGroupHeader[/b:15rb3xwp]
I made
:SetGroupHeader( Iif(nRadio=1,"Somme estratti","Distanze cilometriche" ), 7, 16 ,oFontsmall,,30)
How I can to refresh the setgroupHeader ? |
Change columns title array on line - Resolved - | [code=fw:tkretjqu]<div class="fw" id="{CB}" style="font-family: monospace;">AEval<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">{</span> |o| o:<span style="color: #000000;">cGrpHdr</span> := Iif<span style="color: #000000;">(</span>nRadio=<span style="color: #000000;">1</span>,<span style="color: #ff0000;">"Somme estratti"</span>,<span style="color: #ff0000;">"Distanze cilometriche"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">10</span> <span style="color: #000000;">)</span><br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:tkretjqu] |
Change columns title array on line - Resolved - | [quote="nageswaragunupudi":3fjspa2j][code=fw:3fjspa2j]<div class="fw" id="{CB}" style="font-family: monospace;">AEval<span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">{</span> |o| o:<span style="color: #000000;">cGrpHdr</span> := Iif<span style="color: #000000;">(</span>nRadio=<span style="color: #000000;">1</span>,<span style="color: #ff0000;">"Somme estratti"</span>,<span style="color: #ff0000;">"Distanze cilometriche"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">7</span>, <span style="color: #000000;">10</span> <span style="color: #000000;">)</span><br />oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:3fjspa2j][/quote:3fjspa2j]
thanks |
Change cursor to hand when mouseover desired columns | Dear All,
I need to change cursor to Hand when MouseOver on desired columns for notify user that which columns can click.
Thanks in advance for any help or ideas. |
Change dbf extension form dbf to blabla | I have seen that some programmers use instead of dbf own extensions.
database.dbf database.xxx
Is this easy to do and if yes how?
Thanks in advance
Otto |
Change dbf extension form dbf to blabla | Yes, it is as easy as renaming the file and specifying the file extension in the USE command.
EMG[/i] |
Change dbf extension form dbf to blabla | Thank you.
Regards
Otto |
Change field in get | Hello,
How can I change a getfield in a dialog on the fly?
I have a code like
[code=fw:80n4j93i]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> ovar <span style="color: #0000ff;">VAR</span> artikel->omschrijv <span style="color: #0000ff;">ID</span> <span style="color: #000000;">202</span> <span style="color: #0000ff;">OF</span> oDlg</div>[/code:80n4j93i]
I want to change artikel->omschrijv to artikel->omschrijv1 when I press a button.
I have try
[quote:80n4j93i]ovar:oGet:bSETGET( artikel->omschrijv1)[/quote:80n4j93i]
but get an compile error
Thanks,
Marc |
Change field in get | Marc
I would assign your database field to a variable then with your button, re-assign the variable then refresh your object ..
Something like this :
[code=fw:r10mj7h4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />cOmschrijv := artikel->omschrijv<br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oVar <span style="color: #0000ff;">VAR</span> cOmschrijv <span style="color: #0000ff;">ID</span> <span style="color: #000000;">202</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /><span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">button</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Change"</span> ;<br /> <span style="color: #0000ff;">ACTION</span><span style="color: #000000;">(</span> cOmschrijv := artikel->omschrijv1, oVar:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, SysReFresh<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oVar:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> </div>[/code:r10mj7h4]
Rick Lipkin |
Change field in get | Rick,
Thanks for your reply.
I just found an other way.
[code=fw:311mxjk6]<div class="fw" id="{CB}" style="font-family: monospace;">ovar:<span style="color: #000000;">oget</span>:<span style="color: #000000;">block</span> := bSETGET<span style="color: #000000;">(</span>artikel->omschrijv1<span style="color: #000000;">)</span><br />ovar:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:311mxjk6]
Regards,
Marc |
Change field in tMultiGet | Hi,
With a normal Get I can use
[code=fw:3czr5rqx]<div class="fw" id="{CB}" style="font-family: monospace;">vGetlist:<span style="color: #000000;">oget</span>:<span style="color: #000000;">block</span> := bSETGET<span style="color: #000000;">(</span>instaanm->aanmb1<span style="color: #000000;">)</span></div>[/code:3czr5rqx]
to change a fieldname in guntime, but it doesn't work with a multget.
I get the error
[quote:3czr5rqx]Error description: Error BASE/1004 Message not found: TGET:OMULTIGET[/quote:3czr5rqx]
What can I use? |
Change field in tMultiGet | Marc,
[quote="Marc Vanzegbroeck":j1s7piiz]Hi,
With a normal Get I can use
[code=fw:j1s7piiz]<div class="fw" id="{CB}" style="font-family: monospace;">vGetlist:<span style="color: #000000;">oget</span>:<span style="color: #000000;">block</span> := bSETGET<span style="color: #000000;">(</span>instaanm->aanmb1<span style="color: #000000;">)</span></div>[/code:j1s7piiz]
to change a fieldname in guntime, but it doesn't work with a multget.
I get the error
[quote:j1s7piiz]Error description: Error BASE/1004 Message not found: TGET:OMULTIGET[/quote:j1s7piiz]
What can I use?[/quote:j1s7piiz]
With both class try:
[code=fw:j1s7piiz]<div class="fw" id="{CB}" style="font-family: monospace;">vGetlist:<span style="color: #000000;">bSetGet</span> := bSETGET<span style="color: #000000;">(</span>instaanm->aanmb1<span style="color: #000000;">)</span></div>[/code:j1s7piiz]
EMG |
Change field in tMultiGet | Enrico,
I just found it 10 minutes ago myself, and wanted to post the result.
Thanks anyway!! |
Change file time and date | Hi,
I need to change the date and time of a file.
I tried with the SetFdate() FW's function but an "not implemented yet for 32 bit" error message appairs.
Is there any tourn-around available ?
Thanks in advance
Regards,
Marco Turco |
Change file time and date | Try SetDate( nDay, nMonth, nYear )
EMG |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.