Skip to content

Commit

Permalink
Replace cryptocurrency logos with hight quality images
Browse files Browse the repository at this point in the history
  • Loading branch information
ArdeshirV committed Jun 27, 2021
1 parent ae801fc commit d5a43b4
Show file tree
Hide file tree
Showing 136 changed files with 15,448 additions and 4,060 deletions.
2 changes: 1 addition & 1 deletion ArdeshirV.Forms.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArdeshirV.Forms", "Ardeshir
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestForms", "Test ArdeshirV.Forms\TestForms.csproj", "{2B6ADB0D-75BD-4EC1-8A29-29DE29363DB5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArdeshirV.Utilities.QrCode", "ArdeshirV.Utility.QrCode\ArdeshirV.Utilities.QrCode.csproj", "{39A1B686-75A9-4189-A328-51C96BB4B6EB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ArdeshirV.Tools.QrCode", "ArdeshirV.Tools.QrCode\ArdeshirV.Tools.QrCode.csproj", "{39A1B686-75A9-4189-A328-51C96BB4B6EB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions ArdeshirV.Forms/ArdeshirV.Forms.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@
<None Include="app.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ArdeshirV.Utility.QrCode\ArdeshirV.Utilities.QrCode.csproj">
<ProjectReference Include="..\ArdeshirV.Tools.QrCode\ArdeshirV.Tools.QrCode.csproj">
<Project>{39a1b686-75a9-4189-a328-51c96bb4b6eb}</Project>
<Name>ArdeshirV.Utilities.QrCode</Name>
<Name>ArdeshirV.Tools.QrCode</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion ArdeshirV.Forms/AssemblyAttributeAccessors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#endregion
//-----------------------------------------------------------------------------------
namespace ArdeshirV.Utilities
namespace ArdeshirV.Tools
{
public static class Extractor
{
Expand Down
2 changes: 1 addition & 1 deletion ArdeshirV.Forms/ComboBoxImage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.IO;
using System.Drawing;
using ArdeshirV.Forms;
using ArdeshirV.Utilities;
using ArdeshirV.Tools;
using System.Windows.Forms;
using AVFR = ArdeshirV.Forms.Properties;

Expand Down
42 changes: 31 additions & 11 deletions ArdeshirV.Forms/FormAbout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
using System.IO;
using System.Drawing;
using System.Diagnostics;
using ArdeshirV.Utilities;
using ArdeshirV.Tools;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing.Imaging;
using qr=ArdeshirV.Utilities.QrCode;
using qr=ArdeshirV.Tools.QrCode;

#endregion
//---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -111,12 +111,13 @@ protected FormAbout(FormAboutData data) : base(data.Owner)

protected void InitFormAbout(FormAboutData d)
{
data = d;
data = d;
AcceptButton = m_btnOk;
SetURL(linkLabelURL, d.URL);
SetEmail(linkLabelEmail, d.Email);
m_lblApplicationName.Text = d.AppName;
Text = String.Format("About {0}", d.AppName);
tabControl.Appearance = TabAppearance.Normal;
m_btnSysteminfo.Enabled = File.Exists(m_strSystemInfo);

comboBoxDonation.Items.Clear();
Expand Down Expand Up @@ -158,7 +159,7 @@ protected void InitFormAbout(FormAboutData d)

if(data.Licenses.Count <= 0)
tabControl.TabPages.Remove(tabPageLicense);
}
}
//-------------------------------------------------------------------------------
public static FormAbout Show(FormAboutData Data)
{
Expand Down Expand Up @@ -425,7 +426,7 @@ void ComboBoxDonationsSelectedIndexChanged(object sender, EventArgs e)
_ImageListCurrencies.Images.Clear();
foreach(Donation d in donations) {
comboBoxDonationCurrencies.Items.Add(d.Name);
if(d.Logo != null)
//if(d.Logo != null) // Null is better than nothing
_ImageListCurrencies.Images.Add(d.Name, d.Logo);
}
if(comboBoxDonationCurrencies.Items.Count > 0)
Expand All @@ -435,7 +436,7 @@ void ComboBoxDonationsSelectedIndexChanged(object sender, EventArgs e)
}
//-------------------------------------------------------------------------------
void ComboBoxDonationCurrenciesSelectedIndexChanged(object sender, EventArgs e)
{
{//10,355,000
_donationSelected = null;
toolTip.SetToolTip(pictureBoxDonation, string.Empty);
if(comboBoxDonation.SelectedIndex >= 0) {
Expand All @@ -452,7 +453,7 @@ void ComboBoxDonationCurrenciesSelectedIndexChanged(object sender, EventArgs e)
_donationSelected = d;
richTextBoxDonation.Clear();
richTextBoxDonation.Text = d.Address;
pictureBoxDonation.Image = GetQRCodeImage(d.Address);
SetQrCodeImageOnPictureBox(pictureBoxDonation, d);
toolTip.SetToolTip(pictureBoxDonation, _stringQRTip);
break;
}
Expand Down Expand Up @@ -497,18 +498,37 @@ void ComboBoxCreditComponentSelectedIndexChanged(object sender, EventArgs e)
_imageListCreditsAvators.Images.Clear();
foreach(Credit c in credits) {
comboBoxImageCreditNames.Items.Add(c.Name);
if(c.Avator != null)
//if(c.Avator != null)
_imageListCreditsAvators.Images.Add(c.Name, c.Avator);
}
if(comboBoxImageCreditNames.Items.Count > 0)
comboBoxImageCreditNames.SelectedIndex = 0;
}
}
}
//-------------------------------------------------------------------------------
private void SetQrCodeImageOnPictureBox(PictureBox pb, Donation d)
{
const int Divider = 3, marj = 1;
int pbWidth = pb.DisplayRectangle.Width, wDiv5 = pbWidth / Divider;
int pbHeight = pb.DisplayRectangle.Height, hDiv5 = pbHeight / Divider;
int x1 = wDiv5 * marj, y1 = hDiv5 * marj;
Brush brush = new SolidBrush(Color.FromArgb(220, Color.White));
Image QrCode = GetQRCodeImage(d.Address);
Bitmap canvas = new Bitmap(pbWidth, pbHeight);
Graphics g = Graphics.FromImage(canvas);
g.DrawImage(QrCode, 0, 0, pbWidth, pbHeight);
g.FillEllipse(brush, x1, y1, hDiv5, hDiv5); // Draw shadow
g.DrawImage(d.Logo, x1, y1, hDiv5, hDiv5);
pb.SuspendLayout();
pb.Image = canvas;
pb.ResumeLayout();
brush.Dispose();
}
//-------------------------------------------------------------------------------
private Image GetQRCodeImage(string Data)
{
return qr.QrCode.EncodeText(Data, qr.QrCode.Ecc.High).ToBitmap(4, 1);
return qr.QrCode.EncodeText(Data, qr.QrCode.Ecc.High).ToBitmap(5, 1);
}
//-------------------------------------------------------------------------------
private void m_lnkMailTo_LinkClicked(object sender,
Expand All @@ -517,7 +537,7 @@ private void m_lnkMailTo_LinkClicked(object sender,
string stringEmail = Extractor.ExtractFirstEmail(data.Email);
if(stringEmail != string.Empty) {
(sender as LinkLabel).LinkVisited = true;
System.Diagnostics.Process.Start("mailto:" + stringEmail);
Process.Start("mailto:" + stringEmail);
}
}
//-------------------------------------------------------------------------------
Expand Down Expand Up @@ -560,7 +580,7 @@ void ToolStripMenuDonationSaveAsClick(object sender, EventArgs e)
sfd.FileName = string.Format("{0} {1}",
_donationSelected.Name,
_donationSelected.Address).Replace(':', ' ');

if(sfd.ShowDialog(this) == DialogResult.OK)
pictureBoxDonation.Image.Save(sfd.FileName, ImageFormat.Png);
}
Expand Down
61 changes: 32 additions & 29 deletions ArdeshirV.Forms/FormAboutData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
using System.IO;
using System.Drawing;
using System.Reflection;
using ArdeshirV.Utilities;
using ArdeshirV.Tools;
using System.Windows.Forms;
using System.ComponentModel;
using System.Collections.Generic;
using ArdeshirV.Forms.Properties;
using ArdeshirV.Utilities.QrCode;
using qr=ArdeshirV.Utilities.QrCode;
using ArdeshirV.Tools.QrCode;
using qr=ArdeshirV.Tools.QrCode;

#endregion
//-----------------------------------------------------------------------------------
Expand Down Expand Up @@ -324,14 +324,14 @@ private void AddDefaults()
_donations.Add(aaa.AssemblyProduct, DefaultDonationList.Items);

_copyrights.Add(aaa.AssemblyProduct, new Copyright(this, Resources.ArdeshirV_Forms_Logo));
_licenses.Add(aaa.AssemblyProduct, new License("LGPLv3+", Resources.LICENSE, Resources.LGPLv3));
_credits.Add(aaa.AssemblyProduct, new Credit[] { DefaultCreditList.GetItem("ArdeshirV") });
_licenses.Add(aaa.AssemblyProduct, new License("LGPLv3+", Resources.LGPL_LICENSE, Resources.LGPLv3));
_credits.Add(aaa.AssemblyProduct, new Credit[] { DefaultCreditList.GetItem("ArdeshirV.Forms") });

aaa = new AssemblyAttributeAccessors(qr.QrCode.Ecc.High);
_copyrights.Add(aaa.AssemblyProduct, new Copyright(qr.QrCode.Ecc.High, qr.Res.Logo));
_licenses.Add(aaa.AssemblyProduct, new License("MIT", qr.Res.License, qr.Res.LicenseLogo));
_credits.Add(aaa.AssemblyProduct, new Credit[] {
DefaultCreditList.GetItem("ArdeshirV.QrCode"),
DefaultCreditList.GetItem("ArdeshirV.Tools.QrCode"),
DefaultCreditList.GetItem("Manuel Bleichenbacher"),
DefaultCreditList.GetItem("Nayuki Project")
});
Expand All @@ -357,25 +357,28 @@ static DefaultDonationList()
// how to adding your own addresses easily above mine.
// You can find the best sample code in TestForms/FormMainTest.cs file.
_donations = new Donation[] {
new Donation("Bitcoin", "1GtjrxH6t8om8KwHAHKpcG5SAwVSsm4PEi", Resources.Bitcoin),
new Donation("Ethereum", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", Resources.Ethereum),
new Donation("Tron", "TCB6uBci8mw1P4e2xikSGbyHcFjNCFphXr", Resources.Tron),
new Donation("TrueUSD", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", Resources.TrueUSD),
new Donation("USDTether", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", Resources.USDTether),
new Donation("Binance", "bnb15qwa7kl46ledh5zqqynmy2tqw92mhzuwmap6sf", Resources.Binance),
new Donation("Nano", "nano_3feuiaogay8zbsfye5ob1xp7obwb4syfpmc4pcb7ctckhh5z8671q4uzm9tc", Resources.Nano),
new Donation("Stellar", "GCMALSIYBJT74K5SKJFHMLBJRWFCO6EPIKQ4DO6C7ER4QAYIMTQSOOWI", Resources.Stellar),
new Donation("Ripple", "raBw695Qnkt5RNTxTcyGFPzC5yFFHYztfR", Resources.Ripple),
new Donation("Cardano", "DdzFFzCqrhsoSn5qvqRTovUkr1XHWy9LvbvDHVYFoFFyxAJkf1bT4X4ySpm8DwFqDo3EWAn934W9WfipbSNiXTcRzEqLP1y5KyAfMByJ", Resources.Cardano),
new Donation("Neo", "AXqbLBWhcrFrjumvrm8nW9iYaUFoKML17b", Resources.Neo),
new Donation("NEM", "NDXCTS2ITWO4J33YPL7AMHSGOIFRJSTBWSDZ4C3P", Resources.NEM),
new Donation("Qtum", "QddGvqLg5yTi2J2DvixZVFgA1rpm5RAq2x", Resources.Qtum),
new Donation("Litecoin", "LdfYVr2Lgyuwp9K5Dk4aUsUbUQ2Rr5TA1n", Resources.Litecoin),
new Donation("BitcoinCash", "bitcoincash:qzqsse2w6vqkqylfvkuqdvmgpl34zyq2cvwneunpyl", Resources.BitcoinCash),
new Donation("Dash", "XhsE3ntLYdKMbT4JptTvURqyu9RKuypDCf", Resources.Dash),
new Donation("Verge", "DRviBtskt1M6BBTpAoNvF3qLrpKTN3mb7P", Resources.Verge),
new Donation("ZCash", "t1ZnspKa3XFijtUAG6yKHsM3y6Bdb7C8HKA", Resources.ZCash),
new Donation("Monero", "42dJ7dWZjHyV4bzL4uVcS6cYnNfSvtXQyJaZ83yj4xALMiZoEMuja5SdcMHZS3Ai1eDCF9D5RDzgrHoyngckf38yC2MM42y", Resources.Monero)
new Donation("Bitcoin", "1GtjrxH6t8om8KwHAHKpcG5SAwVSsm4PEi", GlobalResouces.CurrencyLogos.Bitcoin),
new Donation("Ethereum", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", GlobalResouces.CurrencyLogos.Ethereum),
new Donation("Tron", "TCB6uBci8mw1P4e2xikSGbyHcFjNCFphXr", GlobalResouces.CurrencyLogos.Tron),
new Donation("PaxosStandard", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", GlobalResouces.CurrencyLogos.PaxosStandard),
new Donation("USDTether", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", GlobalResouces.CurrencyLogos.USDTether),
new Donation("PaxGold", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", GlobalResouces.CurrencyLogos.PaxGold),
new Donation("TetherGold", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", GlobalResouces.CurrencyLogos.TetherGold),
new Donation("TrueUSD", "0x6E6465394D14975956cd1BD37ab4E35F2C60300E", GlobalResouces.CurrencyLogos.TrueUSD),
new Donation("Binance", "bnb15qwa7kl46ledh5zqqynmy2tqw92mhzuwmap6sf", GlobalResouces.CurrencyLogos.Binance),
new Donation("Nano", "nano_3feuiaogay8zbsfye5ob1xp7obwb4syfpmc4pcb7ctckhh5z8671q4uzm9tc", GlobalResouces.CurrencyLogos.Nano),
new Donation("Stellar", "GCMALSIYBJT74K5SKJFHMLBJRWFCO6EPIKQ4DO6C7ER4QAYIMTQSOOWI", GlobalResouces.CurrencyLogos.Stellar),
new Donation("Ripple", "raBw695Qnkt5RNTxTcyGFPzC5yFFHYztfR", GlobalResouces.CurrencyLogos.XRP),
new Donation("Cardano", "DdzFFzCqrhsoSn5qvqRTovUkr1XHWy9LvbvDHVYFoFFyxAJkf1bT4X4ySpm8DwFqDo3EWAn934W9WfipbSNiXTcRzEqLP1y5KyAfMByJ", GlobalResouces.CurrencyLogos.Cardano),
new Donation("Neo", "AXqbLBWhcrFrjumvrm8nW9iYaUFoKML17b", GlobalResouces.CurrencyLogos.Neo),
new Donation("NEM", "NDXCTS2ITWO4J33YPL7AMHSGOIFRJSTBWSDZ4C3P", GlobalResouces.CurrencyLogos.Nem),
new Donation("Qtum", "QddGvqLg5yTi2J2DvixZVFgA1rpm5RAq2x", GlobalResouces.CurrencyLogos.Qtum),
new Donation("Litecoin", "LdfYVr2Lgyuwp9K5Dk4aUsUbUQ2Rr5TA1n", GlobalResouces.CurrencyLogos.Litecoin),
new Donation("BitcoinCash", "bitcoincash:qzqsse2w6vqkqylfvkuqdvmgpl34zyq2cvwneunpyl", GlobalResouces.CurrencyLogos.BitcoinCash),
new Donation("Dash", "XhsE3ntLYdKMbT4JptTvURqyu9RKuypDCf", GlobalResouces.CurrencyLogos.Dash),
new Donation("Verge", "DRviBtskt1M6BBTpAoNvF3qLrpKTN3mb7P", GlobalResouces.CurrencyLogos.Verge),
new Donation("ZCash", "t1ZnspKa3XFijtUAG6yKHsM3y6Bdb7C8HKA", GlobalResouces.CurrencyLogos.ZCash),
new Donation("Monero", "42dJ7dWZjHyV4bzL4uVcS6cYnNfSvtXQyJaZ83yj4xALMiZoEMuja5SdcMHZS3Ai1eDCF9D5RDzgrHoyngckf38yC2MM42y", GlobalResouces.CurrencyLogos.Monero)
};
_list = new Dictionary<string, Donation>();
foreach(Donation d in _donations)
Expand Down Expand Up @@ -420,8 +423,8 @@ static DefaultCreditList()
// You can find the best sample code in TestForms/FormMainTest.cs file.
const string strCreditArdeshirVQrCode=
@"ArdeshirV downgrade the https://github.com/manuelbl/QrCodeGenerator project to C# 2.0 to use it with ArdeshirV.Forms Project.
QrCode: https://ardeshirv.github.io/ArdeshirV.Utility.QrCode
Github: https://github.com/ArdeshirV/ArdeshirV.Utility.QrCode
QrCode: https://ardeshirv.github.io/ArdeshirV.Tools.QrCode
Github: https://github.com/ArdeshirV/ArdeshirV.Tools.QrCode
Email: [email protected]";

const string strCreditArdeshirV =
Expand All @@ -441,8 +444,8 @@ static DefaultCreditList()
QrCodeGenerator: https://github.com/manuelbl/QrCodeGenerator";

_credits = new Credit[] {
new Credit("ArdeshirV.QrCode", strCreditArdeshirVQrCode, Resources.ArdeshirV),
new Credit("ArdeshirV", strCreditArdeshirV, Resources.ArdeshirV),
new Credit("ArdeshirV.Tools.QrCode", strCreditArdeshirVQrCode, Resources.ArdeshirV),
new Credit("ArdeshirV.Forms", strCreditArdeshirV, Resources.ArdeshirV),
new Credit("Nayuki Project", strCreditNayuki, Res.NayukiAvator),
new Credit("Manuel Bleichenbacher", strCreditBleichenbacher, Res.ManuelBleichenbacherAvator)
};
Expand Down
2 changes: 1 addition & 1 deletion ArdeshirV.Forms/FormMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

using System;
using System.Drawing;
using ArdeshirV.Utilities;
using ArdeshirV.Tools;
using System.Windows.Forms;
using System.Collections.Generic;
using ArdeshirV.Forms.Properties;
Expand Down
Loading

0 comments on commit d5a43b4

Please sign in to comment.