Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
This documentation provides a comprehensive guide on how to set the colorscheme for barcodes using the Aspose.BarCode Cloud SDK for Dart. The API allows customization of barcode appearance, including foreground and background colors, ensuring your barcodes match your design needs.
The GenerateApi
interface includes methods to generate barcodes using different request formats:
The foregroundColor
and backgroundColor
properties enable you to define the colors for the barcode:
Both properties accept standard color names or ARGB values (e.g., AliceBlue
or #FF000000
).
import 'dart:io';
import 'dart:typed_data';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final envToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (envToken != null) {
return Configuration(accessToken: envToken);
} else {
return Configuration(
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
clientSecret:
"Client Secret from https://dashboard.aspose.cloud/applications",
);
}
}
Future<void> main() async {
final configuration = makeConfiguration();
final apiClient = ApiClient(configuration);
final generateApi = GenerateApi(apiClient);
final fileName = "${Directory.current.path}${Platform.pathSeparator}qr.png";
final Uint8List response = await generateApi.generate(
EncodeBarcodeType.QR,
"https://products.aspose.cloud/barcode/family/",
foregroundColor: "DarkBlue",
backgroundColor: "LightGray",
imageFormat: BarcodeImageFormat.Png,
);
await File(fileName).writeAsBytes(response);
print("File '$fileName' generated.");
}
Result Image is:
import 'dart:io';
import 'dart:typed_data';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final envToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (envToken != null) {
return Configuration(accessToken: envToken);
} else {
return Configuration(
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
clientSecret:
"Client Secret from https://dashboard.aspose.cloud/applications",
);
}
}
Future<void> main() async {
final configuration = makeConfiguration();
final apiClient = ApiClient(configuration);
final generateApi = GenerateApi(apiClient);
final file = File(
"${Directory.current.path}${Platform.pathSeparator}Pdf417.png",
);
final imageParams = BarcodeImageParams();
imageParams.foregroundColor = "#FF5733";
imageParams.backgroundColor = "#FFFFFF";
imageParams.imageFormat = BarcodeImageFormat.Jpeg;
final generateParams = GenerateParams(
EncodeBarcodeType.Pdf417,
EncodeData("Aspose.BarCode.Cloud", EncodeDataType.StringData),
imageParams,
);
final Uint8List response = await generateApi.generateBody(generateParams);
file.writeAsBytes(response);
print("File '${file.path}' generated.");
}
Result Image is:
import 'dart:io';
import 'dart:typed_data';
import 'package:aspose_barcode_cloud/aspose_barcode_cloud.dart';
Configuration makeConfiguration() {
final envToken = Platform.environment['TEST_CONFIGURATION_ACCESS_TOKEN'];
if (envToken != null) {
return Configuration(accessToken: envToken);
} else {
return Configuration(
clientId: "Client Id from https://dashboard.aspose.cloud/applications",
clientSecret:
"Client Secret from https://dashboard.aspose.cloud/applications",
);
}
}
Future<void> main() async {
final configuration = makeConfiguration();
final apiClient = ApiClient(configuration);
final generateApi = GenerateApi(apiClient);
final fileName =
'${Directory.current.path}${Platform.pathSeparator}Code39.png';
final Uint8List response = await generateApi.generateMultipart(
EncodeBarcodeType.Code39, "Aspose",
foregroundColor: "Green",
backgroundColor: "Yellow",
imageFormat: BarcodeImageFormat.Gif);
await File(fileName).writeAsBytes(response);
print("File '$fileName' generated.");
}
Result Image is:
With GenerateApi
in Aspose.BarCode Cloud SDK for Dart, you can easily generate barcodes with customized colors. Whether you prefer GET, POST with JSON, or multipart form POST, the flexibility of this API ensures seamless integration and customization of barcodes in your applications.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.