ajiangfan的博客

希望能拥有一个思维捕捉器

Direct2D实现文字的描边和填充

一、实现思路 通过继承IDWriteTextRenderer定义自己的文本渲染类并重写DrawGlyphRun方法,最终将该类实例作为 IDWriteTextLayout::Draw的参数传入进行文本的绘制。 二、代码实现 1、自定义文本渲染类 class CustomTextRenderer :...

2019-01-19 16:28:47

阅读数 107

评论数 0

Direct2D实现文字镜像阴影

一、实现思路 先绘制文字阴影部分,绘制阴影文本后应用3DTransform与高斯模糊特效,最后再正常绘制一次文本主体。 二、实现代码 hr = m_pDWriteFactory->CreateTextFormat( sc_fontNa...

2019-01-19 14:04:16

阅读数 76

评论数 0

jack在64位win10下引起程序崩溃问题的解决方法

0、问题背景 自己的程序调用libjack64.dll启动时就发生异常崩溃,自己的开发环境是64位win10,在64位win7下测试可以正常运行。针对这个问题尝试了一些解决方案后,最终确定是使用的libjack64.dll和自己的应用程序库不兼容所导致的。 1、尝试使用weak_libjack...

2018-08-04 11:21:18

阅读数 197

评论数 0

Tif文件与JPG文件之间的合并拆分实现(使用LibTIFF与OpenCV)

以下是使用LibTiff与OpenCV在win32控制台程序中实现tif文件与jpg文件之间的转换。 将一个tif文件拆分为一或多张jpg图片: #include <afxwin.h> #include <afx.h&a...

2018-03-23 17:15:28

阅读数 934

评论数 2

Longest Common Prefix(最长相同前缀)

Write a function to find the longest common prefix string amongst an array of strings.(找出字符串数组中的最长相同前缀字符串)1.个人分析 思路一:采用BF法。首先取第一个字符串作为比较字符串,然后将该字符串的...

2017-01-06 14:58:13

阅读数 965

评论数 0

3Sum(三数和)

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of...

2017-01-06 14:51:46

阅读数 264

评论数 0

Container With Most Water(最大容器)

Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoi...

2016-12-22 10:33:03

阅读数 481

评论数 0

Palindrome Number(回文数字)

Determine whether an integer is a palindrome. Do this without extra space.(判断一个整型数是否是回文,要求不能借用额外的空间)1.个人分析 题目中的额外空间应该是指空间复杂度为O(1),所有的负数不属于回文数。2.个人解法...

2016-12-18 20:49:42

阅读数 603

评论数 0

Reverse Integer(反转整型数)

Reverse digits of an integer.(反转一个整型数)Example1: x = 123, return 321 Example2: x = -123, return -3211.个人分析 思路一:整型数转字符串->反转字符串->字符串转整型 思路二:数学解...

2016-12-12 16:58:18

阅读数 1059

评论数 0

ZigZag Conversion(“Z”形转换)

The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (字符串”PAYPALISHIRING”以给定的行数写成如下Z形模式) (you may want ...

2016-12-12 16:53:25

阅读数 1355

评论数 0

Longest Substring Without Repeating Characters(无重复最长子串)

Given a string, find the length of the longest substring without repeating characters.(给定一字符串,找出无重复的最长子串的长度)Examples: Given “abcabcbb”, the answer i...

2016-12-05 15:30:26

阅读数 433

评论数 0

Add Two Numbers(基于链表的两数相加)

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single...

2016-12-03 14:26:15

阅读数 514

评论数 0

Two Sum(两数之和)

Given an array of integers, return indices of the two numbers such that they add up to a specific target.(给定一个整型数组,返回两数和的索引,这两数的和必须得到指定的目标)You may as...

2016-12-02 18:12:49

阅读数 214

评论数 0

Binary Tree Paths(二叉树的路径)

Given a binary tree, return all root-to-leaf paths.(给定一棵二叉树,返回所有根节点到叶子节点的路径)For example, given the following binary tree: 1 / \ 2 3 \ 5Al...

2016-12-01 13:00:52

阅读数 289

评论数 0

Counting Bits(统计比特位)

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and ...

2016-11-30 10:54:52

阅读数 491

评论数 0

Balanced Binary Tree(平衡二叉树)

Given a binary tree, determine if it is height-balanced.(给定一棵二叉树,判断该树的高度是否平衡)For this problem, a height-balanced binary tree is defined as a binary t...

2016-11-29 18:51:27

阅读数 485

评论数 0

Number of Boomerangs(统计"boomerang"的数目)

Given n points in the plane that are all pairwise distinct, a “boomerang” is a tuple of points (i, j, k) such that the distance between i and j equal...

2016-11-28 14:50:48

阅读数 312

评论数 0

House Robber(窃贼的计划)

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping y...

2016-11-10 21:08:11

阅读数 282

评论数 0

Symmetric Tree(对称树)

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).(给定一棵二叉树,判断其是否对称)For example, this binary tree [1,2,2,3...

2016-11-09 16:44:44

阅读数 211

评论数 0

Binary Tree Level Order Traversal II(层次遍历二叉树II)

Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).(给定一...

2016-11-08 11:10:43

阅读数 294

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭